Skip to main content

IRunnerSequenceOptions interface

📖 Description​

Options interface for enabling the sequence mode in the useRunnerFoundation 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
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🗃ī¸ 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.

info

This is used to control the timing of animations for the transition between items.

Signature​

(item: IRunnerSequenceItem) => number | undefined

Parameters​

NameTypeOptionalDescription
itemIRunnerSequenceItemNoReference to the item.

Return value​

Specifies the duration in milliseconds or undefined if this stage should be skipped.


Specifies a banner to show in the runner.

Signature​

(l10n: L10n.Namespace) => IEpilogue

Parameters​

NameTypeOptionalDescription
l10nL10n.NamespaceNoReference 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.

info

This is used to control the timing of animations for the transition between items.

Signature​

(item: IRunnerSequenceItem) => number | undefined

Parameters​

NameTypeOptionalDescription
itemIRunnerSequenceItemNoReference 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​

NameTypeOptionalDescription
itemIRunnerSequenceItemNoReference 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​

NameTypeOptionalDescription
itemIRunnerSequenceItemNoReference 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​

NameTypeOptionalDescription
itemIRunnerSequenceItemNoReference 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.

info

This is used to control the timing of animations for the transition between items.

Signature​

(item: IRunnerSequenceItem) => number | undefined

Parameters​

NameTypeOptionalDescription
itemIRunnerSequenceItemNoReference 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.

info

This is used to control the timing of animations for the transition between items.

Signature​

(item: IRunnerSequenceItem) => number | undefined

Parameters​

NameTypeOptionalDescription
itemIRunnerSequenceItemNoReference 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​

NameTypeOptionalDescription
action"start" | "end"NoSpecifies the preview action.
type"prologue" | "block" | "epilogue"NoSpecifies the preview type.
blockIdstringYesSpecifies the block identifier when type is block.

🔔 onRestart​

Invoked when the runner is restarted.

Signature​

() => void