AvatarFormState
Avatar form state object that describes a form state and implements the logic of transitions, reactions and form filling.
Props
attempts
attempts: number
| undefined
Number of attempts to fill the form. Optional, the default values is 3
beforeExit
beforeExit: (event: AvatarStateChangeEvent) => void,Promise<void>
| undefined
Triggers when the dialog leaves the state
clearParameter
clearParameter: (name: string) => void
Clears a specific form state's parameter by name
clearParameters
clearParameters: () => void
Clears all the form state's parameters
exitIntents
exitIntents: string[]
List of utterances to exit the form state. Optional
getParameter
getParameter: (name: string) => AvatarFormStateParameter
Gets a specific parameter from the form state by name
getParameters
getParameters: () => AvatarFormStateParameter[]
Gets all the parameters from the form state
isFormComplete
isFormComplete: boolean
Specifies whether the form state is complete
name
name: string
State name
onEnter
onEnter: (event: AvatarStateChangeEvent) => AvatarResponse,Promise<AvatarResponse>
| undefined
Triggers when the dialog enters the state
onExitIntent
onExitIntent: (utteranceResponse: AvatarUtteranceEvent) => AvatarResponse,Promise<AvatarResponse>
Triggers when an exit intent is occurred
onFormComplete
onFormComplete: (formData: AvatarFormState) => AvatarResponse,Promise<AvatarResponse>
Triggers when a form filling is successfully completed
onFormFailed
onFormFailed: (formData: AvatarFormState) => AvatarResponse,Promise<AvatarResponse>
Triggers when a form filling is failed
onTimeout
onTimeout: (event: AvatarTimeoutEvent) => AvatarResponse,Promise<AvatarResponse>
| undefined
Triggers when a timeout for a user input occurs. The value is in milliseconds
utteranceCounter
utteranceCounter: number
Number of user phrases processed in this state. This counter is reset when changing the state to any other (or the same) one
visitsCounter
visitsCounter: number
Number of the state visits