-
Notifications
You must be signed in to change notification settings - Fork 21
/
modules.html
126 lines (124 loc) · 57.7 KB
/
modules.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
118
119
120
121
122
123
124
125
126
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>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"><h1>JSSM, a JavaScript state machine - the FSM for FSL </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>Classes</h3><ul class="tsd-index-list"><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/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"><a href="modules.html#gviz_shapes" class="tsd-kind-icon">gviz_<wbr/>shapes</a></li><li class="tsd-kind-variable"><a href="modules.html#histograph" class="tsd-kind-icon">histograph</a></li><li class="tsd-kind-variable"><a href="modules.html#named_colors" class="tsd-kind-icon">named_<wbr/>colors</a></li><li class="tsd-kind-variable"><a href="modules.html#shapes" class="tsd-kind-icon">shapes</a></li><li class="tsd-kind-variable"><a href="modules.html#version" class="tsd-kind-icon">version</a></li><li class="tsd-kind-variable"><a href="modules.html#weighted_histo_key" class="tsd-kind-icon">weighted_<wbr/>histo_<wbr/>key</a></li><li class="tsd-kind-variable"><a href="modules.html#weighted_rand_select" class="tsd-kind-icon">weighted_<wbr/>rand_<wbr/>select</a></li><li class="tsd-kind-variable"><a href="modules.html#weighted_sample_select" class="tsd-kind-icon">weighted_<wbr/>sample_<wbr/>select</a></li></ul></section><section class="tsd-index-section "><h3>Functions</h3><ul class="tsd-index-list"><li class="tsd-kind-function"><a href="modules.html#arrow_direction" class="tsd-kind-icon">arrow_<wbr/>direction</a></li><li class="tsd-kind-function"><a href="modules.html#arrow_left_kind" class="tsd-kind-icon">arrow_<wbr/>left_<wbr/>kind</a></li><li class="tsd-kind-function"><a href="modules.html#arrow_right_kind" class="tsd-kind-icon">arrow_<wbr/>right_<wbr/>kind</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#compile" class="tsd-kind-icon">compile</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#from" class="tsd-kind-icon">from</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#make" class="tsd-kind-icon">make</a></li><li class="tsd-kind-function"><a href="modules.html#parse" class="tsd-kind-icon">parse</a></li><li class="tsd-kind-function"><a href="modules.html#seq" class="tsd-kind-icon">seq</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#sm" class="tsd-kind-icon">sm</a></li><li class="tsd-kind-function"><a href="modules.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>Variables</h2><section class="tsd-panel tsd-member tsd-kind-variable"><a id="gviz_shapes" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> 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><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/70be907/src/ts/jssm_constants.ts#L2">jssm_constants.ts:2</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-variable"><a id="histograph" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> 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><div class="tsd-signature tsd-kind-icon">histograph<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/70be907/src/ts/jssm_util.ts#L102">jssm_util.ts:102</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> Returns the histograph of an array as a <code>Map</code>. Makes no attempt to cope
with deep equality; will fail for complex contents, as such.</p>
</div><div><pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">histograph</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">histograph</span><span class="hl-1">( [</span><span class="hl-5">0</span><span class="hl-1">, </span><span class="hl-5">0</span><span class="hl-1">, </span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">1</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">2</span><span class="hl-1">, </span><span class="hl-5">1</span><span class="hl-1">] ); </span><span class="hl-6">// Map()</span>
</code></pre>
</div></div></section><section class="tsd-panel tsd-member tsd-kind-variable"><a id="named_colors" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> 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><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/70be907/src/ts/jssm_constants.ts#L71">jssm_constants.ts:71</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-variable"><a id="shapes" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> 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><span class="tsd-signature-symbol"> = gviz_shapes</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/70be907/src/ts/jssm_constants.ts#L65">jssm_constants.ts:65</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-variable"><a id="version" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> 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><div class="tsd-signature tsd-kind-icon">version<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = "5.70.21"</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/70be907/src/ts/version.ts#L2">version.ts:2</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-variable"><a id="weighted_histo_key" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> 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><div class="tsd-signature tsd-kind-icon">weighted_<wbr/>histo_<wbr/>key<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/70be907/src/ts/jssm_util.ts#L126">jssm_util.ts:126</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-variable"><a id="weighted_rand_select" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> 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><div class="tsd-signature tsd-kind-icon">weighted_<wbr/>rand_<wbr/>select<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/70be907/src/ts/jssm_util.ts#L27">jssm_util.ts:27</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-variable"><a id="weighted_sample_select" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> 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><div class="tsd-signature tsd-kind-icon">weighted_<wbr/>sample_<wbr/>select<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/StoneCypher/jssm/blob/70be907/src/ts/jssm_util.ts#L115">jssm_util.ts:115</a></li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group "><h2>Functions</h2><section class="tsd-panel tsd-member tsd-kind-function"><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"><li class="tsd-signature tsd-kind-icon">arrow_<wbr/>direction<span class="tsd-signature-symbol">(</span>arrow<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">JssmArrow</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">JssmArrowDirection</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/70be907/src/ts/jssm.ts#L71">jssm.ts:71</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-4">arrow_direction</span><span class="hl-1">(</span><span class="hl-3">'->'</span><span class="hl-1">); </span><span class="hl-6">// 'right'</span><br/><span class="hl-4">arrow_direction</span><span class="hl-1">(</span><span class="hl-3">'<~=>'</span><span class="hl-1">); </span><span class="hl-6">// 'both'</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>arrow: <span class="tsd-signature-type">JssmArrow</span></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 <span class="tsd-signature-type">JssmArrowDirection</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function"><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"><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><span class="tsd-signature-type">JssmArrow</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">JssmArrowKind</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/70be907/src/ts/jssm.ts#L131">jssm.ts:131</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-4">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<-'</span><span class="hl-1">); </span><span class="hl-6">// 'legal'</span><br/><span class="hl-4">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<='</span><span class="hl-1">); </span><span class="hl-6">// 'main'</span><br/><span class="hl-4">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<~'</span><span class="hl-1">); </span><span class="hl-6">// 'forced'</span><br/><span class="hl-4">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<->'</span><span class="hl-1">); </span><span class="hl-6">// 'legal'</span><br/><span class="hl-4">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'->'</span><span class="hl-1">); </span><span class="hl-6">// 'none'</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>arrow: <span class="tsd-signature-type">JssmArrow</span></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 <span class="tsd-signature-type">JssmArrowKind</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function"><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"><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><span class="tsd-signature-type">JssmArrow</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">JssmArrowKind</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/70be907/src/ts/jssm.ts#L191">jssm.ts:191</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-4">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'->'</span><span class="hl-1">); </span><span class="hl-6">// 'legal'</span><br/><span class="hl-4">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'=>'</span><span class="hl-1">); </span><span class="hl-6">// 'main'</span><br/><span class="hl-4">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'~>'</span><span class="hl-1">); </span><span class="hl-6">// 'forced'</span><br/><span class="hl-4">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<->'</span><span class="hl-1">); </span><span class="hl-6">// 'legal'</span><br/><span class="hl-4">arrow_left_kind</span><span class="hl-1">(</span><span class="hl-3">'<-'</span><span class="hl-1">); </span><span class="hl-6">// 'none'</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>arrow: <span class="tsd-signature-type">JssmArrow</span></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 <span class="tsd-signature-type">JssmArrowKind</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function 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-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">mDT</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>tree<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">JssmParseTree</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">JssmGenericConfig</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/70be907/src/ts/jssm.ts#L522">jssm.ts:522</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="modules.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-7">const</span><span class="hl-1"> </span><span class="hl-8">intermediate</span><span class="hl-1"> = </span><span class="hl-4">parse</span><span class="hl-1">(</span><span class="hl-3">'a -> b;'</span><span class="hl-1">);</span><br/><span class="hl-6">// [ {key:'transition', from:'a', se:{kind:'->',to:'b'}} ]</span><br/><br/><span class="hl-7">const</span><span class="hl-1"> </span><span class="hl-8">cfg</span><span class="hl-1"> = </span><span class="hl-4">compile</span><span class="hl-1">(</span><span class="hl-2">intermediate</span><span class="hl-1">);</span><br/><span class="hl-6">// { start_states:['a'], transitions: [{ from:'a', to:'b', kind:'legal', forced_only:false, main_path:false }] }</span><br/><br/><span class="hl-7">const</span><span class="hl-1"> </span><span class="hl-8">machine</span><span class="hl-1"> = </span><span class="hl-7">new</span><span class="hl-1"> </span><span class="hl-4">Machine</span><span class="hl-1">(</span><span class="hl-2">cfg</span><span class="hl-1">);</span><br/><span class="hl-6">// 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="classes/Machine.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-7">const</span><span class="hl-1"> </span><span class="hl-8">switch</span><span class="hl-1"> = </span><span class="hl-4">sm</span><span class="hl-3">`on <=> off;`</span><span class="hl-1">;</span>
</code></pre>
<p> Method {@link from}:</p>
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> </span><span class="hl-7">*</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-7">const</span><span class="hl-1"> </span><span class="hl-8">toggle</span><span class="hl-1"> = </span><span class="hl-2">jssm</span><span class="hl-1">.</span><span class="hl-4">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>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: <span class="tsd-signature-type">JssmParseTree</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 <span class="tsd-signature-type">JssmGenericConfig</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-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-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><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">JssmGenericConfig</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/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/70be907/src/ts/jssm.ts#L2161">jssm.ts:2161</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="classes/Machine.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-7">*</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-7">const</span><span class="hl-1"> </span><span class="hl-8">switch</span><span class="hl-1"> = </span><span class="hl-2">jssm</span><span class="hl-1">.</span><span class="hl-4">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: <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">JssmGenericConfig</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/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-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-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">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><span class="tsd-signature-type">JssmGenericConfig</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/70be907/src/ts/jssm.ts#L636">jssm.ts:636</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="modules.html#compile">compile</a> or
<a href="classes/Machine.html#sm">sm</a>.</p>
</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>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 <span class="tsd-signature-type">JssmGenericConfig</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"><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"><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><span class="tsd-signature-type">Object</span><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/70be907/src/ts/jssm.ts#L349">jssm.ts:349</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="modules.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="modules.html#compile">compile</a> and <a href="classes/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-7">const</span><span class="hl-1"> </span><span class="hl-8">intermediate</span><span class="hl-1"> = </span><span class="hl-4">wrap_parse</span><span class="hl-1">(</span><span class="hl-3">'a -> b;'</span><span class="hl-1">, {});</span><br/><span class="hl-6">// [ {key:'transition', from:'a', se:{kind:'->',to:'b'}} ]</span><br/><br/><span class="hl-7">const</span><span class="hl-1"> </span><span class="hl-8">cfg</span><span class="hl-1"> = </span><span class="hl-4">compile</span><span class="hl-1">(</span><span class="hl-2">intermediate</span><span class="hl-1">);</span><br/><span class="hl-6">// { start_states:['a'], transitions: [{ from:'a', to:'b', kind:'legal', forced_only:false, main_path:false }] }</span><br/><br/><span class="hl-7">const</span><span class="hl-1"> </span><span class="hl-8">machine</span><span class="hl-1"> = </span><span class="hl-7">new</span><span class="hl-1"> </span><span class="hl-4">Machine</span><span class="hl-1">(</span><span class="hl-2">cfg</span><span class="hl-1">);</span><br/><span class="hl-6">// 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="classes/Machine.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-7">const</span><span class="hl-1"> </span><span class="hl-8">switch</span><span class="hl-1"> = </span><span class="hl-4">sm</span><span class="hl-3">`on <=> off;`</span><span class="hl-1">;</span>
</code></pre>
<p> Method {@link from}:</p>
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> </span><span class="hl-7">*</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-7">const</span><span class="hl-1"> </span><span class="hl-8">toggle</span><span class="hl-1"> = </span><span class="hl-2">jssm</span><span class="hl-1">.</span><span class="hl-4">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: <span class="tsd-signature-type">Object</span></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"><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><ul class="tsd-signatures tsd-kind-function"><li class="tsd-signature tsd-kind-icon">seq<span class="tsd-signature-symbol">(</span>n<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</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/70be907/src/ts/jssm_util.ts#L69">jssm_util.ts:69</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p> Returns, for a non-negative integer argument <code>n</code>, the series <code>[0 .. n]</code>.</p>
</div><div><pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">seq</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">seq</span><span class="hl-1">(</span><span class="hl-5">5</span><span class="hl-1">); </span><span class="hl-6">// [0, 1, 2, 3, 4]</span><br/><span class="hl-4">seq</span><span class="hl-1">(</span><span class="hl-5">0</span><span class="hl-1">); </span><span class="hl-6">// []</span>
</code></pre>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>n: <span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function 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-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><span class="tsd-signature-type">TemplateStringsArray</span>, <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/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/70be907/src/ts/jssm.ts#L2113">jssm.ts:2113</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 {@link from}.</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-7">*</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-7">const</span><span class="hl-1"> </span><span class="hl-8">switch</span><span class="hl-1"> = </span><span class="hl-2">jssm</span><span class="hl-1">.</span><span class="hl-4">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: <span class="tsd-signature-type">TemplateStringsArray</span></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/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"><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"><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><span class="tsd-signature-type">JssmStateDeclaration</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">JssmStateDeclaration</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/70be907/src/ts/jssm.ts#L654">jssm.ts:654</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: <span class="tsd-signature-type">JssmStateDeclaration</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">JssmStateDeclaration</span></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="current"><a href="modules.html">Exports</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-page pages-entry-depth-3"><a href="pages/todo.html">CLI</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">Deno</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-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></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class tsd-has-type-parameter"><a href="classes/Machine.html" class="tsd-kind-icon">Machine</a></li><li class="tsd-kind-variable"><a href="modules.html#gviz_shapes" class="tsd-kind-icon">gviz_<wbr/>shapes</a></li><li class="tsd-kind-variable"><a href="modules.html#histograph" class="tsd-kind-icon">histograph</a></li><li class="tsd-kind-variable"><a href="modules.html#named_colors" class="tsd-kind-icon">named_<wbr/>colors</a></li><li class="tsd-kind-variable"><a href="modules.html#shapes" class="tsd-kind-icon">shapes</a></li><li class="tsd-kind-variable"><a href="modules.html#version" class="tsd-kind-icon">version</a></li><li class="tsd-kind-variable"><a href="modules.html#weighted_histo_key" class="tsd-kind-icon">weighted_<wbr/>histo_<wbr/>key</a></li><li class="tsd-kind-variable"><a href="modules.html#weighted_rand_select" class="tsd-kind-icon">weighted_<wbr/>rand_<wbr/>select</a></li><li class="tsd-kind-variable"><a href="modules.html#weighted_sample_select" class="tsd-kind-icon">weighted_<wbr/>sample_<wbr/>select</a></li><li class="tsd-kind-function"><a href="modules.html#arrow_direction" class="tsd-kind-icon">arrow_<wbr/>direction</a></li><li class="tsd-kind-function"><a href="modules.html#arrow_left_kind" class="tsd-kind-icon">arrow_<wbr/>left_<wbr/>kind</a></li><li class="tsd-kind-function"><a href="modules.html#arrow_right_kind" class="tsd-kind-icon">arrow_<wbr/>right_<wbr/>kind</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#compile" class="tsd-kind-icon">compile</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#from" class="tsd-kind-icon">from</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#make" class="tsd-kind-icon">make</a></li><li class="tsd-kind-function"><a href="modules.html#parse" class="tsd-kind-icon">parse</a></li><li class="tsd-kind-function"><a href="modules.html#seq" class="tsd-kind-icon">seq</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#sm" class="tsd-kind-icon">sm</a></li><li class="tsd-kind-function"><a href="modules.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-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</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>