@breautek/storm 5.0.2 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/bt-config-defaults.json +0 -1
- package/bt-config-sample.jsonc +41 -7
- package/docs/assets/highlight.css +13 -6
- package/docs/assets/search.js +1 -1
- package/docs/classes/Application.html +123 -80
- package/docs/classes/BackendAuthenticationMiddleware.html +6 -4
- package/docs/classes/CORSMiddleware.html +10 -8
- package/docs/classes/ConfigLoader.html +5 -3
- package/docs/classes/Database.html +16 -14
- package/docs/classes/DatabaseCastObject.html +7 -5
- package/docs/classes/DatabaseConnection.html +23 -21
- package/docs/classes/DatabaseQueryError.html +14 -12
- package/docs/classes/DeadLockError.html +14 -12
- package/docs/classes/DiskSpaceError.html +14 -12
- package/docs/classes/DropTemporaryTableQuery.html +12 -10
- package/docs/classes/DuplicateEntryError.html +14 -12
- package/docs/classes/EntityNotFoundError.html +14 -12
- package/docs/classes/ExpiredTokenError.html +14 -12
- package/docs/classes/Handler.html +17 -15
- package/docs/classes/InternalError.html +14 -12
- package/docs/classes/InvalidCredentialsError.html +14 -12
- package/docs/classes/InvalidValueError.html +14 -12
- package/docs/classes/LineString.html +8 -6
- package/docs/classes/LockWaitTimeoutError.html +14 -12
- package/docs/classes/ManagedDatabaseConnection.html +23 -21
- package/docs/classes/Middleware.html +7 -5
- package/docs/classes/MissingConfigError.html +14 -12
- package/docs/classes/MissingParameterError.html +14 -12
- package/docs/classes/MySQLConnection.html +24 -22
- package/docs/classes/MySQLDatabase.html +17 -15
- package/docs/classes/NotImplementedError.html +14 -12
- package/docs/classes/Point.html +8 -6
- package/docs/classes/Polygon.html +8 -6
- package/docs/classes/Query.html +12 -10
- package/docs/classes/RawError.html +14 -12
- package/docs/classes/RawQuery.html +12 -10
- package/docs/classes/Request.html +22 -20
- package/docs/classes/Response.html +15 -13
- package/docs/classes/ResponseData.html +11 -9
- package/docs/classes/ServiceProvider.html +19 -17
- package/docs/classes/ServiceResponse.html +9 -7
- package/docs/classes/SetSessionVariableQuery.html +12 -10
- package/docs/classes/StormError.html +14 -12
- package/docs/classes/TemporaryTableQuery.html +12 -10
- package/docs/classes/Token.html +6 -4
- package/docs/classes/TokenManager.html +8 -6
- package/docs/classes/Transaction.html +10 -8
- package/docs/classes/UnauthorizedAccessError.html +14 -12
- package/docs/enums/ErrorCode.html +13 -11
- package/docs/enums/ExitCode.html +6 -4
- package/docs/enums/HTTPMethod.html +8 -6
- package/docs/enums/IsolationLevel.html +8 -6
- package/docs/enums/JWTError.html +6 -4
- package/docs/enums/StatusCode.html +52 -50
- package/docs/functions/formidable-1.html +3 -1
- package/docs/functions/getInstance.html +4 -2
- package/docs/index.html +6 -2
- package/docs/interfaces/IAdditionalErrorDetails.html +4 -2
- package/docs/interfaces/IAuthTokenData.html +3 -1
- package/docs/interfaces/ICloudwatchConfig.html +174 -0
- package/docs/interfaces/ICloudwatchCredentials.html +167 -0
- package/docs/interfaces/ICloudwatchStreamConfig.html +167 -0
- package/docs/interfaces/IConfig.html +14 -12
- package/docs/interfaces/IDatabaseConfig.html +10 -8
- package/docs/interfaces/IDatabaseConnection.html +18 -16
- package/docs/interfaces/IErrorResponse.html +9 -7
- package/docs/interfaces/IFormData.html +6 -4
- package/docs/interfaces/IHandler.html +5 -3
- package/docs/interfaces/IInsertQueryResult.html +7 -5
- package/docs/interfaces/IJWTVerifyOptions.html +5 -3
- package/docs/interfaces/IParameterMap.html +4 -2
- package/docs/interfaces/IQueryable.html +9 -7
- package/docs/interfaces/IRequestResponse.html +6 -4
- package/docs/interfaces/IServiceHeaders.html +4 -2
- package/docs/interfaces/ISetSessionVariableQueryInput.html +6 -4
- package/docs/interfaces/ITemporaryTableQueryInput.html +6 -4
- package/docs/interfaces/IUpdateQueryResult.html +6 -4
- package/docs/interfaces/formidable.EmitData.html +3 -1
- package/docs/interfaces/formidable.EventData.html +3 -1
- package/docs/interfaces/formidable.Fields.html +3 -1
- package/docs/interfaces/formidable.File.html +3 -1
- package/docs/interfaces/formidable.FileJSON.html +3 -1
- package/docs/interfaces/formidable.Files.html +3 -1
- package/docs/interfaces/formidable.Options.html +3 -1
- package/docs/interfaces/formidable.Part.html +30 -28
- package/docs/modules/formidable.html +3 -1
- package/docs/types/IDeleteQueryResult.html +4 -2
- package/docs/types/IHandlerError.html +4 -2
- package/docs/types/IHandlerResponse.html +4 -2
- package/docs/types/TCoordinate.html +4 -2
- package/docs/types/formidable.BufferEncoding.html +3 -1
- package/docs/types/formidable.DefaultOptions.html +3 -1
- package/docs/types/formidable.EnabledPlugins.html +3 -1
- package/docs/types/formidable.EventNames.html +3 -1
- package/docs/types/formidable.MappedParsers.html +3 -1
- package/docs/types/formidable.Plugin.html +3 -1
- package/docs/types/formidable.PluginFunction.html +3 -1
- package/docs/types/formidable.Plugins.html +3 -1
- package/lib/Application.d.ts +3 -0
- package/lib/Application.js +105 -63
- package/lib/Application.js.map +1 -1
- package/lib/IConfig.d.ts +15 -2
- package/lib/MySQLConnection.js +3 -3
- package/lib/MySQLConnection.js.map +1 -1
- package/lib/api.d.ts +1 -2
- package/lib/api.js +2 -4
- package/lib/api.js.map +1 -1
- package/package.json +6 -4
- package/src/Application.ts +131 -68
- package/src/IConfig.ts +18 -2
- package/src/MySQLConnection.ts +2 -1
- package/src/api.ts +6 -2
- package/docs/classes/DumpStream.html +0 -161
- package/lib/DumpStream.d.ts +0 -6
- package/lib/DumpStream.js +0 -28
- package/lib/DumpStream.js.map +0 -1
- package/src/DumpStream.ts +0 -28
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
<ul class="tsd-hierarchy">
|
|
37
37
|
<li><span class="target">Application</span></li></ul></li></ul></section><aside class="tsd-sources">
|
|
38
38
|
<ul>
|
|
39
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
39
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L44">src/Application.ts:44</a></li></ul></aside>
|
|
40
40
|
<section class="tsd-panel-group tsd-index-group">
|
|
41
41
|
<section class="tsd-panel tsd-index-panel">
|
|
42
42
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
<a href="Application.html#setMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a>
|
|
96
96
|
<a href="Application.html#setTokenManager" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>set<wbr/>Token<wbr/>Manager</span></a>
|
|
97
97
|
<a href="Application.html#shouldListen" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>should<wbr/>Listen</span></a>
|
|
98
|
+
<a href="Application.html#start" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>start</span></a>
|
|
98
99
|
<a href="Application.html#getEventListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>get<wbr/>Event<wbr/>Listeners</span></a>
|
|
99
100
|
<a href="Application.html#listenerCount-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>listener<wbr/>Count</span></a>
|
|
100
101
|
<a href="Application.html#on-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>on</span></a>
|
|
@@ -133,42 +134,73 @@
|
|
|
133
134
|
<h4 class="tsd-returns-title">Returns <a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
134
135
|
<p>Overrides EventEmitter.constructor</p>
|
|
135
136
|
<ul>
|
|
136
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
137
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L67">src/Application.ts:67</a></li></ul></aside></li></ul></section></section>
|
|
137
138
|
<section class="tsd-panel-group tsd-member-group">
|
|
138
139
|
<h2>Properties</h2>
|
|
139
140
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="captureRejectionSymbol" class="tsd-anchor"></a>
|
|
140
141
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>capture<wbr/>Rejection<wbr/>Symbol</span><a href="#captureRejectionSymbol" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
141
|
-
<div class="tsd-signature"><span class="tsd-kind-property">capture<wbr/>Rejection<wbr/>Symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><a href="Application.html#captureRejectionSymbol" class="tsd-signature-type tsd-kind-property">captureRejectionSymbol</a></div
|
|
142
|
+
<div class="tsd-signature"><span class="tsd-kind-property">capture<wbr/>Rejection<wbr/>Symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><a href="Application.html#captureRejectionSymbol" class="tsd-signature-type tsd-kind-property">captureRejectionSymbol</a></div>
|
|
143
|
+
<div class="tsd-comment tsd-typography"><p>Value: <code>Symbol.for('nodejs.rejection')</code></p>
|
|
144
|
+
<p>See how to write a custom <code>rejection handler</code>.</p>
|
|
145
|
+
|
|
146
|
+
<h3>Since</h3><p>v13.4.0, v12.16.0</p>
|
|
147
|
+
</div><aside class="tsd-sources">
|
|
142
148
|
<p>Inherited from EventEmitter.captureRejectionSymbol</p>
|
|
143
149
|
<ul>
|
|
144
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
150
|
+
<li>Defined in node_modules/@types/node/events.d.ts:326</li></ul></aside></section>
|
|
145
151
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="captureRejections" class="tsd-anchor"></a>
|
|
146
152
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>capture<wbr/>Rejections</span><a href="#captureRejections" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
147
153
|
<div class="tsd-signature"><span class="tsd-kind-property">capture<wbr/>Rejections</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
|
|
148
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
154
|
+
<div class="tsd-comment tsd-typography"><p>Value: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type">boolean</a></p>
|
|
155
|
+
<p>Change the default <code>captureRejections</code> option on all new <code>EventEmitter</code> objects.</p>
|
|
156
|
+
|
|
157
|
+
<h3>Since</h3><p>v13.4.0, v12.16.0</p>
|
|
149
158
|
</div><aside class="tsd-sources">
|
|
150
159
|
<p>Inherited from EventEmitter.captureRejections</p>
|
|
151
160
|
<ul>
|
|
152
161
|
<li>Defined in node_modules/@types/node/events.d.ts:333</li></ul></aside></section>
|
|
153
162
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="defaultMaxListeners" class="tsd-anchor"></a>
|
|
154
163
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>default<wbr/>Max<wbr/>Listeners</span><a href="#defaultMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
155
|
-
<div class="tsd-signature"><span class="tsd-kind-property">default<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div
|
|
164
|
+
<div class="tsd-signature"><span class="tsd-kind-property">default<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
|
165
|
+
<div class="tsd-comment tsd-typography"><p>By default, a maximum of <code>10</code> listeners can be registered for any single
|
|
166
|
+
event. This limit can be changed for individual <code>EventEmitter</code> instances
|
|
167
|
+
using the <code>emitter.setMaxListeners(n)</code> method. To change the default
|
|
168
|
+
for <em>all</em><code>EventEmitter</code> instances, the <code>events.defaultMaxListeners</code>property can be used. If this value is not a positive number, a <code>RangeError</code>is thrown.</p>
|
|
169
|
+
<p>Take caution when setting the <code>events.defaultMaxListeners</code> because the
|
|
170
|
+
change affects <em>all</em><code>EventEmitter</code> instances, including those created before
|
|
171
|
+
the change is made. However, calling <code>emitter.setMaxListeners(n)</code> still has
|
|
172
|
+
precedence over <code>events.defaultMaxListeners</code>.</p>
|
|
173
|
+
<p>This is not a hard limit. The <code>EventEmitter</code> instance will allow
|
|
174
|
+
more listeners to be added but will output a trace warning to stderr indicating
|
|
175
|
+
that a "possible EventEmitter memory leak" has been detected. For any single<code>EventEmitter</code>, the <code>emitter.getMaxListeners()</code> and <code>emitter.setMaxListeners()</code>methods can be used to
|
|
176
|
+
temporarily avoid this warning:</p>
|
|
177
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">emitter</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><span class="hl-4">emitter</span><span class="hl-3">.</span><span class="hl-5">setMaxListeners</span><span class="hl-3">(</span><span class="hl-4">emitter</span><span class="hl-3">.</span><span class="hl-5">getMaxListeners</span><span class="hl-3">() + </span><span class="hl-2">1</span><span class="hl-3">);</span><br/><span class="hl-4">emitter</span><span class="hl-3">.</span><span class="hl-5">once</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-8">// do stuff</span><br/><span class="hl-3"> </span><span class="hl-4">emitter</span><span class="hl-3">.</span><span class="hl-5">setMaxListeners</span><span class="hl-3">(</span><span class="hl-4">Math</span><span class="hl-3">.</span><span class="hl-5">max</span><span class="hl-3">(</span><span class="hl-4">emitter</span><span class="hl-3">.</span><span class="hl-5">getMaxListeners</span><span class="hl-3">() - </span><span class="hl-2">1</span><span class="hl-3">, </span><span class="hl-2">0</span><span class="hl-3">));</span><br/><span class="hl-3">});</span>
|
|
178
|
+
</code><button>Copy</button></pre>
|
|
179
|
+
<p>The <code>--trace-warnings</code> command-line flag can be used to display the
|
|
180
|
+
stack trace for such warnings.</p>
|
|
181
|
+
<p>The emitted warning can be inspected with <code>process.on('warning')</code> and will
|
|
182
|
+
have the additional <code>emitter</code>, <code>type</code>, and <code>count</code> properties, referring to
|
|
183
|
+
the event emitter instance, the event's name and the number of attached
|
|
184
|
+
listeners, respectively.
|
|
185
|
+
Its <code>name</code> property is set to <code>'MaxListenersExceededWarning'</code>.</p>
|
|
186
|
+
|
|
187
|
+
<h3>Since</h3><p>v0.11.2</p>
|
|
188
|
+
</div><aside class="tsd-sources">
|
|
156
189
|
<p>Inherited from EventEmitter.defaultMaxListeners</p>
|
|
157
190
|
<ul>
|
|
158
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
191
|
+
<li>Defined in node_modules/@types/node/events.d.ts:370</li></ul></aside></section>
|
|
159
192
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="errorMonitor" class="tsd-anchor"></a>
|
|
160
193
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>error<wbr/>Monitor</span><a href="#errorMonitor" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
161
194
|
<div class="tsd-signature"><span class="tsd-kind-property">error<wbr/>Monitor</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><a href="Application.html#errorMonitor" class="tsd-signature-type tsd-kind-property">errorMonitor</a></div>
|
|
162
|
-
<div class="tsd-comment tsd-typography"><p>This symbol shall be used to install a listener for only monitoring <code>'error'</code>
|
|
163
|
-
|
|
164
|
-
<code>'error'</code> listeners are called.</p>
|
|
165
|
-
<p>Installing a listener using this symbol does not change the behavior once an
|
|
166
|
-
<code>'error'</code> event is emitted, therefore the process will still crash if no
|
|
195
|
+
<div class="tsd-comment tsd-typography"><p>This symbol shall be used to install a listener for only monitoring <code>'error'</code>events. Listeners installed using this symbol are called before the regular<code>'error'</code> listeners are called.</p>
|
|
196
|
+
<p>Installing a listener using this symbol does not change the behavior once an<code>'error'</code> event is emitted. Therefore, the process will still crash if no
|
|
167
197
|
regular <code>'error'</code> listener is installed.</p>
|
|
198
|
+
|
|
199
|
+
<h3>Since</h3><p>v13.6.0, v12.17.0</p>
|
|
168
200
|
</div><aside class="tsd-sources">
|
|
169
201
|
<p>Inherited from EventEmitter.errorMonitor</p>
|
|
170
202
|
<ul>
|
|
171
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
203
|
+
<li>Defined in node_modules/@types/node/events.d.ts:319</li></ul></aside></section></section>
|
|
172
204
|
<section class="tsd-panel-group tsd-member-group">
|
|
173
205
|
<h2>Methods</h2>
|
|
174
206
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_attachHandlers" class="tsd-anchor"></a>
|
|
@@ -181,7 +213,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
181
213
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>Promise<void></p>
|
|
182
214
|
<aside class="tsd-sources">
|
|
183
215
|
<ul>
|
|
184
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
216
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L335">src/Application.ts:335</a></li></ul></aside></li></ul></section>
|
|
185
217
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_buildArgOptions" class="tsd-anchor"></a>
|
|
186
218
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_build<wbr/>Arg<wbr/>Options</span><a href="#_buildArgOptions" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
187
219
|
<ul class="tsd-signatures tsd-is-protected">
|
|
@@ -194,7 +226,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
194
226
|
<h5><span class="tsd-kind-parameter">program</span>: <span class="tsd-signature-type ">Command</span></h5></li></ul></div>
|
|
195
227
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
|
|
196
228
|
<ul>
|
|
197
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
229
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L262">src/Application.ts:262</a></li></ul></aside></li></ul></section>
|
|
198
230
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_closeDatabase" class="tsd-anchor"></a>
|
|
199
231
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_close<wbr/>Database</span><a href="#_closeDatabase" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
200
232
|
<ul class="tsd-signatures tsd-is-protected">
|
|
@@ -202,7 +234,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
202
234
|
<li class="tsd-description">
|
|
203
235
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
204
236
|
<ul>
|
|
205
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
237
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L312">src/Application.ts:312</a></li></ul></aside></li></ul></section>
|
|
206
238
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_closeSocket" class="tsd-anchor"></a>
|
|
207
239
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_close<wbr/>Socket</span><a href="#_closeSocket" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
208
240
|
<ul class="tsd-signatures tsd-is-protected">
|
|
@@ -210,7 +242,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
210
242
|
<li class="tsd-description">
|
|
211
243
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
212
244
|
<ul>
|
|
213
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
245
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L318">src/Application.ts:318</a></li></ul></aside></li></ul></section>
|
|
214
246
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_initDB" class="tsd-anchor"></a>
|
|
215
247
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_initDB</span><a href="#_initDB" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
216
248
|
<ul class="tsd-signatures tsd-is-protected">
|
|
@@ -227,7 +259,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
227
259
|
</div></li></ul></div>
|
|
228
260
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><a href="Database.html" class="tsd-signature-type tsd-kind-class">Database</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
229
261
|
<ul>
|
|
230
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
262
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L444">src/Application.ts:444</a></li></ul></aside></li></ul></section>
|
|
231
263
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_initLogger" class="tsd-anchor"></a>
|
|
232
264
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_init<wbr/>Logger</span><a href="#_initLogger" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
233
265
|
<ul class="tsd-signatures tsd-is-protected">
|
|
@@ -240,7 +272,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
240
272
|
<h5><span class="tsd-kind-parameter">config</span>: <span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span></h5></li></ul></div>
|
|
241
273
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Logger</span></h4><aside class="tsd-sources">
|
|
242
274
|
<ul>
|
|
243
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
275
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L165">src/Application.ts:165</a></li></ul></aside></li></ul></section>
|
|
244
276
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_initialize" class="tsd-anchor"></a>
|
|
245
277
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_initialize</span><a href="#_initialize" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
246
278
|
<ul class="tsd-signatures tsd-is-protected">
|
|
@@ -253,7 +285,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
253
285
|
<h5><span class="tsd-kind-parameter">config</span>: <span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span></h5></li></ul></div>
|
|
254
286
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
255
287
|
<ul>
|
|
256
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
288
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L161">src/Application.ts:161</a></li></ul></aside></li></ul></section>
|
|
257
289
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_onBeforeReadyAsync" class="tsd-anchor"></a>
|
|
258
290
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_on<wbr/>Before<wbr/>Ready<wbr/>Async</span><a href="#_onBeforeReadyAsync" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
259
291
|
<ul class="tsd-signatures tsd-is-protected">
|
|
@@ -261,7 +293,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
261
293
|
<li class="tsd-description">
|
|
262
294
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
263
295
|
<ul>
|
|
264
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
296
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L448">src/Application.ts:448</a></li></ul></aside></li></ul></section>
|
|
265
297
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_onConfigLoad" class="tsd-anchor"></a>
|
|
266
298
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_on<wbr/>Config<wbr/>Load</span><a href="#_onConfigLoad" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
267
299
|
<ul class="tsd-signatures tsd-is-protected">
|
|
@@ -278,7 +310,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
278
310
|
</div></li></ul></div>
|
|
279
311
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
|
|
280
312
|
<ul>
|
|
281
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
313
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L388">src/Application.ts:388</a></li></ul></aside></li></ul></section>
|
|
282
314
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_onReady" class="tsd-anchor"></a>
|
|
283
315
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_on<wbr/>Ready</span><a href="#_onReady" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
284
316
|
<ul class="tsd-signatures tsd-is-protected">
|
|
@@ -288,7 +320,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
288
320
|
</div>
|
|
289
321
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
|
|
290
322
|
<ul>
|
|
291
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
323
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L453">src/Application.ts:453</a></li></ul></aside></li></ul></section>
|
|
292
324
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="addListener" class="tsd-anchor"></a>
|
|
293
325
|
<h3 class="tsd-anchor-link"><span>add<wbr/>Listener</span><a href="#addListener" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
294
326
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -319,7 +351,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
319
351
|
<h4 class="tsd-returns-title">Returns <a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
320
352
|
<p>Inherited from EventEmitter.addListener</p>
|
|
321
353
|
<ul>
|
|
322
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
354
|
+
<li>Defined in node_modules/@types/node/events.d.ts:390</li></ul></aside></li></ul></section>
|
|
323
355
|
<section class="tsd-panel tsd-member"><a id="attachHandler" class="tsd-anchor"></a>
|
|
324
356
|
<h3 class="tsd-anchor-link"><span>attach<wbr/>Handler</span><a href="#attachHandler" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
325
357
|
<ul class="tsd-signatures">
|
|
@@ -338,7 +370,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
338
370
|
</div></li></ul></div>
|
|
339
371
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
|
|
340
372
|
<ul>
|
|
341
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
373
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L281">src/Application.ts:281</a></li></ul></aside></li></ul></section>
|
|
342
374
|
<section class="tsd-panel tsd-member"><a id="attachHandlerInstance" class="tsd-anchor"></a>
|
|
343
375
|
<h3 class="tsd-anchor-link"><span>attach<wbr/>Handler<wbr/>Instance</span><a href="#attachHandlerInstance" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
344
376
|
<ul class="tsd-signatures">
|
|
@@ -353,7 +385,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
353
385
|
<h5><span class="tsd-kind-parameter">handler</span>: <a href="Handler.html" class="tsd-signature-type tsd-kind-class">Handler</a><span class="tsd-signature-symbol"><</span><a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/IConfig.html" class="tsd-signature-type tsd-kind-interface">IConfig</a><span class="tsd-signature-symbol">, </span><a href="../interfaces/IAuthTokenData.html" class="tsd-signature-type tsd-kind-interface">IAuthTokenData</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><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-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
354
386
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
|
|
355
387
|
<ul>
|
|
356
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
388
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L286">src/Application.ts:286</a></li></ul></aside></li></ul></section>
|
|
357
389
|
<section class="tsd-panel tsd-member"><a id="close" class="tsd-anchor"></a>
|
|
358
390
|
<h3 class="tsd-anchor-link"><span>close</span><a href="#close" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
359
391
|
<ul class="tsd-signatures">
|
|
@@ -361,7 +393,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
361
393
|
<li class="tsd-description">
|
|
362
394
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
363
395
|
<ul>
|
|
364
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
396
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L305">src/Application.ts:305</a></li></ul></aside></li></ul></section>
|
|
365
397
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="emit" class="tsd-anchor"></a>
|
|
366
398
|
<h3 class="tsd-anchor-link"><span>emit</span><a href="#emit" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
367
399
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -370,7 +402,7 @@ regular <code>'error'</code> listener is installed.</p>
|
|
|
370
402
|
<div class="tsd-comment tsd-typography"><p>Synchronously calls each of the listeners registered for the event named<code>eventName</code>, in the order they were registered, passing the supplied arguments
|
|
371
403
|
to each.</p>
|
|
372
404
|
<p>Returns <code>true</code> if the event had listeners, <code>false</code> otherwise.</p>
|
|
373
|
-
<pre><code class="language-js"><span class="hl-
|
|
405
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">myEmitter</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><br/><span class="hl-8">// First listener</span><br/><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">, </span><span class="hl-0">function</span><span class="hl-3"> </span><span class="hl-5">firstListener</span><span class="hl-3">() {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'Helloooo! first listener'</span><span class="hl-3">);</span><br/><span class="hl-3">});</span><br/><span class="hl-8">// Second listener</span><br/><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">, </span><span class="hl-0">function</span><span class="hl-3"> </span><span class="hl-5">secondListener</span><span class="hl-3">(</span><span class="hl-4">arg1</span><span class="hl-3">, </span><span class="hl-4">arg2</span><span class="hl-3">) {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">`event with parameters </span><span class="hl-0">${</span><span class="hl-4">arg1</span><span class="hl-0">}</span><span class="hl-1">, </span><span class="hl-0">${</span><span class="hl-4">arg2</span><span class="hl-0">}</span><span class="hl-1"> in second listener`</span><span class="hl-3">);</span><br/><span class="hl-3">});</span><br/><span class="hl-8">// Third listener</span><br/><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">, </span><span class="hl-0">function</span><span class="hl-3"> </span><span class="hl-5">thirdListener</span><span class="hl-3">(...</span><span class="hl-4">args</span><span class="hl-3">) {</span><br/><span class="hl-3"> </span><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">parameters</span><span class="hl-3"> = </span><span class="hl-4">args</span><span class="hl-3">.</span><span class="hl-5">join</span><span class="hl-3">(</span><span class="hl-1">', '</span><span class="hl-3">);</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">`event with parameters </span><span class="hl-0">${</span><span class="hl-4">parameters</span><span class="hl-0">}</span><span class="hl-1"> in third listener`</span><span class="hl-3">);</span><br/><span class="hl-3">});</span><br/><br/><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">listeners</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">));</span><br/><br/><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">, </span><span class="hl-2">1</span><span class="hl-3">, </span><span class="hl-2">2</span><span class="hl-3">, </span><span class="hl-2">3</span><span class="hl-3">, </span><span class="hl-2">4</span><span class="hl-3">, </span><span class="hl-2">5</span><span class="hl-3">);</span><br/><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// [</span><br/><span class="hl-8">// [Function: firstListener],</span><br/><span class="hl-8">// [Function: secondListener],</span><br/><span class="hl-8">// [Function: thirdListener]</span><br/><span class="hl-8">// ]</span><br/><span class="hl-8">// Helloooo! first listener</span><br/><span class="hl-8">// event with parameters 1, 2 in second listener</span><br/><span class="hl-8">// event with parameters 1, 2, 3, 4, 5 in third listener</span>
|
|
374
406
|
</code><button>Copy</button></pre>
|
|
375
407
|
|
|
376
408
|
<h3>Since</h3><p>v0.1.26</p>
|
|
@@ -385,7 +417,7 @@ to each.</p>
|
|
|
385
417
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><aside class="tsd-sources">
|
|
386
418
|
<p>Inherited from EventEmitter.emit</p>
|
|
387
419
|
<ul>
|
|
388
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
420
|
+
<li>Defined in node_modules/@types/node/events.d.ts:652</li></ul></aside></li></ul></section>
|
|
389
421
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="eventNames" class="tsd-anchor"></a>
|
|
390
422
|
<h3 class="tsd-anchor-link"><span>event<wbr/>Names</span><a href="#eventNames" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
391
423
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -393,7 +425,7 @@ to each.</p>
|
|
|
393
425
|
<li class="tsd-description">
|
|
394
426
|
<div class="tsd-comment tsd-typography"><p>Returns an array listing the events for which the emitter has registered
|
|
395
427
|
listeners. The values in the array are strings or <code>Symbol</code>s.</p>
|
|
396
|
-
<pre><code class="language-js"><span class="hl-
|
|
428
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">myEE</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><span class="hl-4">myEE</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> {});</span><br/><span class="hl-4">myEE</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'bar'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> {});</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">sym</span><span class="hl-3"> = </span><span class="hl-5">Symbol</span><span class="hl-3">(</span><span class="hl-1">'symbol'</span><span class="hl-3">);</span><br/><span class="hl-4">myEE</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-4">sym</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> {});</span><br/><br/><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-4">myEE</span><span class="hl-3">.</span><span class="hl-5">eventNames</span><span class="hl-3">());</span><br/><span class="hl-8">// Prints: [ 'foo', 'bar', Symbol(symbol) ]</span>
|
|
397
429
|
</code><button>Copy</button></pre>
|
|
398
430
|
|
|
399
431
|
<h3>Since</h3><p>v6.0.0</p>
|
|
@@ -401,7 +433,7 @@ listeners. The values in the array are strings or <code>Symbol</code>s.</p>
|
|
|
401
433
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">(</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
402
434
|
<p>Inherited from EventEmitter.eventNames</p>
|
|
403
435
|
<ul>
|
|
404
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
436
|
+
<li>Defined in node_modules/@types/node/events.d.ts:715</li></ul></aside></li></ul></section>
|
|
405
437
|
<section class="tsd-panel tsd-member"><a id="getCmdLineArgs" class="tsd-anchor"></a>
|
|
406
438
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Cmd<wbr/>Line<wbr/>Args</span><a href="#getCmdLineArgs" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
407
439
|
<ul class="tsd-signatures">
|
|
@@ -411,7 +443,7 @@ listeners. The values in the array are strings or <code>Symbol</code>s.</p>
|
|
|
411
443
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span></h4><p>command line arguments</p>
|
|
412
444
|
<aside class="tsd-sources">
|
|
413
445
|
<ul>
|
|
414
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
446
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L415">src/Application.ts:415</a></li></ul></aside></li></ul></section>
|
|
415
447
|
<section class="tsd-panel tsd-member"><a id="getConfig" class="tsd-anchor"></a>
|
|
416
448
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Config</span><a href="#getConfig" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
417
449
|
<ul class="tsd-signatures">
|
|
@@ -421,7 +453,7 @@ listeners. The values in the array are strings or <code>Symbol</code>s.</p>
|
|
|
421
453
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span></h4><p>the config object.</p>
|
|
422
454
|
<aside class="tsd-sources">
|
|
423
455
|
<ul>
|
|
424
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
456
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L372">src/Application.ts:372</a></li></ul></aside></li></ul></section>
|
|
425
457
|
<section class="tsd-panel tsd-member"><a id="getDB" class="tsd-anchor"></a>
|
|
426
458
|
<h3 class="tsd-anchor-link"><span>getDB</span><a href="#getDB" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
427
459
|
<ul class="tsd-signatures">
|
|
@@ -431,7 +463,7 @@ listeners. The values in the array are strings or <code>Symbol</code>s.</p>
|
|
|
431
463
|
<h4 class="tsd-returns-title">Returns <a href="Database.html" class="tsd-signature-type tsd-kind-class">Database</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><p>the database pool. This will need to be casted based on your preferred database dialect.</p>
|
|
432
464
|
<aside class="tsd-sources">
|
|
433
465
|
<ul>
|
|
434
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
466
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L408">src/Application.ts:408</a></li></ul></aside></li></ul></section>
|
|
435
467
|
<section class="tsd-panel tsd-member"><a id="getLogger" class="tsd-anchor"></a>
|
|
436
468
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Logger</span><a href="#getLogger" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
437
469
|
<ul class="tsd-signatures">
|
|
@@ -439,7 +471,7 @@ listeners. The values in the array are strings or <code>Symbol</code>s.</p>
|
|
|
439
471
|
<li class="tsd-description">
|
|
440
472
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Logger</span></h4><aside class="tsd-sources">
|
|
441
473
|
<ul>
|
|
442
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
474
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L229">src/Application.ts:229</a></li></ul></aside></li></ul></section>
|
|
443
475
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getMaxListeners" class="tsd-anchor"></a>
|
|
444
476
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Max<wbr/>Listeners</span><a href="#getMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
445
477
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -453,7 +485,7 @@ set by <code>emitter.setMaxListeners(n)</code> or defaults to <a href="Applicati
|
|
|
453
485
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><aside class="tsd-sources">
|
|
454
486
|
<p>Inherited from EventEmitter.getMaxListeners</p>
|
|
455
487
|
<ul>
|
|
456
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
488
|
+
<li>Defined in node_modules/@types/node/events.d.ts:567</li></ul></aside></li></ul></section>
|
|
457
489
|
<section class="tsd-panel tsd-member"><a id="getName" class="tsd-anchor"></a>
|
|
458
490
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Name</span><a href="#getName" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
459
491
|
<ul class="tsd-signatures">
|
|
@@ -463,7 +495,7 @@ set by <code>emitter.setMaxListeners(n)</code> or defaults to <a href="Applicati
|
|
|
463
495
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><p>the application name</p>
|
|
464
496
|
<aside class="tsd-sources">
|
|
465
497
|
<ul>
|
|
466
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
498
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L361">src/Application.ts:361</a></li></ul></aside></li></ul></section>
|
|
467
499
|
<section class="tsd-panel tsd-member"><a id="getPort" class="tsd-anchor"></a>
|
|
468
500
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Port</span><a href="#getPort" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
469
501
|
<ul class="tsd-signatures">
|
|
@@ -471,7 +503,7 @@ set by <code>emitter.setMaxListeners(n)</code> or defaults to <a href="Applicati
|
|
|
471
503
|
<li class="tsd-description">
|
|
472
504
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><aside class="tsd-sources">
|
|
473
505
|
<ul>
|
|
474
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
506
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L233">src/Application.ts:233</a></li></ul></aside></li></ul></section>
|
|
475
507
|
<section class="tsd-panel tsd-member"><a id="getProgram" class="tsd-anchor"></a>
|
|
476
508
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Program</span><a href="#getProgram" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
477
509
|
<ul class="tsd-signatures">
|
|
@@ -479,7 +511,7 @@ set by <code>emitter.setMaxListeners(n)</code> or defaults to <a href="Applicati
|
|
|
479
511
|
<li class="tsd-description">
|
|
480
512
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Command</span></h4><aside class="tsd-sources">
|
|
481
513
|
<ul>
|
|
482
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
514
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L264">src/Application.ts:264</a></li></ul></aside></li></ul></section>
|
|
483
515
|
<section class="tsd-panel tsd-member"><a id="getRequestSizeLimit" class="tsd-anchor"></a>
|
|
484
516
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Request<wbr/>Size<wbr/>Limit</span><a href="#getRequestSizeLimit" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
485
517
|
<ul class="tsd-signatures">
|
|
@@ -489,7 +521,7 @@ set by <code>emitter.setMaxListeners(n)</code> or defaults to <a href="Applicati
|
|
|
489
521
|
</div>
|
|
490
522
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><aside class="tsd-sources">
|
|
491
523
|
<ul>
|
|
492
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
524
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L271">src/Application.ts:271</a></li></ul></aside></li></ul></section>
|
|
493
525
|
<section class="tsd-panel tsd-member"><a id="getTokenManager" class="tsd-anchor"></a>
|
|
494
526
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Token<wbr/>Manager</span><a href="#getTokenManager" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
495
527
|
<ul class="tsd-signatures">
|
|
@@ -499,15 +531,15 @@ set by <code>emitter.setMaxListeners(n)</code> or defaults to <a href="Applicati
|
|
|
499
531
|
<h4 class="tsd-returns-title">Returns <a href="TokenManager.html" class="tsd-signature-type tsd-kind-class">TokenManager</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">></span></h4><p>the token manager</p>
|
|
500
532
|
<aside class="tsd-sources">
|
|
501
533
|
<ul>
|
|
502
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
534
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L401">src/Application.ts:401</a></li></ul></aside></li></ul></section>
|
|
503
535
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listenerCount" class="tsd-anchor"></a>
|
|
504
536
|
<h3 class="tsd-anchor-link"><span>listener<wbr/>Count</span><a href="#listenerCount" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
505
537
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
506
538
|
<li class="tsd-signature tsd-anchor-link" id="listenerCount.listenerCount-1"><span class="tsd-kind-call-signature">listener<wbr/>Count</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#listenerCount.listenerCount-1" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
|
507
539
|
<li class="tsd-description">
|
|
508
|
-
<div class="tsd-comment tsd-typography"><p>Returns the number of listeners listening
|
|
509
|
-
|
|
510
|
-
|
|
540
|
+
<div class="tsd-comment tsd-typography"><p>Returns the number of listeners listening for the event named <code>eventName</code>.
|
|
541
|
+
If <code>listener</code> is provided, it will return how many times the listener is found
|
|
542
|
+
in the list of the listeners of the event.</p>
|
|
511
543
|
|
|
512
544
|
<h3>Since</h3><p>v3.2.0</p>
|
|
513
545
|
</div>
|
|
@@ -525,14 +557,14 @@ is found in the list of the listeners of the event.</p>
|
|
|
525
557
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><aside class="tsd-sources">
|
|
526
558
|
<p>Inherited from EventEmitter.listenerCount</p>
|
|
527
559
|
<ul>
|
|
528
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
560
|
+
<li>Defined in node_modules/@types/node/events.d.ts:661</li></ul></aside></li></ul></section>
|
|
529
561
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listeners" class="tsd-anchor"></a>
|
|
530
562
|
<h3 class="tsd-anchor-link"><span>listeners</span><a href="#listeners" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
531
563
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
532
564
|
<li class="tsd-signature tsd-anchor-link" id="listeners.listeners-1"><span class="tsd-kind-call-signature">listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span><a href="#listeners.listeners-1" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
|
533
565
|
<li class="tsd-description">
|
|
534
566
|
<div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p>
|
|
535
|
-
<pre><code class="language-js"><span class="hl-4">server</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'connection'</span><span class="hl-3">, (</span><span class="hl-4">stream</span><span class="hl-3">) </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'someone connected!'</span><span class="hl-3">);</span><br/><span class="hl-3">});</span><br/><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-4">util</span><span class="hl-3">.</span><span class="hl-5">inspect</span><span class="hl-3">(</span><span class="hl-4">server</span><span class="hl-3">.</span><span class="hl-5">listeners</span><span class="hl-3">(</span><span class="hl-1">'connection'</span><span class="hl-3">)));</span><br/><span class="hl-
|
|
567
|
+
<pre><code class="language-js"><span class="hl-4">server</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'connection'</span><span class="hl-3">, (</span><span class="hl-4">stream</span><span class="hl-3">) </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'someone connected!'</span><span class="hl-3">);</span><br/><span class="hl-3">});</span><br/><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-4">util</span><span class="hl-3">.</span><span class="hl-5">inspect</span><span class="hl-3">(</span><span class="hl-4">server</span><span class="hl-3">.</span><span class="hl-5">listeners</span><span class="hl-3">(</span><span class="hl-1">'connection'</span><span class="hl-3">)));</span><br/><span class="hl-8">// Prints: [ [Function] ]</span>
|
|
536
568
|
</code><button>Copy</button></pre>
|
|
537
569
|
|
|
538
570
|
<h3>Since</h3><p>v0.1.26</p>
|
|
@@ -545,7 +577,7 @@ is found in the list of the listeners of the event.</p>
|
|
|
545
577
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
546
578
|
<p>Inherited from EventEmitter.listeners</p>
|
|
547
579
|
<ul>
|
|
548
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
580
|
+
<li>Defined in node_modules/@types/node/events.d.ts:580</li></ul></aside></li></ul></section>
|
|
549
581
|
<section class="tsd-panel tsd-member"><a id="loadConfig" class="tsd-anchor"></a>
|
|
550
582
|
<h3 class="tsd-anchor-link"><span>load<wbr/>Config</span><a href="#loadConfig" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
551
583
|
<ul class="tsd-signatures">
|
|
@@ -560,7 +592,7 @@ is found in the list of the listeners of the event.</p>
|
|
|
560
592
|
</div></li></ul></div>
|
|
561
593
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
562
594
|
<ul>
|
|
563
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
595
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L341">src/Application.ts:341</a></li></ul></aside></li></ul></section>
|
|
564
596
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="off" class="tsd-anchor"></a>
|
|
565
597
|
<h3 class="tsd-anchor-link"><span>off</span><a href="#off" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
566
598
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -591,7 +623,7 @@ is found in the list of the listeners of the event.</p>
|
|
|
591
623
|
<h4 class="tsd-returns-title">Returns <a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
592
624
|
<p>Inherited from EventEmitter.off</p>
|
|
593
625
|
<ul>
|
|
594
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
626
|
+
<li>Defined in node_modules/@types/node/events.d.ts:540</li></ul></aside></li></ul></section>
|
|
595
627
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="on" class="tsd-anchor"></a>
|
|
596
628
|
<h3 class="tsd-anchor-link"><span>on</span><a href="#on" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
597
629
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -606,7 +638,7 @@ times.</p>
|
|
|
606
638
|
<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
|
|
607
639
|
<p>By default, event listeners are invoked in the order they are added. The<code>emitter.prependListener()</code> method can be used as an alternative to add the
|
|
608
640
|
event listener to the beginning of the listeners array.</p>
|
|
609
|
-
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-
|
|
641
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">myEE</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><span class="hl-4">myEE</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'a'</span><span class="hl-3">));</span><br/><span class="hl-4">myEE</span><span class="hl-3">.</span><span class="hl-5">prependListener</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'b'</span><span class="hl-3">));</span><br/><span class="hl-4">myEE</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// b</span><br/><span class="hl-8">// a</span>
|
|
610
642
|
</code><button>Copy</button></pre>
|
|
611
643
|
|
|
612
644
|
<h3>Since</h3><p>v0.1.101</p>
|
|
@@ -636,7 +668,7 @@ event listener to the beginning of the listeners array.</p>
|
|
|
636
668
|
<h4 class="tsd-returns-title">Returns <a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
637
669
|
<p>Inherited from EventEmitter.on</p>
|
|
638
670
|
<ul>
|
|
639
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
671
|
+
<li>Defined in node_modules/@types/node/events.d.ts:422</li></ul></aside></li></ul></section>
|
|
640
672
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="once" class="tsd-anchor"></a>
|
|
641
673
|
<h3 class="tsd-anchor-link"><span>once</span><a href="#once" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
642
674
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -649,7 +681,7 @@ next time <code>eventName</code> is triggered, this listener is removed and then
|
|
|
649
681
|
<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
|
|
650
682
|
<p>By default, event listeners are invoked in the order they are added. The<code>emitter.prependOnceListener()</code> method can be used as an alternative to add the
|
|
651
683
|
event listener to the beginning of the listeners array.</p>
|
|
652
|
-
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-
|
|
684
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">myEE</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><span class="hl-4">myEE</span><span class="hl-3">.</span><span class="hl-5">once</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'a'</span><span class="hl-3">));</span><br/><span class="hl-4">myEE</span><span class="hl-3">.</span><span class="hl-5">prependOnceListener</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'b'</span><span class="hl-3">));</span><br/><span class="hl-4">myEE</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// b</span><br/><span class="hl-8">// a</span>
|
|
653
685
|
</code><button>Copy</button></pre>
|
|
654
686
|
|
|
655
687
|
<h3>Since</h3><p>v0.3.0</p>
|
|
@@ -679,7 +711,7 @@ event listener to the beginning of the listeners array.</p>
|
|
|
679
711
|
<h4 class="tsd-returns-title">Returns <a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
680
712
|
<p>Inherited from EventEmitter.once</p>
|
|
681
713
|
<ul>
|
|
682
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
714
|
+
<li>Defined in node_modules/@types/node/events.d.ts:452</li></ul></aside></li></ul></section>
|
|
683
715
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="prependListener" class="tsd-anchor"></a>
|
|
684
716
|
<h3 class="tsd-anchor-link"><span>prepend<wbr/>Listener</span><a href="#prependListener" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
685
717
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -720,7 +752,7 @@ times.</p>
|
|
|
720
752
|
<h4 class="tsd-returns-title">Returns <a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
721
753
|
<p>Inherited from EventEmitter.prependListener</p>
|
|
722
754
|
<ul>
|
|
723
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
755
|
+
<li>Defined in node_modules/@types/node/events.d.ts:679</li></ul></aside></li></ul></section>
|
|
724
756
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="prependOnceListener" class="tsd-anchor"></a>
|
|
725
757
|
<h3 class="tsd-anchor-link"><span>prepend<wbr/>Once<wbr/>Listener</span><a href="#prependOnceListener" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
726
758
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -759,7 +791,7 @@ listener is removed, and then invoked.</p>
|
|
|
759
791
|
<h4 class="tsd-returns-title">Returns <a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
760
792
|
<p>Inherited from EventEmitter.prependOnceListener</p>
|
|
761
793
|
<ul>
|
|
762
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
794
|
+
<li>Defined in node_modules/@types/node/events.d.ts:695</li></ul></aside></li></ul></section>
|
|
763
795
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="rawListeners" class="tsd-anchor"></a>
|
|
764
796
|
<h3 class="tsd-anchor-link"><span>raw<wbr/>Listeners</span><a href="#rawListeners" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
765
797
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -767,7 +799,7 @@ listener is removed, and then invoked.</p>
|
|
|
767
799
|
<li class="tsd-description">
|
|
768
800
|
<div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>,
|
|
769
801
|
including any wrappers (such as those created by <code>.once()</code>).</p>
|
|
770
|
-
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-
|
|
802
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">emitter</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><span class="hl-4">emitter</span><span class="hl-3">.</span><span class="hl-5">once</span><span class="hl-3">(</span><span class="hl-1">'log'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'log once'</span><span class="hl-3">));</span><br/><br/><span class="hl-8">// Returns a new Array with a function `onceWrapper` which has a property</span><br/><span class="hl-8">// `listener` which contains the original listener bound above</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">listeners</span><span class="hl-3"> = </span><span class="hl-4">emitter</span><span class="hl-3">.</span><span class="hl-5">rawListeners</span><span class="hl-3">(</span><span class="hl-1">'log'</span><span class="hl-3">);</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">logFnWrapper</span><span class="hl-3"> = </span><span class="hl-4">listeners</span><span class="hl-3">[</span><span class="hl-2">0</span><span class="hl-3">];</span><br/><br/><span class="hl-8">// Logs "log once" to the console and does not unbind the `once` event</span><br/><span class="hl-4">logFnWrapper</span><span class="hl-3">.</span><span class="hl-5">listener</span><span class="hl-3">();</span><br/><br/><span class="hl-8">// Logs "log once" to the console and removes the listener</span><br/><span class="hl-5">logFnWrapper</span><span class="hl-3">();</span><br/><br/><span class="hl-4">emitter</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'log'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'log persistently'</span><span class="hl-3">));</span><br/><span class="hl-8">// Will return a new Array with a single function bound by `.on()` above</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">newListeners</span><span class="hl-3"> = </span><span class="hl-4">emitter</span><span class="hl-3">.</span><span class="hl-5">rawListeners</span><span class="hl-3">(</span><span class="hl-1">'log'</span><span class="hl-3">);</span><br/><br/><span class="hl-8">// Logs "log persistently" twice</span><br/><span class="hl-4">newListeners</span><span class="hl-3">[</span><span class="hl-2">0</span><span class="hl-3">]();</span><br/><span class="hl-4">emitter</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'log'</span><span class="hl-3">);</span>
|
|
771
803
|
</code><button>Copy</button></pre>
|
|
772
804
|
|
|
773
805
|
<h3>Since</h3><p>v9.4.0</p>
|
|
@@ -780,7 +812,7 @@ including any wrappers (such as those created by <code>.once()</code>).</p>
|
|
|
780
812
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
781
813
|
<p>Inherited from EventEmitter.rawListeners</p>
|
|
782
814
|
<ul>
|
|
783
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
815
|
+
<li>Defined in node_modules/@types/node/events.d.ts:611</li></ul></aside></li></ul></section>
|
|
784
816
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="removeAllListeners" class="tsd-anchor"></a>
|
|
785
817
|
<h3 class="tsd-anchor-link"><span>remove<wbr/>All<wbr/>Listeners</span><a href="#removeAllListeners" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
786
818
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -802,14 +834,14 @@ component or module (e.g. sockets or file streams).</p>
|
|
|
802
834
|
<h4 class="tsd-returns-title">Returns <a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
803
835
|
<p>Inherited from EventEmitter.removeAllListeners</p>
|
|
804
836
|
<ul>
|
|
805
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
837
|
+
<li>Defined in node_modules/@types/node/events.d.ts:551</li></ul></aside></li></ul></section>
|
|
806
838
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="removeListener" class="tsd-anchor"></a>
|
|
807
839
|
<h3 class="tsd-anchor-link"><span>remove<wbr/>Listener</span><a href="#removeListener" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
808
840
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
809
841
|
<li class="tsd-signature tsd-anchor-link" id="removeListener.removeListener-1"><span class="tsd-kind-call-signature">remove<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span><a href="#removeListener.removeListener-1" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
|
810
842
|
<li class="tsd-description">
|
|
811
843
|
<div class="tsd-comment tsd-typography"><p>Removes the specified <code>listener</code> from the listener array for the event named<code>eventName</code>.</p>
|
|
812
|
-
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-5">callback</span><span class="hl-3"> = (</span><span class="hl-4">stream</span><span class="hl-3">) </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'someone connected!'</span><span class="hl-3">);</span><br/><span class="hl-3">};</span><br/><span class="hl-4">server</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'connection'</span><span class="hl-3">, </span><span class="hl-4">callback</span><span class="hl-3">);</span><br/><span class="hl-
|
|
844
|
+
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-5">callback</span><span class="hl-3"> = (</span><span class="hl-4">stream</span><span class="hl-3">) </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'someone connected!'</span><span class="hl-3">);</span><br/><span class="hl-3">};</span><br/><span class="hl-4">server</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'connection'</span><span class="hl-3">, </span><span class="hl-4">callback</span><span class="hl-3">);</span><br/><span class="hl-8">// ...</span><br/><span class="hl-4">server</span><span class="hl-3">.</span><span class="hl-5">removeListener</span><span class="hl-3">(</span><span class="hl-1">'connection'</span><span class="hl-3">, </span><span class="hl-4">callback</span><span class="hl-3">);</span>
|
|
813
845
|
</code><button>Copy</button></pre>
|
|
814
846
|
<p><code>removeListener()</code> will remove, at most, one instance of a listener from the
|
|
815
847
|
listener array. If any single listener has been added multiple times to the
|
|
@@ -818,7 +850,7 @@ called multiple times to remove each instance.</p>
|
|
|
818
850
|
<p>Once an event is emitted, all listeners attached to it at the
|
|
819
851
|
time of emitting are called in order. This implies that any<code>removeListener()</code> or <code>removeAllListeners()</code> calls <em>after</em> emitting and <em>before</em> the last listener finishes execution
|
|
820
852
|
will not remove them from<code>emit()</code> in progress. Subsequent events behave as expected.</p>
|
|
821
|
-
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-
|
|
853
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><span class="hl-0">class</span><span class="hl-3"> </span><span class="hl-9">MyEmitter</span><span class="hl-3"> </span><span class="hl-0">extends</span><span class="hl-3"> </span><span class="hl-9">EventEmitter</span><span class="hl-3"> {}</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">myEmitter</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">MyEmitter</span><span class="hl-3">();</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-5">callbackA</span><span class="hl-3"> = () </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'A'</span><span class="hl-3">);</span><br/><span class="hl-3"> </span><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">removeListener</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">, </span><span class="hl-4">callbackB</span><span class="hl-3">);</span><br/><span class="hl-3">};</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-5">callbackB</span><span class="hl-3"> = () </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'B'</span><span class="hl-3">);</span><br/><span class="hl-3">};</span><br/><br/><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">, </span><span class="hl-4">callbackA</span><span class="hl-3">);</span><br/><br/><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">, </span><span class="hl-4">callbackB</span><span class="hl-3">);</span><br/><br/><span class="hl-8">// callbackA removes listener callbackB but it will still be called.</span><br/><span class="hl-8">// Internal listener array at time of emit [callbackA, callbackB]</span><br/><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// A</span><br/><span class="hl-8">// B</span><br/><br/><span class="hl-8">// callbackB is now removed.</span><br/><span class="hl-8">// Internal listener array [callbackA]</span><br/><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// A</span>
|
|
822
854
|
</code><button>Copy</button></pre>
|
|
823
855
|
<p>Because listeners are managed using an internal array, calling this will
|
|
824
856
|
change the position indices of any listener registered <em>after</em> the listener
|
|
@@ -828,7 +860,7 @@ the <code>emitter.listeners()</code> method will need to be recreated.</p>
|
|
|
828
860
|
<p>When a single function has been added as a handler multiple times for a single
|
|
829
861
|
event (as in the example below), <code>removeListener()</code> will remove the most
|
|
830
862
|
recently added instance. In the example the <code>once('ping')</code>listener is removed:</p>
|
|
831
|
-
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-
|
|
863
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">ee</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><br/><span class="hl-0">function</span><span class="hl-3"> </span><span class="hl-5">pong</span><span class="hl-3">() {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'pong'</span><span class="hl-3">);</span><br/><span class="hl-3">}</span><br/><br/><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'ping'</span><span class="hl-3">, </span><span class="hl-4">pong</span><span class="hl-3">);</span><br/><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">once</span><span class="hl-3">(</span><span class="hl-1">'ping'</span><span class="hl-3">, </span><span class="hl-4">pong</span><span class="hl-3">);</span><br/><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">removeListener</span><span class="hl-3">(</span><span class="hl-1">'ping'</span><span class="hl-3">, </span><span class="hl-4">pong</span><span class="hl-3">);</span><br/><br/><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'ping'</span><span class="hl-3">);</span><br/><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'ping'</span><span class="hl-3">);</span>
|
|
832
864
|
</code><button>Copy</button></pre>
|
|
833
865
|
<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
|
|
834
866
|
|
|
@@ -855,7 +887,7 @@ recently added instance. In the example the <code>once('ping')</code>lis
|
|
|
855
887
|
<h4 class="tsd-returns-title">Returns <a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
856
888
|
<p>Inherited from EventEmitter.removeListener</p>
|
|
857
889
|
<ul>
|
|
858
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
890
|
+
<li>Defined in node_modules/@types/node/events.d.ts:535</li></ul></aside></li></ul></section>
|
|
859
891
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="setMaxListeners" class="tsd-anchor"></a>
|
|
860
892
|
<h3 class="tsd-anchor-link"><span>set<wbr/>Max<wbr/>Listeners</span><a href="#setMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
861
893
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -877,7 +909,7 @@ modified for this specific <code>EventEmitter</code> instance. The value can be
|
|
|
877
909
|
<h4 class="tsd-returns-title">Returns <a href="Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConfig</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type tsd-kind-type-parameter">TDBConnectionAPI</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
878
910
|
<p>Inherited from EventEmitter.setMaxListeners</p>
|
|
879
911
|
<ul>
|
|
880
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
912
|
+
<li>Defined in node_modules/@types/node/events.d.ts:561</li></ul></aside></li></ul></section>
|
|
881
913
|
<section class="tsd-panel tsd-member"><a id="setTokenManager" class="tsd-anchor"></a>
|
|
882
914
|
<h3 class="tsd-anchor-link"><span>set<wbr/>Token<wbr/>Manager</span><a href="#setTokenManager" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
883
915
|
<ul class="tsd-signatures">
|
|
@@ -892,7 +924,7 @@ modified for this specific <code>EventEmitter</code> instance. The value can be
|
|
|
892
924
|
<h5><span class="tsd-kind-parameter">tokenManager</span>: <a href="TokenManager.html" class="tsd-signature-type tsd-kind-class">TokenManager</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">TAuthToken</span><span class="tsd-signature-symbol">></span></h5></li></ul></div>
|
|
893
925
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
|
|
894
926
|
<ul>
|
|
895
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
927
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L394">src/Application.ts:394</a></li></ul></aside></li></ul></section>
|
|
896
928
|
<section class="tsd-panel tsd-member"><a id="shouldListen" class="tsd-anchor"></a>
|
|
897
929
|
<h3 class="tsd-anchor-link"><span>should<wbr/>Listen</span><a href="#shouldListen" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
898
930
|
<ul class="tsd-signatures">
|
|
@@ -902,7 +934,15 @@ modified for this specific <code>EventEmitter</code> instance. The value can be
|
|
|
902
934
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>true if the Application should bind to an IP address</p>
|
|
903
935
|
<aside class="tsd-sources">
|
|
904
936
|
<ul>
|
|
905
|
-
<li>Defined in <a href="https://github.com/breautek/storm/blob/
|
|
937
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L379">src/Application.ts:379</a></li></ul></aside></li></ul></section>
|
|
938
|
+
<section class="tsd-panel tsd-member"><a id="start" class="tsd-anchor"></a>
|
|
939
|
+
<h3 class="tsd-anchor-link"><span>start</span><a href="#start" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
940
|
+
<ul class="tsd-signatures">
|
|
941
|
+
<li class="tsd-signature tsd-anchor-link" id="start.start-1"><span class="tsd-kind-call-signature">start</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#start.start-1" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
|
942
|
+
<li class="tsd-description">
|
|
943
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources">
|
|
944
|
+
<ul>
|
|
945
|
+
<li>Defined in <a href="https://github.com/breautek/storm/blob/78cd5a3/src/Application.ts#L85">src/Application.ts:85</a></li></ul></aside></li></ul></section>
|
|
906
946
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getEventListeners" class="tsd-anchor"></a>
|
|
907
947
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>get<wbr/>Event<wbr/>Listeners</span><a href="#getEventListeners" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
908
948
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -913,7 +953,7 @@ modified for this specific <code>EventEmitter</code> instance. The value can be
|
|
|
913
953
|
the emitter.</p>
|
|
914
954
|
<p>For <code>EventTarget</code>s this is the only way to get the event listeners for the
|
|
915
955
|
event target. This is useful for debugging and diagnostic purposes.</p>
|
|
916
|
-
<pre><code class="language-js"><span class="hl-
|
|
956
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">getEventListeners</span><span class="hl-3">, </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><br/><span class="hl-3">{</span><br/><span class="hl-3"> </span><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">ee</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><span class="hl-3"> </span><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-5">listener</span><span class="hl-3"> = () </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'Events are fun'</span><span class="hl-3">);</span><br/><span class="hl-3"> </span><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, </span><span class="hl-4">listener</span><span class="hl-3">);</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-5">getEventListeners</span><span class="hl-3">(</span><span class="hl-4">ee</span><span class="hl-3">, </span><span class="hl-1">'foo'</span><span class="hl-3">)); </span><span class="hl-8">// [ [Function: listener] ]</span><br/><span class="hl-3">}</span><br/><span class="hl-3">{</span><br/><span class="hl-3"> </span><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">et</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventTarget</span><span class="hl-3">();</span><br/><span class="hl-3"> </span><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-5">listener</span><span class="hl-3"> = () </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'Events are fun'</span><span class="hl-3">);</span><br/><span class="hl-3"> </span><span class="hl-4">et</span><span class="hl-3">.</span><span class="hl-5">addEventListener</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, </span><span class="hl-4">listener</span><span class="hl-3">);</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-5">getEventListeners</span><span class="hl-3">(</span><span class="hl-4">et</span><span class="hl-3">, </span><span class="hl-1">'foo'</span><span class="hl-3">)); </span><span class="hl-8">// [ [Function: listener] ]</span><br/><span class="hl-3">}</span>
|
|
917
957
|
</code><button>Copy</button></pre>
|
|
918
958
|
|
|
919
959
|
<h3>Since</h3><p>v15.2.0, v14.17.0</p>
|
|
@@ -928,14 +968,14 @@ event target. This is useful for debugging and diagnostic purposes.</p>
|
|
|
928
968
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
|
|
929
969
|
<p>Inherited from EventEmitter.getEventListeners</p>
|
|
930
970
|
<ul>
|
|
931
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
971
|
+
<li>Defined in node_modules/@types/node/events.d.ts:296</li></ul></aside></li></ul></section>
|
|
932
972
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listenerCount-2" class="tsd-anchor"></a>
|
|
933
973
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>listener<wbr/>Count</span><a href="#listenerCount-2" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
934
974
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
935
975
|
<li class="tsd-signature tsd-anchor-link" id="listenerCount-2.listenerCount-3"><span class="tsd-kind-call-signature">listener<wbr/>Count</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#listenerCount-2.listenerCount-3" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
|
936
976
|
<li class="tsd-description">
|
|
937
977
|
<div class="tsd-comment tsd-typography"><p>A class method that returns the number of listeners for the given <code>eventName</code>registered on the given <code>emitter</code>.</p>
|
|
938
|
-
<pre><code class="language-js"><span class="hl-
|
|
978
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3">, </span><span class="hl-4">listenerCount</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">myEmitter</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> {});</span><br/><span class="hl-4">myEmitter</span><span class="hl-3">.</span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-1">'event'</span><span class="hl-3">, () </span><span class="hl-0">=></span><span class="hl-3"> {});</span><br/><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-5">listenerCount</span><span class="hl-3">(</span><span class="hl-4">myEmitter</span><span class="hl-3">, </span><span class="hl-1">'event'</span><span class="hl-3">));</span><br/><span class="hl-8">// Prints: 2</span>
|
|
939
979
|
</code><button>Copy</button></pre>
|
|
940
980
|
|
|
941
981
|
<h3>Since</h3><p>v0.9.12</p>
|
|
@@ -956,20 +996,20 @@ event target. This is useful for debugging and diagnostic purposes.</p>
|
|
|
956
996
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><aside class="tsd-sources">
|
|
957
997
|
<p>Inherited from EventEmitter.listenerCount</p>
|
|
958
998
|
<ul>
|
|
959
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
999
|
+
<li>Defined in node_modules/@types/node/events.d.ts:268</li></ul></aside></li></ul></section>
|
|
960
1000
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="on-2" class="tsd-anchor"></a>
|
|
961
1001
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>on</span><a href="#on-2" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
962
1002
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
963
1003
|
<li class="tsd-signature tsd-anchor-link" id="on-2.on-3"><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">AsyncIterableIterator</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><a href="#on-2.on-3" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
|
964
1004
|
<li class="tsd-description">
|
|
965
|
-
<div class="tsd-comment tsd-typography"><pre><code class="language-js"><span class="hl-
|
|
1005
|
+
<div class="tsd-comment tsd-typography"><pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">on</span><span class="hl-3">, </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><span class="hl-6">import</span><span class="hl-3"> </span><span class="hl-4">process</span><span class="hl-3"> </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:process'</span><span class="hl-3">;</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">ee</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><br/><span class="hl-8">// Emit later on</span><br/><span class="hl-4">process</span><span class="hl-3">.</span><span class="hl-5">nextTick</span><span class="hl-3">(() </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, </span><span class="hl-1">'bar'</span><span class="hl-3">);</span><br/><span class="hl-3"> </span><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, </span><span class="hl-2">42</span><span class="hl-3">);</span><br/><span class="hl-3">});</span><br/><br/><span class="hl-6">for</span><span class="hl-3"> </span><span class="hl-6">await</span><span class="hl-3"> (</span><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">event</span><span class="hl-3"> </span><span class="hl-0">of</span><span class="hl-3"> </span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-4">ee</span><span class="hl-3">, </span><span class="hl-1">'foo'</span><span class="hl-3">)) {</span><br/><span class="hl-3"> </span><span class="hl-8">// The execution of this inner block is synchronous and it</span><br/><span class="hl-3"> </span><span class="hl-8">// processes one event at a time (even with await). Do not use</span><br/><span class="hl-3"> </span><span class="hl-8">// if concurrent execution is required.</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-4">event</span><span class="hl-3">); </span><span class="hl-8">// prints ['bar'] [42]</span><br/><span class="hl-3">}</span><br/><span class="hl-8">// Unreachable here</span>
|
|
966
1006
|
</code><button>Copy</button></pre>
|
|
967
1007
|
<p>Returns an <code>AsyncIterator</code> that iterates <code>eventName</code> events. It will throw
|
|
968
1008
|
if the <code>EventEmitter</code> emits <code>'error'</code>. It removes all listeners when
|
|
969
1009
|
exiting the loop. The <code>value</code> returned by each iteration is an array
|
|
970
1010
|
composed of the emitted event arguments.</p>
|
|
971
1011
|
<p>An <code>AbortSignal</code> can be used to cancel waiting on events:</p>
|
|
972
|
-
<pre><code class="language-js"><span class="hl-
|
|
1012
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">on</span><span class="hl-3">, </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><span class="hl-6">import</span><span class="hl-3"> </span><span class="hl-4">process</span><span class="hl-3"> </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:process'</span><span class="hl-3">;</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">ac</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">AbortController</span><span class="hl-3">();</span><br/><br/><span class="hl-3">(</span><span class="hl-0">async</span><span class="hl-3"> () </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">ee</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><br/><span class="hl-3"> </span><span class="hl-8">// Emit later on</span><br/><span class="hl-3"> </span><span class="hl-4">process</span><span class="hl-3">.</span><span class="hl-5">nextTick</span><span class="hl-3">(() </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, </span><span class="hl-1">'bar'</span><span class="hl-3">);</span><br/><span class="hl-3"> </span><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">, </span><span class="hl-2">42</span><span class="hl-3">);</span><br/><span class="hl-3"> });</span><br/><br/><span class="hl-3"> </span><span class="hl-6">for</span><span class="hl-3"> </span><span class="hl-6">await</span><span class="hl-3"> (</span><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">event</span><span class="hl-3"> </span><span class="hl-0">of</span><span class="hl-3"> </span><span class="hl-5">on</span><span class="hl-3">(</span><span class="hl-4">ee</span><span class="hl-3">, </span><span class="hl-1">'foo'</span><span class="hl-3">, { </span><span class="hl-4">signal:</span><span class="hl-3"> </span><span class="hl-4">ac</span><span class="hl-3">.</span><span class="hl-4">signal</span><span class="hl-3"> })) {</span><br/><span class="hl-3"> </span><span class="hl-8">// The execution of this inner block is synchronous and it</span><br/><span class="hl-3"> </span><span class="hl-8">// processes one event at a time (even with await). Do not use</span><br/><span class="hl-3"> </span><span class="hl-8">// if concurrent execution is required.</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-4">event</span><span class="hl-3">); </span><span class="hl-8">// prints ['bar'] [42]</span><br/><span class="hl-3"> }</span><br/><span class="hl-3"> </span><span class="hl-8">// Unreachable here</span><br/><span class="hl-3">})();</span><br/><br/><span class="hl-4">process</span><span class="hl-3">.</span><span class="hl-5">nextTick</span><span class="hl-3">(() </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">ac</span><span class="hl-3">.</span><span class="hl-5">abort</span><span class="hl-3">());</span>
|
|
973
1013
|
</code><button>Copy</button></pre>
|
|
974
1014
|
|
|
975
1015
|
<h3>Since</h3><p>v13.6.0, v12.16.0</p>
|
|
@@ -989,7 +1029,7 @@ composed of the emitted event arguments.</p>
|
|
|
989
1029
|
<aside class="tsd-sources">
|
|
990
1030
|
<p>Inherited from EventEmitter.on</p>
|
|
991
1031
|
<ul>
|
|
992
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
1032
|
+
<li>Defined in node_modules/@types/node/events.d.ts:250</li></ul></aside></li></ul></section>
|
|
993
1033
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="once-2" class="tsd-anchor"></a>
|
|
994
1034
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>once</span><a href="#once-2" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
995
1035
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
@@ -1001,15 +1041,15 @@ The <code>Promise</code> will resolve with an array of all the arguments emitted
|
|
|
1001
1041
|
given event.</p>
|
|
1002
1042
|
<p>This method is intentionally generic and works with the web platform <a href="https://dom.spec.whatwg.org/#interface-eventtarget">EventTarget</a> interface, which has no special<code>'error'</code> event
|
|
1003
1043
|
semantics and does not listen to the <code>'error'</code> event.</p>
|
|
1004
|
-
<pre><code class="language-js"><span class="hl-
|
|
1044
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">once</span><span class="hl-3">, </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><span class="hl-6">import</span><span class="hl-3"> </span><span class="hl-4">process</span><span class="hl-3"> </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:process'</span><span class="hl-3">;</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">ee</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><br/><span class="hl-4">process</span><span class="hl-3">.</span><span class="hl-5">nextTick</span><span class="hl-3">(() </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'myevent'</span><span class="hl-3">, </span><span class="hl-2">42</span><span class="hl-3">);</span><br/><span class="hl-3">});</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> [</span><span class="hl-7">value</span><span class="hl-3">] = </span><span class="hl-6">await</span><span class="hl-3"> </span><span class="hl-5">once</span><span class="hl-3">(</span><span class="hl-4">ee</span><span class="hl-3">, </span><span class="hl-1">'myevent'</span><span class="hl-3">);</span><br/><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-4">value</span><span class="hl-3">);</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">err</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">Error</span><span class="hl-3">(</span><span class="hl-1">'kaboom'</span><span class="hl-3">);</span><br/><span class="hl-4">process</span><span class="hl-3">.</span><span class="hl-5">nextTick</span><span class="hl-3">(() </span><span class="hl-0">=></span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'error'</span><span class="hl-3">, </span><span class="hl-4">err</span><span class="hl-3">);</span><br/><span class="hl-3">});</span><br/><br/><span class="hl-6">try</span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-6">await</span><span class="hl-3"> </span><span class="hl-5">once</span><span class="hl-3">(</span><span class="hl-4">ee</span><span class="hl-3">, </span><span class="hl-1">'myevent'</span><span class="hl-3">);</span><br/><span class="hl-3">} </span><span class="hl-6">catch</span><span class="hl-3"> (</span><span class="hl-4">err</span><span class="hl-3">) {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">error</span><span class="hl-3">(</span><span class="hl-1">'error happened'</span><span class="hl-3">, </span><span class="hl-4">err</span><span class="hl-3">);</span><br/><span class="hl-3">}</span>
|
|
1005
1045
|
</code><button>Copy</button></pre>
|
|
1006
1046
|
<p>The special handling of the <code>'error'</code> event is only used when <code>events.once()</code>is used to wait for another event. If <code>events.once()</code> is used to wait for the
|
|
1007
1047
|
'<code>error'</code> event itself, then it is treated as any other kind of event without
|
|
1008
1048
|
special handling:</p>
|
|
1009
|
-
<pre><code class="language-js"><span class="hl-
|
|
1049
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3">, </span><span class="hl-4">once</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">ee</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><br/><span class="hl-5">once</span><span class="hl-3">(</span><span class="hl-4">ee</span><span class="hl-3">, </span><span class="hl-1">'error'</span><span class="hl-3">)</span><br/><span class="hl-3"> .</span><span class="hl-5">then</span><span class="hl-3">(([</span><span class="hl-4">err</span><span class="hl-3">]) </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'ok'</span><span class="hl-3">, </span><span class="hl-4">err</span><span class="hl-3">.</span><span class="hl-4">message</span><span class="hl-3">))</span><br/><span class="hl-3"> .</span><span class="hl-5">catch</span><span class="hl-3">((</span><span class="hl-4">err</span><span class="hl-3">) </span><span class="hl-0">=></span><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">error</span><span class="hl-3">(</span><span class="hl-1">'error'</span><span class="hl-3">, </span><span class="hl-4">err</span><span class="hl-3">.</span><span class="hl-4">message</span><span class="hl-3">));</span><br/><br/><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'error'</span><span class="hl-3">, </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">Error</span><span class="hl-3">(</span><span class="hl-1">'boom'</span><span class="hl-3">));</span><br/><br/><span class="hl-8">// Prints: ok boom</span>
|
|
1010
1050
|
</code><button>Copy</button></pre>
|
|
1011
1051
|
<p>An <code>AbortSignal</code> can be used to cancel waiting for the event:</p>
|
|
1012
|
-
<pre><code class="language-js"><span class="hl-
|
|
1052
|
+
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">EventEmitter</span><span class="hl-3">, </span><span class="hl-4">once</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">ee</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">ac</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">AbortController</span><span class="hl-3">();</span><br/><br/><span class="hl-0">async</span><span class="hl-3"> </span><span class="hl-0">function</span><span class="hl-3"> </span><span class="hl-5">foo</span><span class="hl-3">(</span><span class="hl-4">emitter</span><span class="hl-3">, </span><span class="hl-4">event</span><span class="hl-3">, </span><span class="hl-4">signal</span><span class="hl-3">) {</span><br/><span class="hl-3"> </span><span class="hl-6">try</span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-6">await</span><span class="hl-3"> </span><span class="hl-5">once</span><span class="hl-3">(</span><span class="hl-4">emitter</span><span class="hl-3">, </span><span class="hl-4">event</span><span class="hl-3">, { </span><span class="hl-4">signal</span><span class="hl-3"> });</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">log</span><span class="hl-3">(</span><span class="hl-1">'event emitted!'</span><span class="hl-3">);</span><br/><span class="hl-3"> } </span><span class="hl-6">catch</span><span class="hl-3"> (</span><span class="hl-4">error</span><span class="hl-3">) {</span><br/><span class="hl-3"> </span><span class="hl-6">if</span><span class="hl-3"> (</span><span class="hl-4">error</span><span class="hl-3">.</span><span class="hl-4">name</span><span class="hl-3"> === </span><span class="hl-1">'AbortError'</span><span class="hl-3">) {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">error</span><span class="hl-3">(</span><span class="hl-1">'Waiting for the event was canceled!'</span><span class="hl-3">);</span><br/><span class="hl-3"> } </span><span class="hl-6">else</span><span class="hl-3"> {</span><br/><span class="hl-3"> </span><span class="hl-4">console</span><span class="hl-3">.</span><span class="hl-5">error</span><span class="hl-3">(</span><span class="hl-1">'There was an error'</span><span class="hl-3">, </span><span class="hl-4">error</span><span class="hl-3">.</span><span class="hl-4">message</span><span class="hl-3">);</span><br/><span class="hl-3"> }</span><br/><span class="hl-3"> }</span><br/><span class="hl-3">}</span><br/><br/><span class="hl-5">foo</span><span class="hl-3">(</span><span class="hl-4">ee</span><span class="hl-3">, </span><span class="hl-1">'foo'</span><span class="hl-3">, </span><span class="hl-4">ac</span><span class="hl-3">.</span><span class="hl-4">signal</span><span class="hl-3">);</span><br/><span class="hl-4">ac</span><span class="hl-3">.</span><span class="hl-5">abort</span><span class="hl-3">(); </span><span class="hl-8">// Abort waiting for the event</span><br/><span class="hl-4">ee</span><span class="hl-3">.</span><span class="hl-5">emit</span><span class="hl-3">(</span><span class="hl-1">'foo'</span><span class="hl-3">); </span><span class="hl-8">// Prints: Waiting for the event was canceled!</span>
|
|
1013
1053
|
</code><button>Copy</button></pre>
|
|
1014
1054
|
|
|
1015
1055
|
<h3>Since</h3><p>v11.13.0, v10.16.0</p>
|
|
@@ -1026,7 +1066,7 @@ special handling:</p>
|
|
|
1026
1066
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><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></h4><aside class="tsd-sources">
|
|
1027
1067
|
<p>Inherited from EventEmitter.once</p>
|
|
1028
1068
|
<ul>
|
|
1029
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
1069
|
+
<li>Defined in node_modules/@types/node/events.d.ts:189</li></ul></aside></li>
|
|
1030
1070
|
<li class="tsd-signature tsd-anchor-link" id="once-2.once-4"><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Promise</span><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><a href="#once-2.once-4" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
|
1031
1071
|
<li class="tsd-description">
|
|
1032
1072
|
<div class="tsd-parameters">
|
|
@@ -1041,13 +1081,13 @@ special handling:</p>
|
|
|
1041
1081
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><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></h4><aside class="tsd-sources">
|
|
1042
1082
|
<p>Inherited from EventEmitter.once</p>
|
|
1043
1083
|
<ul>
|
|
1044
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
1084
|
+
<li>Defined in node_modules/@types/node/events.d.ts:190</li></ul></aside></li></ul></section>
|
|
1045
1085
|
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="setMaxListeners-2" class="tsd-anchor"></a>
|
|
1046
1086
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>set<wbr/>Max<wbr/>Listeners</span><a href="#setMaxListeners-2" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
1047
1087
|
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
|
|
1048
1088
|
<li class="tsd-signature tsd-anchor-link" id="setMaxListeners-2.setMaxListeners-3"><span class="tsd-kind-call-signature">set<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">n</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">eventTargets</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setMaxListeners-2.setMaxListeners-3" aria-label="Permalink" class="tsd-anchor-icon"><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"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
|
|
1049
1089
|
<li class="tsd-description">
|
|
1050
|
-
<div class="tsd-comment tsd-typography"><pre><code class="language-js"><span class="hl-
|
|
1090
|
+
<div class="tsd-comment tsd-typography"><pre><code class="language-js"><span class="hl-6">import</span><span class="hl-3"> { </span><span class="hl-4">setMaxListeners</span><span class="hl-3">, </span><span class="hl-4">EventEmitter</span><span class="hl-3"> } </span><span class="hl-6">from</span><span class="hl-3"> </span><span class="hl-1">'node:events'</span><span class="hl-3">;</span><br/><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">target</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventTarget</span><span class="hl-3">();</span><br/><span class="hl-0">const</span><span class="hl-3"> </span><span class="hl-7">emitter</span><span class="hl-3"> = </span><span class="hl-0">new</span><span class="hl-3"> </span><span class="hl-5">EventEmitter</span><span class="hl-3">();</span><br/><br/><span class="hl-5">setMaxListeners</span><span class="hl-3">(</span><span class="hl-2">5</span><span class="hl-3">, </span><span class="hl-4">target</span><span class="hl-3">, </span><span class="hl-4">emitter</span><span class="hl-3">);</span>
|
|
1051
1091
|
</code><button>Copy</button></pre>
|
|
1052
1092
|
|
|
1053
1093
|
<h3>Since</h3><p>v15.4.0</p>
|
|
@@ -1064,7 +1104,7 @@ special handling:</p>
|
|
|
1064
1104
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
|
|
1065
1105
|
<p>Inherited from EventEmitter.setMaxListeners</p>
|
|
1066
1106
|
<ul>
|
|
1067
|
-
<li>Defined in node_modules/@types/node/events.d.ts:
|
|
1107
|
+
<li>Defined in node_modules/@types/node/events.d.ts:311</li></ul></aside></li></ul></section></section></div>
|
|
1068
1108
|
<div class="col-sidebar">
|
|
1069
1109
|
<div class="page-menu">
|
|
1070
1110
|
<div class="tsd-navigation settings">
|
|
@@ -1128,6 +1168,7 @@ special handling:</p>
|
|
|
1128
1168
|
<li><a href="#setMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a></li>
|
|
1129
1169
|
<li><a href="#setTokenManager" class=""><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>set<wbr/>Token<wbr/>Manager</span></a></li>
|
|
1130
1170
|
<li><a href="#shouldListen" class=""><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>should<wbr/>Listen</span></a></li>
|
|
1171
|
+
<li><a href="#start" class=""><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>start</span></a></li>
|
|
1131
1172
|
<li><a href="#getEventListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>get<wbr/>Event<wbr/>Listeners</span></a></li>
|
|
1132
1173
|
<li><a href="#listenerCount-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>listener<wbr/>Count</span></a></li>
|
|
1133
1174
|
<li><a href="#on-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-2048-path"></use><use href="#icon-2048-text"></use></svg><span>on</span></a></li>
|
|
@@ -1173,7 +1214,6 @@ special handling:</p>
|
|
|
1173
1214
|
<li><a href="DeadLockError.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Dead<wbr/>Lock<wbr/>Error</span></a></li>
|
|
1174
1215
|
<li><a href="DiskSpaceError.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Disk<wbr/>Space<wbr/>Error</span></a></li>
|
|
1175
1216
|
<li><a href="DropTemporaryTableQuery.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Drop<wbr/>Temporary<wbr/>Table<wbr/>Query</span></a></li>
|
|
1176
|
-
<li><a href="DumpStream.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Dump<wbr/>Stream</span></a></li>
|
|
1177
1217
|
<li><a href="DuplicateEntryError.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Duplicate<wbr/>Entry<wbr/>Error</span></a></li>
|
|
1178
1218
|
<li><a href="EntityNotFoundError.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Entity<wbr/>Not<wbr/>Found<wbr/>Error</span></a></li>
|
|
1179
1219
|
<li><a href="ExpiredTokenError.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Expired<wbr/>Token<wbr/>Error</span></a></li>
|
|
@@ -1209,6 +1249,9 @@ special handling:</p>
|
|
|
1209
1249
|
<li><a href="UnauthorizedAccessError.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Unauthorized<wbr/>Access<wbr/>Error</span></a></li>
|
|
1210
1250
|
<li><a href="../interfaces/IAdditionalErrorDetails.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>IAdditional<wbr/>Error<wbr/>Details</span></a></li>
|
|
1211
1251
|
<li><a href="../interfaces/IAuthTokenData.html" class="tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>IAuth<wbr/>Token<wbr/>Data</span></a></li>
|
|
1252
|
+
<li><a href="../interfaces/ICloudwatchConfig.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>ICloudwatch<wbr/>Config</span></a></li>
|
|
1253
|
+
<li><a href="../interfaces/ICloudwatchCredentials.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>ICloudwatch<wbr/>Credentials</span></a></li>
|
|
1254
|
+
<li><a href="../interfaces/ICloudwatchStreamConfig.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>ICloudwatch<wbr/>Stream<wbr/>Config</span></a></li>
|
|
1212
1255
|
<li><a href="../interfaces/IConfig.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>IConfig</span></a></li>
|
|
1213
1256
|
<li><a href="../interfaces/IDatabaseConfig.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>IDatabase<wbr/>Config</span></a></li>
|
|
1214
1257
|
<li><a href="../interfaces/IDatabaseConnection.html"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>IDatabase<wbr/>Connection</span></a></li>
|