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()
- 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 @@ -48,7 +48,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 @@ -62,7 +62,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.
@@ -101,11 +101,11 @@The FSL code to be evaluated
Things to control about the instance
- 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); // []
-Create a state machine from a template string. This is one of the two main paths for working with JSSM, alongside {@link from}.
Use this method when you want to work directly and conveniently with a @@ -119,7 +119,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/pages/CHANGELOG.long.html b/docs/docs/pages/CHANGELOG.long.html index 8c87e845..be89b649 100644 --- a/docs/docs/pages/CHANGELOG.long.html +++ b/docs/docs/pages/CHANGELOG.long.html @@ -3,11 +3,100 @@All notable changes to this project will be documented in this file.
-896 merges; 78 releases
+903 merges; 81 releases
Published tags:
-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.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 c48f55d02b6b52c57bf494549423df60f45bb393
+Author: John Haugeland <stonecypher@gmail.com>
Merges [e7a09e7, 575db4a]
++
+ + +
Commit 575db4a067c163829f33790538858b43c469ea55
+Author: John Haugeland <stonecypher@gmail.com>
+
+ + + + +
Commit e7a09e7cffc7782781843a106789acbeb6ceba12
+Author: John Haugeland <stonecypher@gmail.com>
Merges [5246c9e, 9bb5cd8]
++
+ + +
Commit 9bb5cd89eccc48f267a5997559998b55fe21ded9
+Author: John Haugeland <stonecypher@gmail.com>
+
+ + + + +
Commit 5246c9eae2d41efaa49196c24d5a89647c2eae0d
+Author: John Haugeland <stonecypher@gmail.com>
Merges [fd7acd5, 512332c]
++
+ + +
Commit 512332c813e25ff2c4f5fe21181a0a62743002b2
+Author: John Haugeland <stonecypher@gmail.com>
+
+ + +
Commit a0db9ad15ab9391fd75425d9541b767049964f43
+Author: John Haugeland <stonecypher@gmail.com>
diff --git a/package.json b/package.json index e124be7e..c98e01af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jssm", - "version": "5.69.5", + "version": "5.70.3", "engines": { "node": ">=10.0.0" }, diff --git a/src/doc_md/CHANGELOG.long.md b/src/doc_md/CHANGELOG.long.md index 2105ab1f..dbf3fd7b 100644 --- a/src/doc_md/CHANGELOG.long.md +++ b/src/doc_md/CHANGELOG.long.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -896 merges; 78 releases +903 merges; 81 releases @@ -12,12 +12,132 @@ All notable changes to this project will be documented in this file. Published tags: -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.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.70.2] - 6/8/2022 8:43:12 PM + +Commit [c48f55d02b6b52c57bf494549423df60f45bb393](https://github.com/StoneCypher/jssm/commit/c48f55d02b6b52c57bf494549423df60f45bb393) + +Author: `John Haugeland
- 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
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
state_config: JssmGenericState
Returns string
action
Instruct the machine to complete an action.
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[]
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
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
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
graph_ layout
Returns string
has_ completes
Returns boolean
has_ state
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
The state to be checked for extance
-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
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 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
Returns JssmTransition<mDT>[]
list_ entrances
List all entrances attached to the current state. Please note that the order of the list is not defined.
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.
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.
@@ -68,23 +68,23 @@Parameters
whichState: string = ...
The state whose transitions to have listed
-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
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
The name of the state to check for finality
-Returns boolean
state_ is_ terminal
Parameters
whichState: string
Returns boolean
states
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
Returns string[]
theme
Returns FslTheme
transition
Instruct the machine to complete a transition.
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