Properties _actions _actions: Map < string , Map < string , number > >
_any_ action_ hook _any_ action_ hook: Function
_any_ transition_ hook _any_ transition_ hook: Function
_arrange_ declaration _arrange_ declaration: string [] []
_arrange_ end_ declaration _arrange_ end_ declaration: string [] []
_arrange_ start_ declaration _arrange_ start_ declaration: string [] []
_dot_ preamble _dot_ preamble: string
_edge_ map _edge_ map: Map < string , Map < string , number > >
_edges _edges: JssmTransition < mDT > []
_entry_ hooks _entry_ hooks: Map < string , Function >
_exit_ hooks _exit_ hooks: Map < string , Function >
_forced_ transition_ hook _forced_ transition_ hook: Function
Optional _fsl_ version_fsl_ version?: string
_global_ action_ hooks _global_ action_ hooks: Map < string , Function >
_graph_ layout _graph_ layout: JssmLayout
_has_ basic_ hooks _has_ basic_ hooks: boolean
_has_ entry_ hooks _has_ entry_ hooks: boolean
_has_ exit_ hooks _has_ exit_ hooks: boolean
_has_ global_ action_ hooks _has_ global_ action_ hooks: boolean
_has_ hooks _has_ hooks: boolean
_has_ named_ hooks _has_ named_ hooks: boolean
_has_ transition_ hooks _has_ transition_ hooks: boolean
_hooks _hooks: Map < string , Function >
_instance_ name _instance_ name: string
Optional _machine_ author_machine_ author?: string []
Optional _machine_ comment_machine_ comment?: string
Optional _machine_ contributor_machine_ contributor?: string []
Optional _machine_ definition_machine_ definition?: string
Optional _machine_ language_machine_ language?: string
Optional _machine_ license_machine_ license?: string
Optional _machine_ name_machine_ name?: string
Optional _machine_ version_machine_ version?: string
_main_ transition_ hook _main_ transition_ hook: Function
_named_ hooks _named_ hooks: Map < string , Function >
_named_ transitions _named_ transitions: Map < string , number >
Optional _raw_ state_ declaration_raw_ state_ declaration?: Object []
_reverse_ action_ targets _reverse_ action_ targets: Map < string , Map < string , number > >
_reverse_ actions _reverse_ actions: Map < string , Map < string , number > >
_standard_ transition_ hook _standard_ transition_ hook: Function
_state_ declarations _state_ declarations: Map < string , JssmStateDeclaration >
_states _states: Map < string , JssmGenericState >
- Preparing search index...
- The search index is not available
jssmClass Machine<mDT>
Type parameters
mDT
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Type parameters
mDT
Parameters
__namedParameters: JssmGenericConfig<mDT>
Returns Machine<mDT>
Properties
_actions
_any_ action_ hook
_any_ transition_ hook
_arrange_ declaration
_arrange_ end_ declaration
_arrange_ start_ declaration
_dot_ preamble
_edge_ map
_edges
_entry_ hooks
_exit_ hooks
_flow
_forced_ transition_ hook
Optional _fsl_ version
_global_ action_ hooks
_graph_ layout
_has_ basic_ hooks
_has_ entry_ hooks
_has_ exit_ hooks
_has_ global_ action_ hooks
_has_ hooks
_has_ named_ hooks
_has_ transition_ hooks
_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
Optional _raw_ state_ declaration
_reverse_ action_ targets
_reverse_ actions
_standard_ transition_ hook
_state
_state_ declarations
_states
_theme
Methods
_new_ state
Internal method for fabricating states. Not meant for external use.
-Parameters
state_config: JssmGenericState
Returns string
action
Parameters
actionName: string
Optional newData: mDT
Returns boolean
actions
Parameters
state_config: JssmGenericState
Returns string
action
Parameters
actionName: string
Optional newData: mDT
Returns boolean
actions
List all actions available from this state. Please note that the order of the actions is not guaranteed.
Parameters
whichState: string = ...
Returns string[]
current_ action_ edge_ for
Parameters
action: string
Returns JssmTransition<mDT>
current_ action_ for
Parameters
action: string
Returns number
dot_ preamble
Returns string
edges_ between
Parameters
from: string
to: string
Returns JssmTransition<mDT>[]
flow
Returns FslDirection
force_ transition
Parameters
newState: string
Optional newData: mDT
Returns boolean
fsl_ version
Returns string
get_ transition_ by_ state_ names
Parameters
from: string
to: string
Returns number
graph_ layout
Returns string
has_ completes
Returns boolean
has_ state
Parameters
whichState: string = ...
Returns string[]
current_ action_ edge_ for
Parameters
action: string
Returns JssmTransition<mDT>
current_ action_ for
Parameters
action: string
Returns number
dot_ preamble
Returns string
edges_ between
Parameters
from: string
to: string
Returns JssmTransition<mDT>[]
flow
Returns FslDirection
force_ transition
Parameters
newState: string
Optional newData: mDT
Returns boolean
fsl_ version
Returns string
get_ transition_ by_ state_ names
Parameters
from: string
to: string
Returns number
graph_ layout
Returns string
has_ completes
Returns boolean
has_ state
Check whether the machine knows a given state.
Parameters
whichState: string
Returns boolean
has_ terminals
Returns boolean
has_ unenterables
Returns boolean
hook
Parameters
from: string
to: string
handler: Function
Returns Machine<mDT>
hook_ action
Parameters
from: string
to: string
action: string
handler: Function
Returns Machine<mDT>
hook_ any_ action
Parameters
handler: Function
Returns Machine<mDT>
hook_ any_ transition
Parameters
handler: Function
Returns Machine<mDT>
hook_ entry
Parameters
to: string
handler: Function
Returns Machine<mDT>
hook_ exit
Parameters
from: string
handler: Function
Returns Machine<mDT>
hook_ forced_ transition
Parameters
handler: Function
Returns Machine<mDT>
hook_ global_ action
Parameters
action: string
handler: Function
Returns Machine<mDT>
hook_ main_ transition
Parameters
handler: Function
Returns Machine<mDT>
hook_ standard_ transition
Parameters
handler: Function
Returns Machine<mDT>
instance_ name
Returns string
is_ complete
Returns boolean
is_ final
Parameters
whichState: string
Returns boolean
has_ terminals
Returns boolean
has_ unenterables
Returns boolean
hook
Parameters
from: string
to: string
handler: Function
Returns Machine<mDT>
hook_ action
Parameters
from: string
to: string
action: string
handler: Function
Returns Machine<mDT>
hook_ any_ action
Parameters
handler: Function
Returns Machine<mDT>
hook_ any_ transition
Parameters
handler: Function
Returns Machine<mDT>
hook_ entry
Parameters
to: string
handler: Function
Returns Machine<mDT>
hook_ exit
Parameters
from: string
handler: Function
Returns Machine<mDT>
hook_ forced_ transition
Parameters
handler: Function
Returns Machine<mDT>
hook_ global_ action
Parameters
action: string
handler: Function
Returns Machine<mDT>
hook_ main_ transition
Parameters
handler: Function
Returns Machine<mDT>
hook_ standard_ transition
Parameters
handler: Function
Returns Machine<mDT>
instance_ name
Returns string
is_ complete
Returns boolean
is_ final
Check whether the current state is final (either has no exits or is marked
complete
.)Returns boolean
is_ terminal
Returns boolean
is_ unenterable
Parameters
whichState: string
Returns boolean
list_ actions
Returns string[]
list_ edges
Returns JssmTransition<mDT>[]
list_ entrances
Parameters
whichState: string = ...
Returns string[]
list_ exit_ actions
Parameters
whichState: string = ...
Returns string[]
list_ exits
Parameters
whichState: string = ...
Returns string[]
list_ named_ transitions
Returns Map<string, number>
list_ states_ having_ action
Returns boolean
is_ terminal
Returns boolean
is_ unenterable
Parameters
whichState: string
Returns boolean
list_ actions
Returns string[]
list_ edges
Lists all edges of a machine.
+Returns JssmTransition<mDT>[]
list_ entrances
List all entrances attached to the current state. Please note that the + order of the list is not defined.
+const lswitch = sm
+on 'toggle' <=> 'toggle' off;
; + const light = smred 'next' -> green 'next' -> yellow 'next' -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;
;light.state(); // 'red' + light.list_entrances(); // [ 'yellow', 'off' ]
+Parameters
whichState: string = ...
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.
+const lswitch = sm
+on 'toggle' <=> 'toggle' off;
; + const light = smred 'next' -> green 'next' -> yellow 'next' -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;
;light.state(); // 'red' + light.list_exits(); // [ 'green', 'off' ]
+Parameters
whichState: string = ...
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
Returns string[]
list_ transitions
Parameters
whichState: string = ...
Returns JssmTransitionList
lookup_ transition_ for
Parameters
from: string
to: string
Returns JssmTransition<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
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<mDT>[]
raw_ state_ declarations
Returns Object[]
set_ hook
Parameters
HookDesc: HookDescription
Returns void
sm
Parameters
template_strings: TemplateStringsArray
Rest ...remainder: any[]
Returns Machine<mDT>
state
Parameters
whichState: string
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.
+const lswitch = sm
+on 'toggle' <=> 'toggle' off;
; + const light = smred 'next' -> green 'next' -> yellow 'next' -> red; [red yellow green] 'shutdown' ~> off 'start' -> red;
;light.state(); // 'red' + light.list_transitions(); // { entrances: [ 'yellow', 'off' ], exits: [ 'green', 'off' ] }
+Parameters
whichState: string = ...
Returns JssmTransitionList
lookup_ transition_ for
Parameters
from: string
to: string
Returns JssmTransition<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
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<mDT>[]
raw_ state_ declarations
Returns Object[]
set_ hook
Parameters
HookDesc: HookDescription
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
Returns boolean
state_ is_ terminal
Parameters
whichState: string
Returns boolean
states
Parameters
whichState: string
Returns boolean
state_ is_ terminal
Parameters
whichState: string
Returns boolean
states
List all the states known by the machine. Please note that the order of these states is not guaranteed.
Returns string[]
theme
Returns FslTheme
transition
Parameters
newState: string
Optional newData: mDT
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