Generated using TypeDoc
Optional override for formatting stack traces
Return the direction of an arrow - right
, left
, or both
.
import { arrow_direction } from 'jssm';
arrow_direction('->'); // 'right'
arrow_direction('<~=>'); // 'both'
The arrow to be evaluated
- Return the direction of an arrow - right
, left
, or both
.
import { arrow_left_kind } from 'jssm';
arrow_left_kind('<-'); // 'legal'
arrow_left_kind('<='); // 'main'
arrow_left_kind('<~'); // 'forced'
arrow_left_kind('<->'); // 'legal'
arrow_left_kind('->'); // 'none'
The arrow to be evaluated
- Return the direction of an arrow - right
, left
, or both
.
import { arrow_left_kind } from 'jssm';
arrow_left_kind('->'); // 'legal'
arrow_left_kind('=>'); // 'main'
arrow_left_kind('~>'); // 'forced'
arrow_left_kind('<->'); // 'legal'
arrow_left_kind('<-'); // 'none'
The arrow to be evaluated
-Compile a machine's JSON intermediate representation to a config object. If you're using this (probably don't,) you're probably also using parse to get the IR, and the object constructor @@ -43,7 +43,7 @@
The type of the machine data member; usually omitted
The parse tree to be boiled down into a machine config
-Create a state machine from an implementation string. This is one of the two main paths for working with JSSM, alongside sm.
Use this method when you want to conveniently pull a state machine from a @@ -57,7 +57,7 @@
The FSL code to evaluate
Extra non-code configuration to pass at creation time
-The FSL code to be evaluated and built into a machine config
-This method wraps the parser call that comes from the peg grammar, parse. Generally neither this nor that should be used directly unless you mean to develop plugins or extensions for the machine.
@@ -96,7 +96,7 @@The FSL code to be evaluated
Things to control about the instance
-Create a state machine from a template string. This is one of the two main paths for working with JSSM, alongside from.
Use this method when you want to work directly and conveniently with a @@ -110,7 +110,7 @@
The assembled code
The mechanic for template argument insertion
-An internal method meant to take a series of declarations and fold them into a single multi-faceted declaration, in the process of building a state. Not generally meant for external use.
diff --git a/docs/docs/modules/jssm_constants.html b/docs/docs/modules/jssm_constants.html index 1dae2912..cca1d0ae 100644 --- a/docs/docs/modules/jssm_constants.html +++ b/docs/docs/modules/jssm_constants.html @@ -1 +1 @@ -Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
A type teaching Typescript the various supported shapes for nodes, mostly inherited from GraphViz
-Generated using TypeDoc
Generated using TypeDoc
Returns the histograph of an array as a Map
. Makes no attempt to cope
with deep equality; will fail for complex contents, as such.
import { histograph } from './jssm';
histograph( [0, 0, 1, 1, 2, 2, 1] ); // Map()
-Predicate for validating an array for uniqueness. Not generally meant for external use.
- Lists all repeated items in an array along with their counts. Subject to
matching rules of Map. NaN
is manually removed because of conflict rules
around unique. Because these are compared with ===
and because
@@ -14,24 +14,24 @@
arrays and objects are never considered repeats.
find_repeated<string>([ ]); // []
find_repeated<string>([ "one" ]); // []
find_repeated<string>([ "one", "two" ]); // []
find_repeated<string>([ "one", "one" ]); // [ ["one", 2] ]
find_repeated<string>([ "one", "two", "one" ]); // [ ["one", 2] ]
find_repeated<number>([ 0, NaN, 0, NaN ]); // [ [0, 2] ]
-Creates a SplitMix32 random generator. Used by the randomness test suite.
Sourced from bryc
: https://github.com/bryc/code/blob/master/jshash/PRNGs.md#splitmix32
Replaces the Mulberry generator, which was found to have problems
-Internal method generating names for edges for the hook lookup map. Not meant for external use.
-Internal method generating names for edges for the hook lookup map. Not meant for external use.
-Internal method generating names for actions for the hook lookup map. Not meant for external use.
- Returns, for a non-negative integer argument n
, the series [0 .. n]
.
import { seq } from './jssm';
seq(5); // [0, 1, 2, 3, 4]
seq(0); // []
- Reduces an array to its unique contents. Compares with ===
and makes no
effort to deep-compare contents; two matching arrays or objects contained
will be treated as distinct, according to javascript rules. This also means
diff --git a/docs/docs/modules/version.html b/docs/docs/modules/version.html
index 3909acbc..b708dd33 100644
--- a/docs/docs/modules/version.html
+++ b/docs/docs/modules/version.html
@@ -1 +1 @@
-
Generated using TypeDoc
Generated using TypeDoc
All notable changes to this project will be documented in this file.
-1178 merges; 206 releases
+1179 merges; 208 releases
Published tags:
-5.101.0, 5.100.0, 5.99.0, 5.98.8, 5.98.7, 5.98.2, 5.98.0, 5.97.1, 5.97.0, 5.96.1, 5.96.0, 5.95.0, 5.94.0, 5.93.0, 5.91.1, 5.91.0, 5.90.1, 5.90.0, 5.89.6, 5.89.3, 5.89.2, 5.89.1, 5.89.0, 5.88.4, 5.88.3, 5.88.2, 5.88.1, 5.88.0, 5.87.0, 5.86.3, 5.86.2, 5.86.1, 5.86.0, 5.85.11, 5.85.10, 5.85.9, 5.85.8, 5.85.7, 5.85.6, 5.85.5, 5.85.4, 5.85.3, 5.85.2, 5.85.1, 5.85.0, 5.84.1, 5.84.0, 5.83.2, 5.83.1, 5.83.0, 5.82.5, 5.82.4, 5.82.3, 5.82.2, 5.82.1, 5.82.0, 5.81.2, 5.81.0, 5.80.1, 5.80.0, 5.79.18, 5.79.17, 5.79.16, 5.79.15, 5.79.11, 5.79.10, 5.79.9, 5.79.8, 5.79.6, 5.79.4, 5.79.3, 5.79.2, 5.79.1, 5.79.0, 5.78.0, 5.77.1, 5.77.0, 5.76.2, 5.76.0, 5.75.1, 5.75.0, 5.74.0, 5.73.1, 5.73.0, 5.72.5, 5.72.4, 5.72.3, 5.72.2, 5.72.1, 5.72.0, 5.71.1, 5.71.0, 5.70.36, 5.70.35, 5.70.34, 5.70.33, 5.70.32, 5.70.31, 5.70.30, 5.70.29, 5.70.28, 5.70.27, 5.70.26, 5.70.25, 5.70.24, 5.70.23, 5.70.22, 5.70.21, 5.70.20, 5.70.19, 5.70.18, 5.70.16, 5.70.15, 5.70.14, 5.70.13, 5.70.12, 5.70.11, 5.70.10, 5.70.9, 5.70.8, 5.70.7, 5.70.6, 5.70.5, 5.70.4, 5.70.3, 5.70.2, 5.70.1, 5.70.0, 5.69.4, 5.69.3, 5.69.2, 5.69.0, 5.68.0, 5.67.2, 5.67.0, 5.66.0, 5.65.14, 5.65.12, 5.65.11, 5.65.10, 5.65.9, 5.65.8, 5.65.7, 5.65.5, 5.65.4, 5.65.3, 5.65.2, 5.65.1, 5.65.0, 5.64.2, 5.64.1, 5.64.0, 5.63.0, 5.62.0, 5.61.4, 5.61.3, 5.61.2, 5.61.1, 5.60.4, 5.60.3, 5.60.0, 5.59.1, 5.59.0, 5.58.1, 5.58.0, 5.57.1, 5.57.0, 5.56.2, 5.56.1, 5.55.0, 5.54.0, 5.53.0, 5.52.0, 5.51.0, 5.50.0, 5.49.0, 5.48.0, 5.47.0, 5.46.0, 5.45.2, 5.45.0, 5.44.0, 5.43.2, v5.42.0, 5.42.0, v5.41.15, 5.41.15, v5.41.14, 5.41.14, v5.41.12, 5.41.12, v5.41.10, 5.41.10, v5.41.9, 5.41.9, v5.41.8, 5.41.8, v5.41.7, v5.41.2, v5.41.1, v5.32.14, 5.14.0, 5.12.0, 5.11.12, 5.11.1, 5.11.0
+5.103.0, 5.102.1, 5.101.0, 5.100.0, 5.99.0, 5.98.8, 5.98.7, 5.98.2, 5.98.0, 5.97.1, 5.97.0, 5.96.1, 5.96.0, 5.95.0, 5.94.0, 5.93.0, 5.91.1, 5.91.0, 5.90.1, 5.90.0, 5.89.6, 5.89.3, 5.89.2, 5.89.1, 5.89.0, 5.88.4, 5.88.3, 5.88.2, 5.88.1, 5.88.0, 5.87.0, 5.86.3, 5.86.2, 5.86.1, 5.86.0, 5.85.11, 5.85.10, 5.85.9, 5.85.8, 5.85.7, 5.85.6, 5.85.5, 5.85.4, 5.85.3, 5.85.2, 5.85.1, 5.85.0, 5.84.1, 5.84.0, 5.83.2, 5.83.1, 5.83.0, 5.82.5, 5.82.4, 5.82.3, 5.82.2, 5.82.1, 5.82.0, 5.81.2, 5.81.0, 5.80.1, 5.80.0, 5.79.18, 5.79.17, 5.79.16, 5.79.15, 5.79.11, 5.79.10, 5.79.9, 5.79.8, 5.79.6, 5.79.4, 5.79.3, 5.79.2, 5.79.1, 5.79.0, 5.78.0, 5.77.1, 5.77.0, 5.76.2, 5.76.0, 5.75.1, 5.75.0, 5.74.0, 5.73.1, 5.73.0, 5.72.5, 5.72.4, 5.72.3, 5.72.2, 5.72.1, 5.72.0, 5.71.1, 5.71.0, 5.70.36, 5.70.35, 5.70.34, 5.70.33, 5.70.32, 5.70.31, 5.70.30, 5.70.29, 5.70.28, 5.70.27, 5.70.26, 5.70.25, 5.70.24, 5.70.23, 5.70.22, 5.70.21, 5.70.20, 5.70.19, 5.70.18, 5.70.16, 5.70.15, 5.70.14, 5.70.13, 5.70.12, 5.70.11, 5.70.10, 5.70.9, 5.70.8, 5.70.7, 5.70.6, 5.70.5, 5.70.4, 5.70.3, 5.70.2, 5.70.1, 5.70.0, 5.69.4, 5.69.3, 5.69.2, 5.69.0, 5.68.0, 5.67.2, 5.67.0, 5.66.0, 5.65.14, 5.65.12, 5.65.11, 5.65.10, 5.65.9, 5.65.8, 5.65.7, 5.65.5, 5.65.4, 5.65.3, 5.65.2, 5.65.1, 5.65.0, 5.64.2, 5.64.1, 5.64.0, 5.63.0, 5.62.0, 5.61.4, 5.61.3, 5.61.2, 5.61.1, 5.60.4, 5.60.3, 5.60.0, 5.59.1, 5.59.0, 5.58.1, 5.58.0, 5.57.1, 5.57.0, 5.56.2, 5.56.1, 5.55.0, 5.54.0, 5.53.0, 5.52.0, 5.51.0, 5.50.0, 5.49.0, 5.48.0, 5.47.0, 5.46.0, 5.45.2, 5.45.0, 5.44.0, 5.43.2, v5.42.0, 5.42.0, v5.41.15, 5.41.15, v5.41.14, 5.41.14, v5.41.12, 5.41.12, v5.41.10, 5.41.10, v5.41.9, 5.41.9, v5.41.8, 5.41.8, v5.41.7, v5.41.2, v5.41.1, v5.32.14, 5.14.0, 5.12.0, 5.11.12, 5.11.1, 5.11.0
+ - -
Commit e2a01ddfc21abc4b0a0f142178e726fc86360d4a
+Author: John Haugeland <stonecypher@gmail.com>
+
+ + + + +
Commit 5c4c9ae8e6553078ffe3dc9a762f45e061fa78ac
Author: John Haugeland <stonecypher@gmail.com>
- Preparing search index...
- The search index is not available
JSSM, a JavaScript state machine - the FSM for FSLClass Machine<mDT>
Type Parameters
mDT
Hierarchy
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Type Parameters
mDT
Parameters
__namedParameters: JssmGenericConfig<string, mDT>
Returns Machine<mDT>
Properties
_actions
_active_ state_ style
_after_ hooks
_after_ mapping
_any_ action_ hook
_any_ transition_ hook
_arrange_ declaration
_arrange_ end_ declaration
_arrange_ start_ declaration
_clear_ timeout_ source
Type declaration
Parameters
h: any
Returns void
_code_ allows_ override
_config_ allows_ override
_create_ started
_created
Optional _data
_default_ properties
_dot_ preamble
_edge_ map
_edges
_end_ state_ style
_end_ states
_entry_ hooks
_exit_ hooks
_flow
_forced_ transition_ hook
Optional _fsl_ version
_global_ action_ hooks
_graph_ layout
_has_ after_ hooks
_has_ basic_ hooks
_has_ entry_ hooks
_has_ exit_ hooks
_has_ forced_ transitions
_has_ global_ action_ hooks
_has_ hooks
_has_ named_ hooks
_has_ post_ basic_ hooks
_has_ post_ entry_ hooks
_has_ post_ exit_ hooks
_has_ post_ global_ action_ hooks
_has_ post_ hooks
_has_ post_ named_ hooks
_has_ post_ transition_ hooks
_has_ transition_ hooks
_history
_history_ length
_hooked_ state_ style
_hooks
_instance_ name
Optional _machine_ author
Optional _machine_ comment
Optional _machine_ contributor
Optional _machine_ definition
Optional _machine_ language
Optional _machine_ license
Optional _machine_ name
Optional _machine_ version
_main_ transition_ hook
_named_ hooks
_named_ transitions
_post_ any_ action_ hook
_post_ any_ transition_ hook
_post_ entry_ hooks
_post_ exit_ hooks
_post_ forced_ transition_ hook
_post_ global_ action_ hooks
_post_ hooks
_post_ main_ transition_ hook
_post_ named_ hooks
_post_ standard_ transition_ hook
_property_ keys
Optional _raw_ state_ declaration
_required_ properties
_reverse_ action_ targets
_reverse_ actions
_rng
_rng_ seed
_standard_ transition_ hook
_start_ state_ style
_start_ states
_state
_state_ declarations
_state_ labels
_state_ properties
_state_ style
_states
_terminal_ state_ style
_themes
_time_ source
Type declaration
Returns number
_timeout_ handle
_timeout_ source
Type declaration
Parameters
Function: any
number: any
Returns number
_timeout_ target
_timeout_ target_ time
Accessors
active_ state_ style
Get the style for the active state. Does not include composition from an applied theme, or things from the underlying base stylesheet; only the modifications applied by this machine.
Returns Partial<JssmStateDeclaration>
allows_ override
Returns Partial<JssmStateDeclaration>
allows_ override
Check if a machine allows overriding state and data.
-Returns JssmAllowsOverride
code_ allows_ override
Returns JssmAllowsOverride
code_ allows_ override
Check if the code that built the machine allows overriding state and data.
-Returns JssmAllowsOverride
config_ allows_ override
Returns JssmAllowsOverride
config_ allows_ override
Check if the machine config allows overriding state and data.
-Returns JssmAllowsOverride
create_ start_ time
Returns number
creation_ date
Returns Date
creation_ timestamp
Returns number
end_ state_ style
Returns JssmAllowsOverride
create_ start_ time
Returns number
creation_ date
Returns Date
creation_ timestamp
Returns number
end_ state_ style
Get the end state style. Does not include composition from an applied theme, or things from the underlying base stylesheet; only the modifications applied by this machine.
@@ -23,7 +23,7 @@ is not a terminal state. -Returns Partial<JssmStateDeclaration>
history
Returns Partial<JssmStateDeclaration>
history
Get a truncated history of the recent states and data of the machine. Turned off by default; configure with
@@ -32,7 +32,7 @@.from('...', {data: 5})
by length, or set.history_length
at runtime.Notice that the machine's current state,
-e
, is not in the returned list.Returns [string, mDT][]
history_ inclusive
Returns [string, mDT][]
history_ inclusive
Get a truncated history of the recent states and data of the machine, including the current state. Turned off by default; configure with
@@ -44,17 +44,17 @@.from('...', {data: 5})
by length, or set.history_length
at runtime.Notice that the machine's current state,
-e
, is in the returned list.Returns [string, mDT][]
history_ length
Returns [string, mDT][]
history_ length
Find out how long a history this machine is keeping. Defaults to zero. Settable directly.
Returns number
Returns number
Find out how long a history this machine is keeping. Defaults to zero. Settable directly.
Parameters
to: number
Returns void
hooked_ state_ style
Parameters
to: number
Returns void
hooked_ state_ style
Get the hooked state style. Does not include composition from an applied theme, or things from the underlying base stylesheet; only the modifications applied by this machine.
@@ -63,13 +63,13 @@ that would be literally every node. -Returns Partial<JssmStateDeclaration>
rng_ seed
Returns number
Parameters
to: number
Returns void
standard_ state_ style
Returns Partial<JssmStateDeclaration>
rng_ seed
Returns number
Parameters
to: number
Returns void
standard_ state_ style
Get the standard style for a single state. Does not include composition from an applied theme, or things from the underlying base stylesheet; only the modifications applied by this machine.
Returns Partial<JssmStateDeclaration>
start_ state_ style
Returns Partial<JssmStateDeclaration>
start_ state_ style
Get the start state style. Does not include composition from an applied theme, or things from the underlying base stylesheet; only the modifications applied by this machine.
@@ -77,7 +77,7 @@ are the first mentioned state. -Returns Partial<JssmStateDeclaration>
terminal_ state_ style
Returns Partial<JssmStateDeclaration>
terminal_ state_ style
Get the terminal state style. Does not include composition from an applied theme, or things from the underlying base stylesheet; only the modifications applied by this machine.
@@ -85,9 +85,9 @@ state without a valid exit transition is terminal. -Returns Partial<JssmStateDeclaration>
themes
Returns "default" | "modern" | "ocean" | "bold" | "plain" | ("default" | "modern" | "ocean" | "bold" | "plain")[]
Parameters
to: "default" | "modern" | "ocean" | "bold" | "plain" | ("default" | "modern" | "ocean" | "bold" | "plain")[]
Returns void
uses_ actions
Returns boolean
uses_ forced_ transitions
Returns boolean
Methods
_new_ state
Returns Partial<JssmStateDeclaration>
themes
Returns "default" | "modern" | "ocean" | "bold" | "plain" | ("default" | "modern" | "ocean" | "bold" | "plain")[]
Parameters
to: "default" | "modern" | "ocean" | "bold" | "plain" | ("default" | "modern" | "ocean" | "bold" | "plain")[]
Returns void
uses_ actions
Returns boolean
uses_ forced_ transitions
Returns boolean
Methods
_new_ state
Internal method for fabricating states. Not meant for external use.
-Parameters
state_config: JssmGenericState
Returns string
action
Parameters
state_config: JssmGenericState
Returns string
action
Instruct the machine to complete an action. Synonym for do.
The action to engage
Optional newData: mDT
The data change to insert during the action
-Returns boolean
actions
Returns boolean
actions
List all actions available from this state. Please note that the order of the actions is not guaranteed.
Parameters
whichState: string = ...
The state whose actions to have listed
-Returns string[]
all_ themes
Returns ("default" | "modern" | "ocean" | "bold" | "plain")[]
auto_ set_ state_ timeout
Returns void
clear_ state_ timeout
Returns void
current_ action_ edge_ for
Parameters
action: string
Returns JssmTransition<string, mDT>
current_ action_ for
Parameters
action: string
Returns number
current_ state_ timeout
Returns [string, number]
data
Returns string[]
all_ themes
Returns ("default" | "modern" | "ocean" | "bold" | "plain")[]
auto_ set_ state_ timeout
Returns void
clear_ state_ timeout
Returns void
current_ action_ edge_ for
Parameters
action: string
Returns JssmTransition<string, mDT>
current_ action_ for
Parameters
action: string
Returns number
current_ state_ timeout
Returns [string, number]
data
Get the current data of a machine.
Returns mDT
display_ text
Returns mDT
display_ text
Get whatever the node should show as text.
Currently, this means to get the label for a given state, if any; otherwise to return the node's name. However, this definition is expected @@ -115,7 +115,7 @@
See also label_for.
-Parameters
state: string
Returns string
do
Parameters
state: string
Returns string
do
Instruct the machine to complete an action. Synonym for action.
The action to engage
Optional newData: mDT
The data change to insert during the action
-Returns boolean
dot_ preamble
Returns string
edges_ between
Parameters
from: string
to: string
Returns JssmTransition<string, mDT>[]
flow
Returns "up" | "right" | "down" | "left"
force_ transition
Returns boolean
dot_ preamble
Returns string
edges_ between
Parameters
from: string
to: string
Returns JssmTransition<string, mDT>[]
flow
Returns "up" | "right" | "down" | "left"
force_ transition
Instruct the machine to complete a forced transition (which will reject if called with a normal transition call.)
Optional newData: mDT
The data change to insert during the transition
-Returns boolean
fsl_ version
Returns string
get_ transition_ by_ state_ names
Parameters
from: string
to: string
Returns number
go
Returns boolean
fsl_ version
Returns string
get_ transition_ by_ state_ names
Parameters
from: string
to: string
Returns number
go
Instruct the machine to complete a transition. Synonym for transition.
The state to switch to
Optional newData: mDT
The data change to insert during the transition
-Returns boolean
graph_ layout
Returns string
has_ completes
Returns boolean
has_ state
Returns boolean
graph_ layout
Returns string
has_ completes
Returns boolean
has_ state
Check whether the machine knows a given state.
Parameters
whichState: string
The state to be checked for extance
-Returns boolean
has_ terminals
Returns boolean
has_ unenterables
Returns boolean
hook
Parameters
from: string
to: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ action
Parameters
from: string
to: string
action: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ after
Parameters
from: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ any_ action
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ any_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ entry
Parameters
to: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ exit
Parameters
from: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ forced_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ global_ action
Parameters
action: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ main_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ standard_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
instance_ name
Returns string
is_ complete
Returns boolean
is_ end_ state
Returns boolean
has_ terminals
Returns boolean
has_ unenterables
Returns boolean
hook
Parameters
from: string
to: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ action
Parameters
from: string
to: string
action: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ after
Parameters
from: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ any_ action
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ any_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ entry
Parameters
to: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ exit
Parameters
from: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ forced_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ global_ action
Parameters
action: string
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ main_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
hook_ standard_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
instance_ name
Returns string
is_ complete
Returns boolean
is_ end_ state
Check whether a given state is a valid start state (either because it was explicitly named as such, or because it was the first mentioned state.)
Parameters
whichState: string
The name of the state to check
-Returns boolean
is_ final
Returns boolean
is_ final
Check whether the current state is final (either has no exits or is marked
complete
.)Returns boolean
is_ start_ state
Returns boolean
is_ start_ state
Check whether a given state is a valid start state (either because it was explicitly named as such, or because it was the first mentioned state.)
Parameters
whichState: string
The name of the state to check
-Returns boolean
is_ terminal
Returns boolean
is_ unenterable
Parameters
whichState: string
Returns boolean
known_ prop
Returns boolean
is_ terminal
Returns boolean
is_ unenterable
Parameters
whichState: string
Returns boolean
known_ prop
Check whether a given string is a known property's name.
Parameters
prop_name: string
The relevant property name to look up
-Returns boolean
known_ props
Returns boolean
known_ props
List all known property names. If you'd also like values, use props instead. The order of the properties is not defined, and the properties generally will not be sorted.
Returns string[]
label_ for
Returns string[]
label_ for
Get the label for a given state, if any; return
undefined
otherwise.See also display_text.
-Parameters
state: string
Returns string
list_ actions
Returns string[]
list_ edges
Parameters
state: string
Returns string
list_ actions
Returns string[]
list_ edges
Lists all edges of a machine.
Returns JssmTransition<string, mDT>[]
list_ entrances
Returns JssmTransition<string, mDT>[]
list_ entrances
List all entrances attached to the current state. Please note that the order of the list is not defined. This list includes both unforced and forced entrances; if this isn't desired, consider @@ -196,7 +196,7 @@
Parameters
whichState: string = ...
The state whose entrances to have listed
-Returns string[]
list_ exit_ actions
Parameters
whichState: string = ...
Returns string[]
list_ exits
Returns string[]
list_ exit_ actions
Parameters
whichState: string = ...
Returns string[]
list_ exits
List all exits attached to the current state. Please note that the order of the list is not defined. This list includes both unforced and forced exits; if this isn't desired, consider {@link list_unforced_exits} or @@ -205,14 +205,14 @@
Parameters
whichState: string = ...
The state whose exits to have listed
-Returns string[]
list_ named_ transitions
Returns Map<string, number>
list_ states_ having_ action
Returns string[]
list_ named_ transitions
Returns Map<string, number>
list_ states_ having_ action
List all states that have a specific action attached. Please note that the order of the states is not guaranteed.
Parameters
whichState: string
The action to be checked for associated states
-Returns string[]
list_ transitions
Returns string[]
list_ transitions
List all transitions attached to the current state, sorted by entrance and exit. The order of each sublist is not defined. A node could appear in both lists.
@@ -220,11 +220,11 @@Parameters
whichState: string = ...
The state whose transitions to have listed
-Returns JssmTransitionList
lookup_ transition_ for
Parameters
from: string
to: string
Returns JssmTransition<string, mDT>
machine_ author
Returns string[]
machine_ comment
Returns string
machine_ contributor
Returns string[]
machine_ definition
Returns string
machine_ language
Returns string
machine_ license
Returns string
machine_ name
Returns string
machine_ state
Returns JssmMachineInternalState<mDT>
machine_ version
Returns string
override
Returns JssmTransitionList
lookup_ transition_ for
Parameters
from: string
to: string
Returns JssmTransition<string, mDT>
machine_ author
Returns string[]
machine_ comment
Returns string
machine_ contributor
Returns string[]
machine_ definition
Returns string
machine_ language
Returns string
machine_ license
Returns string
machine_ name
Returns string
machine_ state
Returns JssmMachineInternalState<mDT>
machine_ version
Returns string
override
Replace the current state and data with no regard to the graph.
Parameters
newState: string
Optional newData: mDT
Returns void
post_ hook
Parameters
from: string
to: string
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ action
Parameters
from: string
to: string
action: string
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ any_ action
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ any_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ entry
Parameters
to: string
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ exit
Parameters
from: string
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ forced_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ global_ action
Parameters
action: string
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ main_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ standard_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
probabilistic_ histo_ walk
Parameters
n: number
Returns Map<string, number>
probabilistic_ transition
Returns boolean
probabilistic_ walk
Parameters
n: number
Returns string[]
probable_ action_ exits
Parameters
whichState: string = ...
Returns any[]
probable_ exits_ for
Parameters
whichState: string
Returns JssmTransition<string, mDT>[]
prop
Parameters
newState: string
Optional newData: mDT
Returns void
post_ hook
Parameters
from: string
to: string
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ action
Parameters
from: string
to: string
action: string
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ any_ action
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ any_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ entry
Parameters
to: string
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ exit
Parameters
from: string
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ forced_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ global_ action
Parameters
action: string
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ main_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
post_ hook_ standard_ transition
Parameters
handler: HookHandler<mDT>
Returns Machine<mDT>
probabilistic_ histo_ walk
Parameters
n: number
Returns Map<string, number>
probabilistic_ transition
Returns boolean
probabilistic_ walk
Parameters
n: number
Returns string[]
probable_ action_ exits
Parameters
whichState: string = ...
Returns any[]
probable_ exits_ for
Parameters
whichState: string
Returns JssmTransition<string, mDT>[]
prop
Get the current value of a given property name.
The relevant property name to look up
Returns any
The value behind the prop name. Because functional props are evaluated as getters, this can be anything.
-props
props
Get the current value of every prop, as an object. If no current definition exists for a prop - that is, if the prop was defined without a default and the current state also doesn't define the prop - then that prop will be listed in the returned object with a value of
undefined
.Returns object
raw_ state_ declarations
Returns <internal>.Object[]
serialize
Returns object
raw_ state_ declarations
Returns <internal>.Object[]
serialize
Serialize the current machine, including all defining state but not the machine string, to a structure. This means you will need the machine string to recreate (to not waste repeated space;) if you want the machine string embedded, call {@link serialize_with_string} instead.
-Parameters
Optional comment: string
Returns JssmSerialization<mDT>
set_ hook
Parameters
HookDesc: HookDescription<mDT>
Returns void
set_ state_ timeout
Parameters
next_state: string
after_time: number
Returns void
sm
Parameters
template_strings: TemplateStringsArray
Rest ...remainder: any[]
Returns Machine<mDT>
state
Parameters
Optional comment: string
Returns JssmSerialization<mDT>
set_ hook
Parameters
HookDesc: HookDescription<mDT>
Returns void
set_ state_ timeout
Parameters
next_state: string
after_time: number
Returns void
sm
Parameters
template_strings: TemplateStringsArray
Rest ...remainder: any[]
Returns Machine<mDT>
state
Get the current state of a machine.
Returns string
state_ declaration
Parameters
which: string
Returns JssmStateDeclaration
state_ declarations
Returns Map<string, JssmStateDeclaration>
state_ for
Parameters
whichState: string
Returns JssmGenericState
state_ is_ complete
Parameters
whichState: string
Returns boolean
state_ is_ final
Returns string
state_ declaration
Parameters
which: string
Returns JssmStateDeclaration
state_ declarations
Returns Map<string, JssmStateDeclaration>
state_ for
Parameters
whichState: string
Returns JssmGenericState
state_ is_ complete
Parameters
whichState: string
Returns boolean
state_ is_ final
Check whether a given state is final (either has no exits or is marked
complete
.)Parameters
whichState: string
The name of the state to check for finality
-Returns boolean
state_ is_ terminal
Parameters
whichState: string
Returns boolean
state_ timeout_ for
Parameters
which_state: string
Returns [string, number]
states
Returns boolean
state_ is_ terminal
Parameters
whichState: string
Returns boolean
state_ timeout_ for
Parameters
which_state: string
Returns [string, number]
states
List all the states known by the machine. Please note that the order of these states is not guaranteed.
Returns string[]
strict_ prop
Returns string[]
strict_ prop
Get the current value of a given property name. If missing on the state and without a global default, throw, unlike prop, which would return
@@ -270,7 +270,7 @@undefined
instead.The relevant property name to look up
Returns any
The value behind the prop name. Because functional props are evaluated as getters, this can be anything.
-style_ for
style_ for
Gets the composite style for a specific node by individually imposing the style layers on a given object, after determining which layers are appropriate.
@@ -281,7 +281,7 @@ terminal styles; then the start styles; then the end styles; finally, the active styles. Remember, last wins.The base state style must exist. All other styles are optional.
-Parameters
state: string
Returns Partial<JssmStateDeclaration>
transition
Parameters
state: string
Returns Partial<JssmStateDeclaration>
transition
Instruct the machine to complete a transition. Synonym for go.
The state to switch to
Optional newData: mDT
The data change to insert during the transition
-Returns boolean
transition_ impl
Parameters
newStateOrAction: string
newData: mDT
wasForced: boolean
wasAction: boolean
Returns boolean
valid_ action
Parameters
action: string
Optional _newData: mDT
Returns boolean
valid_ force_ transition
Parameters
newState: string
Optional _newData: mDT
Returns boolean
valid_ transition
Parameters
newState: string
Optional _newData: mDT
Returns boolean
Generated using TypeDoc
Returns boolean
transition_ impl
Parameters
newStateOrAction: string
newData: mDT
wasForced: boolean
wasAction: boolean
Returns boolean
valid_ action
Parameters
action: string
Optional _newData: mDT
Returns boolean
valid_ force_ transition
Parameters
newState: string
Optional _newData: mDT
Returns boolean
valid_ transition
Parameters
newState: string
Optional _newData: mDT
Returns boolean