IClassicController interface
đ Descriptionâ
Interface for controlling the runner. This interface is used when using the controller prop of the ClassicRunner component.
đ Type declarationâ
interface IClassicController { definition: IDefinition; styles: IClassicStyles; l10n: IL10n; view: "live" | "test" | "preview"; instance: Instance | undefined;Readonly fingerprint: string;Readonly snapshot: ISnapshot | undefined;Readonly isRunning: boolean;Readonly isFinishing: boolean;Readonly isPausing: boolean;Readonly allowStart: boolean;Readonly allowRestart: boolean;Readonly allowPause: boolean;Readonly allowStop: boolean;Readonly start: () => void;Function restart: () => void;Function pause: () => ISnapshot | Promise<ISnapshot> | undefined;Function stop: () => void;Function doPreview: (data: TRunnerPreviewData) => void;Function }
đī¸ Propertiesâ
đˇī¸ allowPauseâ
Retrieves if the runner allows pausing the form.
Typeâ
boolean
đˇī¸ allowRestartâ
Retrieves if the runner allows restarting the form.
Typeâ
boolean
đˇī¸ allowStartâ
Retrieves if the runner allows starting the form.
Typeâ
boolean
đˇī¸ allowStopâ
Retrieves if the runner allows stopping the form.
Typeâ
boolean
đˇī¸ definitionâ
Sets or retrieves the current form definition of the runner.
Typeâ
đˇī¸ fingerprintâ
Retrieves the unique fingerprint of the current form definition. This is a SHA-256 hash of the form that is stable as long as the structure of the form is not changed. Textual changes in the content of the form definition will not alter the fingerprint hash. But adding, removing or reordering elements does.
Typeâ
string
Read the Form fingerprint guide for more information about the form fingerprint.
đˇī¸ instanceâ
Reference to the active form instance.
Typeâ
Instance | undefined
This property is undefined when no form has started yet.
đˇī¸ isFinishingâ
Retrieves if an active form instance is currently finishing. This property is true when a respondent completes the form and the runner is submitting the response data to an endpoint.
Typeâ
boolean
đˇī¸ isPausingâ
Retrieves if an active form instance is currently pausing. This property is true when a respondent requests to pause the form and the runner is submitting the snapshot data to an endpoint.
Typeâ
boolean
đˇī¸ isRunningâ
Retrieves if an active form instance is running.
Typeâ
boolean
đˇī¸ l10nâ
Sets or retrieves the current locale and translation settings.
Typeâ
Read the Localization guide for more information about locales and translations.
đˇī¸ snapshotâ
Retrieves a snapshot of the active form instance. A snapshot can be used to restore/resume a form later on.
Typeâ
Read the Pause and resume guide for more information about pausing and resuming runners.
đˇī¸ stylesâ
Sets or retrieves the current styles (colors, font, size, etc.) of the runner.
Typeâ
Read the Style forms guide for more information about the runner styles.
đˇī¸ viewâ
Sets or retrieves the current view mode of the runner. It can be one of the following values:
live: The form is running in normal (production) mode;test: The form is running in test mode (no response data is submitted);preview: The form is running in preview mode, which shows all blocks in a single view.
Typeâ
"live" | "test" | "preview"
âļī¸ Functionsâ
đ§ doPreviewâ
Request a preview of the specified element of the form. This function is used in a live preview setup to bring a certain element in the form into view.
Signatureâ
(data: TRunnerPreviewData) => void
Parametersâ
| Name | Type | Optional | Description |
|---|---|---|---|
data | TRunnerPreviewData | No | Specifies the preview data. |
Read the Live form preview guide for an example.
đ§ pauseâ
Pauses the active form instance.
Signatureâ
() => ISnapshot | Promise<ISnapshot> | undefined
Return valueâ
Returns the ISnapshot object, a Promise for that object or undefined if the pause operation failed.
đ§ restartâ
Restart with a new empty form instance.
Signatureâ
() => void
đ§ startâ
Starts a new form instance.
Signatureâ
() => void
đ§ stopâ
Stops the active form instance.
Signatureâ
() => void