IRunnerSequenceOptions interface
đ Descriptionâ
Options interface for enabling the sequence
mode in the useRunner
hook. In sequence mode, all blocks (questions as you will) of a form are placed in a sequence array. Only one item in the sequence can be activated at once. This makes it easier to make visual (animable) transitions when moving through the blocks. This is useful for certain types of runners, such as the chat stock runner.
đ Type declarationâ
interface IRunnerSequenceOptions { mode: "sequence"; namespace?: string;Optional autoStart?: boolean;Optional onInteraction?: () => void;EventOptional onPreview?: ( action: "start" | "end", type: "prologue" | "block" | "epilogue", blockId?: string ) => void;EventOptional onRestart?: () => void;EventOptional onDestroy?: () => void;EventOptional canActivate?: (item: IRunnerSequenceItem) => boolean;FunctionOptional canInteract?: (item: IRunnerSequenceItem) => boolean;FunctionOptional canSkip?: (item: IRunnerSequenceItem) => boolean;FunctionOptional preActiveDuration?: (item: IRunnerSequenceItem) => number | undefined;FunctionOptional beforeActiveDuration?: (item: IRunnerSequenceItem) => number | undefined;FunctionOptional afterActiveDuration?: (item: IRunnerSequenceItem) => number | undefined;FunctionOptional postActiveDuration?: (item: IRunnerSequenceItem) => number | undefined;FunctionOptional banner?: (l10n: L10n.Namespace) => IEpilogue;FunctionOptional }
đī¸ Propertiesâ
đˇī¸ autoStart
â
Specifies if the runner should automatically start.
Typeâ
boolean
đˇī¸ mode
â
Specifies the runner is in sequence
mode.
Typeâ
"sequence"
đˇī¸ namespace
â
Specifies the identifier of the namespace to use for the runner.
Typeâ
string
âļī¸ Functionsâ
đ§ afterActiveDuration
â
Invoked when the runner wants to know if there should be a certain time duration (in milliseconds) for the after-active stage of a sequence item.
This is used to control the timing of animations for the transition between items.
Signatureâ
(item: IRunnerSequenceItem) => number | undefined
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
item | IRunnerSequenceItem | No | Reference to the item. |
Return valueâ
Specifies the duration in milliseconds or undefined
if this stage should be skipped.
đ§ banner
â
Specifies a banner to show in the runner.
Signatureâ
(l10n: L10n.Namespace) => IEpilogue
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
l10n | L10n.Namespace | No | Reference to the translation namespace. |
Return valueâ
Specifies the banner as an IEpilogue
object.
đ§ beforeActiveDuration
â
Invoked when the runner wants to know if there should be a certain time duration (in milliseconds) for the before-active stage of a sequence item.
This is used to control the timing of animations for the transition between items.
Signatureâ
(item: IRunnerSequenceItem) => number | undefined
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
item | IRunnerSequenceItem | No | Reference to the item. |
Return valueâ
Specifies the duration in milliseconds or undefined
if this stage should be skipped.
đ§ canActivate
â
Invoked when the runner wants to know if a certain sequence item can be activated.
Signatureâ
(item: IRunnerSequenceItem) => boolean
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
item | IRunnerSequenceItem | No | Reference to the item. |
Return valueâ
Should return true
when the item can be activated.
đ§ canInteract
â
Invoked when the runner wants to know if the user can interact with a certain sequence item.
Signatureâ
(item: IRunnerSequenceItem) => boolean
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
item | IRunnerSequenceItem | No | Reference to the item. |
Return valueâ
Should return true
when the item can interact.
đ§ canSkip
â
Invoked when the runner wants to know if a certain sequence item can be skipped.
Signatureâ
(item: IRunnerSequenceItem) => boolean
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
item | IRunnerSequenceItem | No | Reference to the item. |
Return valueâ
Should return true
when the item can be skipped.
đ§ postActiveDuration
â
Invoked when the runner wants to know if there should be a certain time duration (in milliseconds) for the post-active stage of a sequence item.
This is used to control the timing of animations for the transition between items.
Signatureâ
(item: IRunnerSequenceItem) => number | undefined
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
item | IRunnerSequenceItem | No | Reference to the item. |
Return valueâ
Specifies the duration in milliseconds or undefined
if this stage should be skipped.
đ§ preActiveDuration
â
Invoked when the runner wants to know if there should be a certain time duration (in milliseconds) for the pre-active stage of a sequence item.
This is used to control the timing of animations for the transition between items.
Signatureâ
(item: IRunnerSequenceItem) => number | undefined
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
item | IRunnerSequenceItem | No | Reference to the item. |
Return valueâ
Specifies the duration in milliseconds or undefined
if this stage should be skipped.
đĸ Eventsâ
đ onDestroy
â
Invoked when the runner is destroyed.
Signatureâ
() => void
đ onInteraction
â
Invoked when there is user interaction with the runner.
Signatureâ
() => void
đ onPreview
â
Invoked when the builder requests a preview.
Signatureâ
(
action: "start" | "end",
type: "prologue" | "block" | "epilogue",
blockId?: string
) => void
Parametersâ
Name | Type | Optional | Description |
---|---|---|---|
action | "start" | "end" | No | Specifies the preview action. |
type | "prologue" | "block" | "epilogue" | No | Specifies the preview type. |
blockId | string | Yes | Specifies the block identifier when type is block . |
đ onRestart
â
Invoked when the runner is restarted.
Signatureâ
() => void