Storyline class
📖 Description
The Storyline
class helps to render runners by supplying all the required properties and methods for rendering the form.
🗃️ Fields
🏷️ all
Retrieves all observable nodes of the active moment (so the nodes of all moments in the moments
collection) with their corresponding bookmark.
Type
(IObservableNode & { bookmark: IBookmark })[]
🏷️ activePage
Retrieves the active page.
Only available for runners in paginated mode.
Type
{
/* Contains the page number. */
number: number;
} | undefined
🏷️ bookmarks
Retrieves the bookmarks in the storyline.
Type
🏷️ checksum
Retrieves the checksum of the storyline.
Type
string | undefined
🏷️ count
Retrieves the total number of observable nodes in the storyline.
Type
number
🏷️ direction
Retrieves the most recent step direction of the storyline.
Type
"forward" | "backward"
🏷️ enumerators
Retrieves the total number of observable nodes that have an enumerator value.
Type
number
🏷️ epilogue
Retrieves the optional epilogue for the form. This epilogue can be used by runners (that support it) to show a closing message when the form is completed.
Type
🏷️ hasDataCollected
Retrieves if the storyline has any data collected.
Type
boolean
🏷️ immutable
Retrieves an immutable representation of the storyline.
Type
🏷️ instance
Retrieves the instance of the storyline.
Type
🏷️ isAtFinish
Retrieves if the present moment is at the finish of the storyline.
Type
boolean
🏷️ isAtHead
Retrieves if the present moment is at the head of the storyline.
Type
boolean
🏷️ isAtStart
Retrieves if the present moment is at the beginning of the storyline.
Type
boolean
🏷️ isChanged
Retrieves if the storyline has changed since the last call of this prop.
Type
boolean
🏷️ isEmpty
Retrieves if the storyline is empty (has no observable nodes, basically an empty form).
Type
boolean
🏷️ isEvaluating
Retrieves if the storyline is evaluating.
Type
boolean
🏷️ isFailed
Retrieves if the validation of the storyline failed.
Type
boolean
🏷️ isFinishable
Retrieves if the storyline is finishable using the finish
method.
Type
boolean
🏷️ isFinished
Retrieves if the storyline is finished.
Type
boolean
🏷️ isFinishing
Retrieves if the storyline is finishing.
Type
boolean
🏷️ isPassed
Retrieves if the validation of the storyline passed.
Type
boolean
🏷️ isPaused
Retrieves if the storyline is paused.
Type
boolean
🏷️ isPausing
Retrieves if the storyline is pausing.
Type
boolean
🏷️ mode
Retrieves the mode of operation. It can be one of the following values:
paginated
: Render each section on a separate page (this is the default behavior);continuous
: Render all completed (past) sections and the current (present) section on a page;progressive
: Render all completed (past), current (present) and future sections on a page till the point where one of the sections fails validation;ahead
: Render all completed (past), current (present) and future sections on a page, regardless of the section's validation result.
Type
"paginated" | "continuous" | "progressive" | "ahead"
🏷️ moments
Retrieves the moments that are in the storyline. There are three types of moments:
- Past moments;
- The present moment;
- Future moments.
The best way to understand these moment types is to visualize a paginated form runner, where the questions (node blocks) are presented on a page. Each section is a page. All pages that are already answered by the respondent are past moments. The current page the respondent is on is the present moment. And all the pages the respondent still needs to answer are future moments.
Type
🏷️ nodes
Retrieves the observable nodes of the active moments (so the nodes of all moments in the moments
collection).