-
Notifications
You must be signed in to change notification settings - Fork 21
/
jssm.html
117 lines (115 loc) · 78.7 KB
/
jssm.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>jssm | JSSM, a JavaScript state machine - the FSM for FSL</title><meta name="description" content="Documentation for JSSM, a JavaScript state machine - the FSM for FSL"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><link rel="stylesheet" href="../assets/custom.css"/><script async src="../assets/search.js" id="search-script"></script><link rel="stylesheet" href="../assets/pages.css"/></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">JSSM, a JavaScript state machine - the FSM for FSL</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">JSSM, a JavaScript state machine - the FSM for FSL</a></li><li><a href="jssm.html">jssm</a></li></ul><h1>Module jssm </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>References</h3><ul class="tsd-index-list"><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#FslDirections" class="tsd-kind-icon">Fsl<wbr/>Directions</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#build_time" class="tsd-kind-icon">build_<wbr/>time</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#constants" class="tsd-kind-icon">constants</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#find_repeated" class="tsd-kind-icon">find_<wbr/>repeated</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#histograph" class="tsd-kind-icon">histograph</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#seq" class="tsd-kind-icon">seq</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#unique" class="tsd-kind-icon">unique</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#version" class="tsd-kind-icon">version</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#weighted_histo_key" class="tsd-kind-icon">weighted_<wbr/>histo_<wbr/>key</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#weighted_rand_select" class="tsd-kind-icon">weighted_<wbr/>rand_<wbr/>select</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#weighted_sample_select" class="tsd-kind-icon">weighted_<wbr/>sample_<wbr/>select</a></li></ul></section><section class="tsd-index-section "><h3>Namespaces</h3><ul class="tsd-index-list"><li class="tsd-kind-namespace tsd-parent-kind-module"><a href="jssm._internal_.html" class="tsd-kind-icon"><internal></a></li></ul></section><section class="tsd-index-section "><h3>Classes</h3><ul class="tsd-index-list"><li class="tsd-kind-class tsd-parent-kind-module tsd-has-type-parameter"><a href="../classes/jssm.Machine.html" class="tsd-kind-icon">Machine</a></li></ul></section><section class="tsd-index-section "><h3>Variables</h3><ul class="tsd-index-list"><li class="tsd-kind-variable tsd-parent-kind-module"><a href="jssm.html#gviz_shapes" class="tsd-kind-icon">gviz_<wbr/>shapes</a></li><li class="tsd-kind-variable tsd-parent-kind-module"><a href="jssm.html#named_colors" class="tsd-kind-icon">named_<wbr/>colors</a></li><li class="tsd-kind-variable tsd-parent-kind-module"><a href="jssm.html#shapes" class="tsd-kind-icon">shapes</a></li></ul></section><section class="tsd-index-section "><h3>Functions</h3><ul class="tsd-index-list"><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#abstract_hook_step" class="tsd-kind-icon">abstract_<wbr/>hook_<wbr/>step</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#arrow_direction" class="tsd-kind-icon">arrow_<wbr/>direction</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#arrow_left_kind" class="tsd-kind-icon">arrow_<wbr/>left_<wbr/>kind</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#arrow_right_kind" class="tsd-kind-icon">arrow_<wbr/>right_<wbr/>kind</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#compile" class="tsd-kind-icon">compile</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#deserialize" class="tsd-kind-icon">deserialize</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#from" class="tsd-kind-icon">from</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#is_hook_complex_result" class="tsd-kind-icon">is_<wbr/>hook_<wbr/>complex_<wbr/>result</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#is_hook_rejection" class="tsd-kind-icon">is_<wbr/>hook_<wbr/>rejection</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#make" class="tsd-kind-icon">make</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#parse" class="tsd-kind-icon">parse</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#sm" class="tsd-kind-icon">sm</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#state_style_condense" class="tsd-kind-icon">state_<wbr/>style_<wbr/>condense</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#transfer_state_properties" class="tsd-kind-icon">transfer_<wbr/>state_<wbr/>properties</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>References</h2><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="FslDirections" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Fsl<wbr/>Directions<a href="#FslDirections" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Re-exports <a href="jssm_types.html#FslDirections">FslDirections</a></section><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="build_time" class="tsd-anchor"></a><h3 class="tsd-anchor-link">build_<wbr/>time<a href="#build_time" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Re-exports <a href="version.html#build_time">build_time</a></section><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="constants" class="tsd-anchor"></a><h3 class="tsd-anchor-link">constants<a href="#constants" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Renames and re-exports <a href="jssm_constants.html">jssm_constants</a></section><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="find_repeated" class="tsd-anchor"></a><h3 class="tsd-anchor-link">find_<wbr/>repeated<a href="#find_repeated" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Re-exports <a href="jssm_util.html#find_repeated">find_repeated</a></section><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="histograph" class="tsd-anchor"></a><h3 class="tsd-anchor-link">histograph<a href="#histograph" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Re-exports <a href="jssm_util.html#histograph">histograph</a></section><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="seq" class="tsd-anchor"></a><h3 class="tsd-anchor-link">seq<a href="#seq" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Re-exports <a href="jssm_util.html#seq">seq</a></section><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="unique" class="tsd-anchor"></a><h3 class="tsd-anchor-link">unique<a href="#unique" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Re-exports <a href="jssm_util.html#unique">unique</a></section><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="version" class="tsd-anchor"></a><h3 class="tsd-anchor-link">version<a href="#version" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Re-exports <a href="version.html#version-1">version</a></section><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="weighted_histo_key" class="tsd-anchor"></a><h3 class="tsd-anchor-link">weighted_<wbr/>histo_<wbr/>key<a href="#weighted_histo_key" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Re-exports <a href="jssm_util.html#weighted_histo_key">weighted_histo_key</a></section><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="weighted_rand_select" class="tsd-anchor"></a><h3 class="tsd-anchor-link">weighted_<wbr/>rand_<wbr/>select<a href="#weighted_rand_select" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Re-exports <a href="jssm_util.html#weighted_rand_select">weighted_rand_select</a></section><section class="tsd-panel tsd-member tsd-kind-reference tsd-parent-kind-module"><a id="weighted_sample_select" class="tsd-anchor"></a><h3 class="tsd-anchor-link">weighted_<wbr/>sample_<wbr/>select<a href="#weighted_sample_select" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3>Re-exports <a href="jssm_util.html#weighted_sample_select">weighted_sample_select</a></section></section><section class="tsd-panel-group tsd-member-group "><h2>Variables</h2><section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-module"><a id="gviz_shapes" class="tsd-anchor"></a><h3 class="tsd-anchor-link">gviz_<wbr/>shapes<a href="#gviz_shapes" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">gviz_<wbr/>shapes<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div></section><section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-module"><a id="named_colors" class="tsd-anchor"></a><h3 class="tsd-anchor-link">named_<wbr/>colors<a href="#named_colors" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">named_<wbr/>colors<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div></section><section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-module"><a id="shapes" class="tsd-anchor"></a><h3 class="tsd-anchor-link">shapes<a href="#shapes" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">shapes<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Functions</h2><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a id="abstract_hook_step" class="tsd-anchor"></a><h3 class="tsd-anchor-link">abstract_<wbr/>hook_<wbr/>step<a href="#abstract_hook_step" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">abstract_<wbr/>hook_<wbr/>step<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>maybe_hook<span class="tsd-signature-symbol">: </span><a href="jssm_types.html#HookHandler" class="tsd-signature-type" data-tsd-kind="Type alias">HookHandler</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span>, hook_args<span class="tsd-signature-symbol">: </span><a href="jssm_types.html#HookContext" class="tsd-signature-type" data-tsd-kind="Type alias">HookContext</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="jssm_types.html#HookComplexResult" class="tsd-signature-type" data-tsd-kind="Type alias">HookComplexResult</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm.ts#L3216">src/ts/jssm.ts:3216</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type Parameters</h4><ul class="tsd-type-parameters"><li><h4>mDT</h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>maybe_hook: <a href="jssm_types.html#HookHandler" class="tsd-signature-type" data-tsd-kind="Type alias">HookHandler</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h5></li><li><h5>hook_args: <a href="jssm_types.html#HookContext" class="tsd-signature-type" data-tsd-kind="Type alias">HookContext</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="jssm_types.html#HookComplexResult" class="tsd-signature-type" data-tsd-kind="Type alias">HookComplexResult</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="arrow_direction" class="tsd-anchor"></a><h3 class="tsd-anchor-link">arrow_<wbr/>direction<a href="#arrow_direction" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">arrow_<wbr/>direction<span class="tsd-signature-symbol">(</span>arrow<span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmArrow" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrow</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmArrowDirection" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrowDirection</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm_arrow.ts#L26">src/ts/jssm_arrow.ts:26</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> Return the direction of an arrow - <code>right</code>, <code>left</code>, or <code>both</code>.</p>
</div><div><pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">arrow_direction</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-6">arrow_direction</span><span class="hl-1">(</span><span class="hl-3">'->'</span><span class="hl-1">); </span><span class="hl-7">// 'right'</span><br/><span class="hl-6">arrow_direction</span><span class="hl-1">(</span><span class="hl-3">'<~=>'</span><span class="hl-1">); </span><span class="hl-7">// 'both'</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>arrow: <a href="jssm_types.html#JssmArrow" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrow</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The arrow to be evaluated</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="jssm_types.html#JssmArrowDirection" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrowDirection</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="arrow_left_kind" class="tsd-anchor"></a><h3 class="tsd-anchor-link">arrow_<wbr/>left_<wbr/>kind<a href="#arrow_left_kind" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">arrow_<wbr/>left_<wbr/>kind<span class="tsd-signature-symbol">(</span>arrow<span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmArrow" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrow</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmArrowKind" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrowKind</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm_arrow.ts#L86">src/ts/jssm_arrow.ts:86</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> Return the direction of an arrow - <code>right</code>, <code>left</code>, or <code>both</code>.</p>
</div><div><pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">arrow_left_kind</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-6">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<-'</span><span class="hl-1">); </span><span class="hl-7">// 'legal'</span><br/><span class="hl-6">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<='</span><span class="hl-1">); </span><span class="hl-7">// 'main'</span><br/><span class="hl-6">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<~'</span><span class="hl-1">); </span><span class="hl-7">// 'forced'</span><br/><span class="hl-6">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<->'</span><span class="hl-1">); </span><span class="hl-7">// 'legal'</span><br/><span class="hl-6">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'->'</span><span class="hl-1">); </span><span class="hl-7">// 'none'</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>arrow: <a href="jssm_types.html#JssmArrow" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrow</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The arrow to be evaluated</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="jssm_types.html#JssmArrowKind" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrowKind</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="arrow_right_kind" class="tsd-anchor"></a><h3 class="tsd-anchor-link">arrow_<wbr/>right_<wbr/>kind<a href="#arrow_right_kind" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">arrow_<wbr/>right_<wbr/>kind<span class="tsd-signature-symbol">(</span>arrow<span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmArrow" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrow</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmArrowKind" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrowKind</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm_arrow.ts#L146">src/ts/jssm_arrow.ts:146</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> Return the direction of an arrow - <code>right</code>, <code>left</code>, or <code>both</code>.</p>
</div><div><pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">arrow_left_kind</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-6">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'->'</span><span class="hl-1">); </span><span class="hl-7">// 'legal'</span><br/><span class="hl-6">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'=>'</span><span class="hl-1">); </span><span class="hl-7">// 'main'</span><br/><span class="hl-6">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'~>'</span><span class="hl-1">); </span><span class="hl-7">// 'forced'</span><br/><span class="hl-6">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<->'</span><span class="hl-1">); </span><span class="hl-7">// 'legal'</span><br/><span class="hl-6">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<-'</span><span class="hl-1">); </span><span class="hl-7">// 'none'</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>arrow: <a href="jssm_types.html#JssmArrow" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrow</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The arrow to be evaluated</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="jssm_types.html#JssmArrowKind" class="tsd-signature-type" data-tsd-kind="Type alias">JssmArrowKind</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a id="compile" class="tsd-anchor"></a><h3 class="tsd-anchor-link">compile<a href="#compile" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">compile<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">StateType</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>tree<span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmParseTree" class="tsd-signature-type" data-tsd-kind="Type alias">JssmParseTree</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">StateType</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmGenericConfig" class="tsd-signature-type" data-tsd-kind="Type alias">JssmGenericConfig</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">StateType</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm_compiler.ts#L354">src/ts/jssm_compiler.ts:354</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> Compile a machine's JSON intermediate representation to a config object. If
you're using this (probably don't,) you're probably also using
<a href="jssm.html#parse">parse</a> to get the IR, and the object constructor
{@link Machine.construct} to turn the config object into a workable machine.</p>
</div><div><pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">parse</span><span class="hl-1">, </span><span class="hl-2">compile</span><span class="hl-1">, </span><span class="hl-2">Machine</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">intermediate</span><span class="hl-1"> = </span><span class="hl-6">parse</span><span class="hl-1">(</span><span class="hl-3">'a -> b;'</span><span class="hl-1">);</span><br/><span class="hl-7">// [ {key:'transition', from:'a', se:{kind:'->',to:'b'}} ]</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">cfg</span><span class="hl-1"> = </span><span class="hl-6">compile</span><span class="hl-1">(</span><span class="hl-2">intermediate</span><span class="hl-1">);</span><br/><span class="hl-7">// { start_states:['a'], transitions: [{ from:'a', to:'b', kind:'legal', forced_only:false, main_path:false }] }</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">machine</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-6">Machine</span><span class="hl-1">(</span><span class="hl-2">cfg</span><span class="hl-1">);</span><br/><span class="hl-7">// Machine { _instance_name: undefined, _state: 'a', ...</span>
</code></pre>
<p> This method is mostly for plugin and intermediate tool authors, or people
who need to work with the machine's intermediate representation.</p>
<a href="#hey" id="hey" style="color: inherit; text-decoration: none;">
<h1>Hey!</h1>
</a>
<p> Most people looking at this want either the <code>sm</code> operator or method <code>from</code>,
which perform all the steps in the chain. The library's author mostly uses
operator <code>sm</code>, and mostly falls back to <code>.from</code> when needing to parse
strings dynamically instead of from template literals.</p>
<p> Operator <a href="jssm.html#sm">sm</a>:</p>
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">sm</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">lswitch</span><span class="hl-1"> = </span><span class="hl-6">sm</span><span class="hl-3">`on <=> off;`</span><span class="hl-1">;</span>
</code></pre>
<p> Method <a href="jssm.html#from">from</a>:</p>
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> </span><span class="hl-4">*</span><span class="hl-1"> </span><span class="hl-0">as</span><span class="hl-1"> </span><span class="hl-2">jssm</span><span class="hl-1"> </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">toggle</span><span class="hl-1"> = </span><span class="hl-2">jssm</span><span class="hl-1">.</span><span class="hl-6">from</span><span class="hl-1">(</span><span class="hl-3">'up <=> down;'</span><span class="hl-1">);</span>
</code></pre>
</div></div><h4 class="tsd-type-parameters-title">Type Parameters</h4><ul class="tsd-type-parameters"><li><h4>StateType</h4></li><li><h4>mDT</h4><div class="tsd-comment tsd-typography"><div class="lead">
<p>The type of the machine data member; usually omitted</p>
</div></div></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>tree: <a href="jssm_types.html#JssmParseTree" class="tsd-signature-type" data-tsd-kind="Type alias">JssmParseTree</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">StateType</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The parse tree to be boiled down into a machine config</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="jssm_types.html#JssmGenericConfig" class="tsd-signature-type" data-tsd-kind="Type alias">JssmGenericConfig</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">StateType</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a id="deserialize" class="tsd-anchor"></a><h3 class="tsd-anchor-link">deserialize<a href="#deserialize" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">deserialize<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>machine_string<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, ser<span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmSerialization" class="tsd-signature-type" data-tsd-kind="Type alias">JssmSerialization</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../classes/jssm.Machine.html" class="tsd-signature-type" data-tsd-kind="Class">Machine</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm.ts#L3250">src/ts/jssm.ts:3250</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type Parameters</h4><ul class="tsd-type-parameters"><li><h4>mDT</h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>machine_string: <span class="tsd-signature-type">string</span></h5></li><li><h5>ser: <a href="jssm_types.html#JssmSerialization" class="tsd-signature-type" data-tsd-kind="Type alias">JssmSerialization</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="../classes/jssm.Machine.html" class="tsd-signature-type" data-tsd-kind="Class">Machine</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a id="from" class="tsd-anchor"></a><h3 class="tsd-anchor-link">from<a href="#from" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">from<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>MachineAsString<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, ExtraConstructorFields<span class="tsd-signature-symbol">?: </span><a href="jssm._internal_.html#Partial" class="tsd-signature-type" data-tsd-kind="Type alias">Partial</a><span class="tsd-signature-symbol"><</span><a href="jssm_types.html#JssmGenericConfig" class="tsd-signature-type" data-tsd-kind="Type alias">JssmGenericConfig</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../classes/jssm.Machine.html" class="tsd-signature-type" data-tsd-kind="Class">Machine</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm.ts#L3160">src/ts/jssm.ts:3160</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> Create a state machine from an implementation string. This is one of the
two main paths for working with JSSM, alongside <a href="jssm.html#sm">sm</a>.</p>
</div><div><p> Use this method when you want to conveniently pull a state machine from a
string dynamically. Use operator <code>sm</code> when you just want to work with a
template expression.</p>
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> </span><span class="hl-4">*</span><span class="hl-1"> </span><span class="hl-0">as</span><span class="hl-1"> </span><span class="hl-2">jssm</span><span class="hl-1"> </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">lswitch</span><span class="hl-1"> = </span><span class="hl-2">jssm</span><span class="hl-1">.</span><span class="hl-6">from</span><span class="hl-1">(</span><span class="hl-3">'on <=> off;'</span><span class="hl-1">);</span>
</code></pre>
</div></div><h4 class="tsd-type-parameters-title">Type Parameters</h4><ul class="tsd-type-parameters"><li><h4>mDT</h4><div class="tsd-comment tsd-typography"><div class="lead">
<p>The type of the machine data member; usually omitted</p>
</div></div></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>MachineAsString: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The FSL code to evaluate</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> ExtraConstructorFields: <a href="jssm._internal_.html#Partial" class="tsd-signature-type" data-tsd-kind="Type alias">Partial</a><span class="tsd-signature-symbol"><</span><a href="jssm_types.html#JssmGenericConfig" class="tsd-signature-type" data-tsd-kind="Type alias">JssmGenericConfig</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Extra non-code configuration to pass at creation time</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="../classes/jssm.Machine.html" class="tsd-signature-type" data-tsd-kind="Class">Machine</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a id="is_hook_complex_result" class="tsd-anchor"></a><h3 class="tsd-anchor-link">is_<wbr/>hook_<wbr/>complex_<wbr/>result<a href="#is_hook_complex_result" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">is_<wbr/>hook_<wbr/>complex_<wbr/>result<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>hr<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">hr</span><span class="tsd-signature-symbol"> is </span><a href="jssm_types.html#HookComplexResult" class="tsd-signature-type" data-tsd-kind="Type alias">HookComplexResult</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm.ts#L3182">src/ts/jssm.ts:3182</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type Parameters</h4><ul class="tsd-type-parameters"><li><h4>mDT</h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>hr: <span class="tsd-signature-type">unknown</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">hr</span><span class="tsd-signature-symbol"> is </span><a href="jssm_types.html#HookComplexResult" class="tsd-signature-type" data-tsd-kind="Type alias">HookComplexResult</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a id="is_hook_rejection" class="tsd-anchor"></a><h3 class="tsd-anchor-link">is_<wbr/>hook_<wbr/>rejection<a href="#is_hook_rejection" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">is_<wbr/>hook_<wbr/>rejection<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>hr<span class="tsd-signature-symbol">: </span><a href="jssm_types.html#HookResult" class="tsd-signature-type" data-tsd-kind="Type alias">HookResult</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm.ts#L3198">src/ts/jssm.ts:3198</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type Parameters</h4><ul class="tsd-type-parameters"><li><h4>mDT</h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>hr: <a href="jssm_types.html#HookResult" class="tsd-signature-type" data-tsd-kind="Type alias">HookResult</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a id="make" class="tsd-anchor"></a><h3 class="tsd-anchor-link">make<a href="#make" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">make<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">StateType</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>plan<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmGenericConfig" class="tsd-signature-type" data-tsd-kind="Type alias">JssmGenericConfig</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">StateType</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm_compiler.ts#L517">src/ts/jssm_compiler.ts:517</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> An internal convenience wrapper for parsing then compiling a machine string.
Not generally meant for external use. Please see <a href="jssm.html#compile">compile</a> or
<a href="jssm.html#sm">sm</a>.</p>
</div></div><h4 class="tsd-type-parameters-title">Type Parameters</h4><ul class="tsd-type-parameters"><li><h4>StateType</h4></li><li><h4>mDT</h4><div class="tsd-comment tsd-typography"><div class="lead">
<p>The type of the machine data member; usually omitted</p>
</div></div></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>plan: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The FSL code to be evaluated and built into a machine config</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="jssm_types.html#JssmGenericConfig" class="tsd-signature-type" data-tsd-kind="Type alias">JssmGenericConfig</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">StateType</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="parse" class="tsd-anchor"></a><h3 class="tsd-anchor-link">parse<a href="#parse" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">parse<span class="tsd-signature-symbol">(</span>input<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, options<span class="tsd-signature-symbol">?: </span><a href="jssm._internal_.html" class="tsd-signature-type" data-tsd-kind="Namespace"><internal></a><span class="tsd-signature-symbol">.</span><a href="jssm._internal_.html#Object-1" class="tsd-signature-type" data-tsd-kind="Variable">Object</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm_compiler.ts#L160">src/ts/jssm_compiler.ts:160</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> This method wraps the parser call that comes from the peg grammar,
<a href="jssm.html#parse">parse</a>. Generally neither this nor that should be used directly
unless you mean to develop plugins or extensions for the machine.</p>
</div><div><p> Parses the intermediate representation of a compiled string down to a
machine configuration object. If you're using this (probably don't,) you're
probably also using <a href="jssm.html#compile">compile</a> and <a href="../classes/jssm.Machine.html#constructor">Machine.constructor</a>.</p>
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">parse</span><span class="hl-1">, </span><span class="hl-2">compile</span><span class="hl-1">, </span><span class="hl-2">Machine</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">intermediate</span><span class="hl-1"> = </span><span class="hl-6">wrap_parse</span><span class="hl-1">(</span><span class="hl-3">'a -> b;'</span><span class="hl-1">, {});</span><br/><span class="hl-7">// [ {key:'transition', from:'a', se:{kind:'->',to:'b'}} ]</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">cfg</span><span class="hl-1"> = </span><span class="hl-6">compile</span><span class="hl-1">(</span><span class="hl-2">intermediate</span><span class="hl-1">);</span><br/><span class="hl-7">// { start_states:['a'], transitions: [{ from:'a', to:'b', kind:'legal', forced_only:false, main_path:false }] }</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">machine</span><span class="hl-1"> = </span><span class="hl-4">new</span><span class="hl-1"> </span><span class="hl-6">Machine</span><span class="hl-1">(</span><span class="hl-2">cfg</span><span class="hl-1">);</span><br/><span class="hl-7">// Machine { _instance_name: undefined, _state: 'a', ...</span>
</code></pre>
<p> This method is mostly for plugin and intermediate tool authors, or people
who need to work with the machine's intermediate representation.</p>
<a href="#hey" id="hey" style="color: inherit; text-decoration: none;">
<h1>Hey!</h1>
</a>
<p> Most people looking at this want either the <code>sm</code> operator or method <code>from</code>,
which perform all the steps in the chain. The library's author mostly uses
operator <code>sm</code>, and mostly falls back to <code>.from</code> when needing to parse
strings dynamically instead of from template literals.</p>
<p> Operator <a href="jssm.html#sm">sm</a>:</p>
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">sm</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">lswitch</span><span class="hl-1"> = </span><span class="hl-6">sm</span><span class="hl-3">`on <=> off;`</span><span class="hl-1">;</span>
</code></pre>
<p> Method <a href="jssm.html#from">from</a>:</p>
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> </span><span class="hl-4">*</span><span class="hl-1"> </span><span class="hl-0">as</span><span class="hl-1"> </span><span class="hl-2">jssm</span><span class="hl-1"> </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">toggle</span><span class="hl-1"> = </span><span class="hl-2">jssm</span><span class="hl-1">.</span><span class="hl-6">from</span><span class="hl-1">(</span><span class="hl-3">'up <=> down;'</span><span class="hl-1">);</span>
</code></pre>
<p> <code>wrap_parse</code> itself is an internal convenience method for alting out an
object as the options call. Not generally meant for external use.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>input: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The FSL code to be evaluated</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="jssm._internal_.html" class="tsd-signature-type" data-tsd-kind="Namespace"><internal></a><span class="tsd-signature-symbol">.</span><a href="jssm._internal_.html#Object-1" class="tsd-signature-type" data-tsd-kind="Variable">Object</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Things to control about the instance</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a id="sm" class="tsd-anchor"></a><h3 class="tsd-anchor-link">sm<a href="#sm" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">sm<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>template_strings<span class="tsd-signature-symbol">: </span><a href="../interfaces/jssm._internal_.TemplateStringsArray.html" class="tsd-signature-type" data-tsd-kind="Interface">TemplateStringsArray</a>, <span class="tsd-signature-symbol">...</span>remainder<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../classes/jssm.Machine.html" class="tsd-signature-type" data-tsd-kind="Class">Machine</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm.ts#L3112">src/ts/jssm.ts:3112</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> Create a state machine from a template string. This is one of the two main
paths for working with JSSM, alongside <a href="jssm.html#from">from</a>.</p>
</div><div><p> Use this method when you want to work directly and conveniently with a
constant template expression. Use <code>.from</code> when you want to pull from
dynamic strings.</p>
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> </span><span class="hl-4">*</span><span class="hl-1"> </span><span class="hl-0">as</span><span class="hl-1"> </span><span class="hl-2">jssm</span><span class="hl-1"> </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">'jssm'</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">lswitch</span><span class="hl-1"> = </span><span class="hl-2">jssm</span><span class="hl-1">.</span><span class="hl-6">from</span><span class="hl-1">(</span><span class="hl-3">'on <=> off;'</span><span class="hl-1">);</span>
</code></pre>
</div></div><h4 class="tsd-type-parameters-title">Type Parameters</h4><ul class="tsd-type-parameters"><li><h4>mDT</h4><div class="tsd-comment tsd-typography"><div class="lead">
<p>The type of the machine data member; usually omitted</p>
</div></div></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>template_strings: <a href="../interfaces/jssm._internal_.TemplateStringsArray.html" class="tsd-signature-type" data-tsd-kind="Interface">TemplateStringsArray</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The assembled code</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagRest">Rest</span> <span class="tsd-signature-symbol">...</span>remainder: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The mechanic for template argument insertion</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="../classes/jssm.Machine.html" class="tsd-signature-type" data-tsd-kind="Class">Machine</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">mDT</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="state_style_condense" class="tsd-anchor"></a><h3 class="tsd-anchor-link">state_<wbr/>style_<wbr/>condense<a href="#state_style_condense" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">state_<wbr/>style_<wbr/>condense<span class="tsd-signature-symbol">(</span>jssk<span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmStateStyleKeyList" class="tsd-signature-type" data-tsd-kind="Type alias">JssmStateStyleKeyList</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmStateConfig" class="tsd-signature-type" data-tsd-kind="Type alias">JssmStateConfig</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm.ts#L115">src/ts/jssm.ts:115</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>jssk: <a href="jssm_types.html#JssmStateStyleKeyList" class="tsd-signature-type" data-tsd-kind="Type alias">JssmStateStyleKeyList</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="jssm_types.html#JssmStateConfig" class="tsd-signature-type" data-tsd-kind="Type alias">JssmStateConfig</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="transfer_state_properties" class="tsd-anchor"></a><h3 class="tsd-anchor-link">transfer_<wbr/>state_<wbr/>properties<a href="#transfer_state_properties" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">transfer_<wbr/>state_<wbr/>properties<span class="tsd-signature-symbol">(</span>state_decl<span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmStateDeclaration" class="tsd-signature-type" data-tsd-kind="Type alias">JssmStateDeclaration</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="jssm_types.html#JssmStateDeclaration" class="tsd-signature-type" data-tsd-kind="Type alias">JssmStateDeclaration</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/373b64a/src/ts/jssm.ts#L83">src/ts/jssm.ts:83</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> 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.</p>
</div><dl class="tsd-comment-tags"><dt>internal</dt><dd></dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>state_decl: <a href="jssm_types.html#JssmStateDeclaration" class="tsd-signature-type" data-tsd-kind="Type alias">JssmStateDeclaration</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="jssm_types.html#JssmStateDeclaration" class="tsd-signature-type" data-tsd-kind="Type alias">JssmStateDeclaration</a></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Modules</a></li><li class=" pages-entry pages-entry-menu pages-entry-depth-0"><a>Tutorials</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-1"><a href="../pages/WhatAreStateMachines.html">What are state machines?</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-1"><a href="../pages/GettingStarted.html">☕ <wbr/>Quick <wbr/>Start</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-1"><a href="../pages/LanguageReference.html">Language reference</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-1"><a href="../pages/todo.html">API reference</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-1"><a href="../pages/ExampleMachines.html">Example machines</a></li><li class=" pages-entry pages-entry-menu pages-entry-depth-1"><a>Howtos and <wbr/>Recipes</a></li><li class=" pages-entry pages-entry-menu pages-entry-depth-2"><a>Frameworks</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">React</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">Vue</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">Angular</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">Node</a></li><li class=" pages-entry pages-entry-menu pages-entry-depth-2"><a>Environments</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">Node</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">Typescript</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">The browser</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">AWS <wbr/>Lambda</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">SQL</a></li><li class=" pages-entry pages-entry-menu pages-entry-depth-2"><a>Bundling</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">Rollup</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">Webpack</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">CDN</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-3"><a href="../pages/todo.html">Local files</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-2"><a href="../pages/todo.html">Let's make a large machine</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-2"><a href="../pages/todo.html">Publishing</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-2"><a href="../pages/Styling.html">Theme, style, color</a></li><li class=" pages-entry pages-entry-menu pages-entry-depth-1"><a>Comparisons</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-2"><a href="../pages/FeatureComparison.html">Feature comparison</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-2"><a href="../pages/Shootout.html">LOC <wbr/>Shootout</a></li><li class=" pages-entry pages-entry-menu pages-entry-depth-0"><a>Tools</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-1"><a href="../pages/live_editor.html">Live <wbr/>Editor</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-1"><a href="../pages/todo.html">Github <wbr/>Action</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-1"><a href="../pages/todo.html">CLI</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-0"><a href="../pages/community.html">Community</a></li><li class=" pages-entry pages-entry-page pages-entry-depth-0"><a href="../pages/CHANGELOG.long.html">Changelog</a></li><li class="current tsd-kind-module"><a href="jssm.html">jssm</a><ul><li class=" tsd-kind-namespace tsd-parent-kind-module"><a href="jssm._internal_.html"><internal></a></li></ul></li><li class=" tsd-kind-module"><a href="jssm_constants.html">jssm_<wbr/>constants</a></li><li class=" tsd-kind-module"><a href="jssm_error.html">jssm_<wbr/>error</a></li><li class=" tsd-kind-module"><a href="jssm_types.html">jssm_<wbr/>types</a></li><li class=" tsd-kind-module"><a href="jssm_util.html">jssm_<wbr/>util</a></li><li class=" tsd-kind-module"><a href="version.html">version</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#FslDirections" class="tsd-kind-icon">Fsl<wbr/>Directions</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#build_time" class="tsd-kind-icon">build_<wbr/>time</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#constants" class="tsd-kind-icon">constants</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#find_repeated" class="tsd-kind-icon">find_<wbr/>repeated</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#histograph" class="tsd-kind-icon">histograph</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#seq" class="tsd-kind-icon">seq</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#unique" class="tsd-kind-icon">unique</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#version" class="tsd-kind-icon">version</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#weighted_histo_key" class="tsd-kind-icon">weighted_<wbr/>histo_<wbr/>key</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#weighted_rand_select" class="tsd-kind-icon">weighted_<wbr/>rand_<wbr/>select</a></li><li class="tsd-kind-reference tsd-parent-kind-module"><a href="jssm.html#weighted_sample_select" class="tsd-kind-icon">weighted_<wbr/>sample_<wbr/>select</a></li><li class="tsd-kind-class tsd-parent-kind-module tsd-has-type-parameter"><a href="../classes/jssm.Machine.html" class="tsd-kind-icon">Machine</a></li><li class="tsd-kind-variable tsd-parent-kind-module"><a href="jssm.html#gviz_shapes" class="tsd-kind-icon">gviz_<wbr/>shapes</a></li><li class="tsd-kind-variable tsd-parent-kind-module"><a href="jssm.html#named_colors" class="tsd-kind-icon">named_<wbr/>colors</a></li><li class="tsd-kind-variable tsd-parent-kind-module"><a href="jssm.html#shapes" class="tsd-kind-icon">shapes</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#abstract_hook_step" class="tsd-kind-icon">abstract_<wbr/>hook_<wbr/>step</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#arrow_direction" class="tsd-kind-icon">arrow_<wbr/>direction</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#arrow_left_kind" class="tsd-kind-icon">arrow_<wbr/>left_<wbr/>kind</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#arrow_right_kind" class="tsd-kind-icon">arrow_<wbr/>right_<wbr/>kind</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#compile" class="tsd-kind-icon">compile</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#deserialize" class="tsd-kind-icon">deserialize</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#from" class="tsd-kind-icon">from</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#is_hook_complex_result" class="tsd-kind-icon">is_<wbr/>hook_<wbr/>complex_<wbr/>result</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#is_hook_rejection" class="tsd-kind-icon">is_<wbr/>hook_<wbr/>rejection</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#make" class="tsd-kind-icon">make</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#parse" class="tsd-kind-icon">parse</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="jssm.html#sm" class="tsd-kind-icon">sm</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#state_style_condense" class="tsd-kind-icon">state_<wbr/>style_<wbr/>condense</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="jssm.html#transfer_state_properties" class="tsd-kind-icon">transfer_<wbr/>state_<wbr/>properties</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li><li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li><li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li><li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li><li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li><li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>