3135cc817334b86115059729947481adc1c09c1a
[poolifier.git] / docs / classes / PoolEmitter.html
1 <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PoolEmitter | poolifier - v2.7.0</title><meta name="description" content="Documentation for poolifier"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
2 <div class="tsd-toolbar-contents container">
3 <div class="table-cell" id="tsd-search" data-base="..">
4 <div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
5 <div class="field">
6 <div id="tsd-toolbar-links"></div></div>
7 <ul class="results">
8 <li class="state loading">Preparing search index...</li>
9 <li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">poolifier - v2.7.0</a></div>
10 <div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-menu"></use></svg></a></div></div></header>
11 <div class="container container-main">
12 <div class="col-content">
13 <div class="tsd-page-title">
14 <ul class="tsd-breadcrumb">
15 <li><a href="../index.html">poolifier</a></li>
16 <li><a href="PoolEmitter.html">PoolEmitter</a></li></ul>
17 <h1>Class PoolEmitter</h1></div>
18 <section class="tsd-panel tsd-comment">
19 <div class="tsd-comment tsd-typography"><p>Pool events emitter.</p>
20 </div>
21 <div class="tsd-comment tsd-typography"></div></section>
22 <section class="tsd-panel tsd-hierarchy">
23 <h4>Hierarchy</h4>
24 <ul class="tsd-hierarchy">
25 <li><span class="tsd-signature-type ">EventEmitter</span>
26 <ul class="tsd-hierarchy">
27 <li><span class="target">PoolEmitter</span></li></ul></li></ul></section><aside class="tsd-sources">
28 <ul>
29 <li>Defined in <a href="https://github.com/poolifier/poolifier/blob/3e9ac5c/src/pools/pool.ts#L40">src/pools/pool.ts:40</a></li></ul></aside>
30 <section class="tsd-panel-group tsd-index-group">
31 <section class="tsd-panel tsd-index-panel">
32 <details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
33 <h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex=0><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-chevronSmall"></use></svg> Index</h5></summary>
34 <div class="tsd-accordion-details">
35 <section class="tsd-index-section">
36 <h3 class="tsd-index-heading">Constructors</h3>
37 <div class="tsd-index-list"><a href="PoolEmitter.html#constructor" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-512"></use></svg><span>constructor</span></a>
38 </div></section>
39 <section class="tsd-index-section">
40 <h3 class="tsd-index-heading">Properties</h3>
41 <div class="tsd-index-list"><a href="PoolEmitter.html#captureRejectionSymbol" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>capture<wbr/>Rejection<wbr/>Symbol</span></a>
42 <a href="PoolEmitter.html#captureRejections" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>capture<wbr/>Rejections</span></a>
43 <a href="PoolEmitter.html#defaultMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>default<wbr/>Max<wbr/>Listeners</span></a>
44 <a href="PoolEmitter.html#errorMonitor" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>error<wbr/>Monitor</span></a>
45 </div></section>
46 <section class="tsd-index-section">
47 <h3 class="tsd-index-heading">Methods</h3>
48 <div class="tsd-index-list"><a href="PoolEmitter.html#addListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>add<wbr/>Listener</span></a>
49 <a href="PoolEmitter.html#emit" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>emit</span></a>
50 <a href="PoolEmitter.html#eventNames" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>event<wbr/>Names</span></a>
51 <a href="PoolEmitter.html#getMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a>
52 <a href="PoolEmitter.html#listenerCount" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listener<wbr/>Count</span></a>
53 <a href="PoolEmitter.html#listeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listeners</span></a>
54 <a href="PoolEmitter.html#off" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>off</span></a>
55 <a href="PoolEmitter.html#on" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>on</span></a>
56 <a href="PoolEmitter.html#once" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>once</span></a>
57 <a href="PoolEmitter.html#prependListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>prepend<wbr/>Listener</span></a>
58 <a href="PoolEmitter.html#prependOnceListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>prepend<wbr/>Once<wbr/>Listener</span></a>
59 <a href="PoolEmitter.html#rawListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>raw<wbr/>Listeners</span></a>
60 <a href="PoolEmitter.html#removeAllListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Listeners</span></a>
61 <a href="PoolEmitter.html#removeListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>Listener</span></a>
62 <a href="PoolEmitter.html#setMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a>
63 <a href="PoolEmitter.html#addAbortListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>add<wbr/>Abort<wbr/>Listener</span></a>
64 <a href="PoolEmitter.html#getEventListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Event<wbr/>Listeners</span></a>
65 <a href="PoolEmitter.html#getMaxListeners-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a>
66 <a href="PoolEmitter.html#listenerCount-2" class="tsd-index-link deprecated tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listener<wbr/>Count</span></a>
67 <a href="PoolEmitter.html#on-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>on</span></a>
68 <a href="PoolEmitter.html#once-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>once</span></a>
69 <a href="PoolEmitter.html#setMaxListeners-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a>
70 </div></section></div></details></section></section>
71 <section class="tsd-panel-group tsd-member-group">
72 <h2>Constructors</h2>
73 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="constructor" class="tsd-anchor"></a>
74 <h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
75 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
76 <li class="tsd-signature tsd-anchor-link" id="constructor.new_PoolEmitter"><span class="tsd-kind-constructor-signature">new <wbr/>Pool<wbr/>Emitter</span><span class="tsd-signature-symbol">(</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><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#constructor.new_PoolEmitter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
77 <li class="tsd-description">
78 <div class="tsd-parameters">
79 <h4 class="tsd-parameters-title">Parameters</h4>
80 <ul class="tsd-parameter-list">
81 <li>
82 <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type ">EventEmitterOptions</span></h5></li></ul></div>
83 <h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4><aside class="tsd-sources">
84 <p>Inherited from EventEmitter.constructor</p>
85 <ul>
86 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:109</li></ul></aside></li></ul></section></section>
87 <section class="tsd-panel-group tsd-member-group">
88 <h2>Properties</h2>
89 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="captureRejectionSymbol" class="tsd-anchor"></a>
90 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
91 <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="PoolEmitter.html#captureRejectionSymbol" class="tsd-signature-type tsd-kind-property">captureRejectionSymbol</a></div>
92 <div class="tsd-comment tsd-typography"><p>Value: <code>Symbol.for(&#39;nodejs.rejection&#39;)</code></p>
93 <p>See how to write a custom <code>rejection handler</code>.</p>
94 </div>
95 <div class="tsd-comment tsd-typography">
96 <h4>Since</h4><p>v13.4.0, v12.16.0</p>
97 </div><aside class="tsd-sources">
98 <p>Inherited from EventEmitter.captureRejectionSymbol</p>
99 <ul>
100 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:390</li></ul></aside></section>
101 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="captureRejections" class="tsd-anchor"></a>
102 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
103 <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>
104 <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>
105 <p>Change the default <code>captureRejections</code> option on all new <code>EventEmitter</code> objects.</p>
106 </div>
107 <div class="tsd-comment tsd-typography">
108 <h4>Since</h4><p>v13.4.0, v12.16.0</p>
109 </div><aside class="tsd-sources">
110 <p>Inherited from EventEmitter.captureRejections</p>
111 <ul>
112 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:397</li></ul></aside></section>
113 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="defaultMaxListeners" class="tsd-anchor"></a>
114 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
115 <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>
116 <div class="tsd-comment tsd-typography"><p>By default, a maximum of <code>10</code> listeners can be registered for any single
117 event. This limit can be changed for individual <code>EventEmitter</code> instances
118 using the <code>emitter.setMaxListeners(n)</code> method. To change the default
119 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>
120 <p>Take caution when setting the <code>events.defaultMaxListeners</code> because the
121 change affects <em>all</em><code>EventEmitter</code> instances, including those created before
122 the change is made. However, calling <code>emitter.setMaxListeners(n)</code> still has
123 precedence over <code>events.defaultMaxListeners</code>.</p>
124 <p>This is not a hard limit. The <code>EventEmitter</code> instance will allow
125 more listeners to be added but will output a trace warning to stderr indicating
126 that a &quot;possible EventEmitter memory leak&quot; has been detected. For any single<code>EventEmitter</code>, the <code>emitter.getMaxListeners()</code> and <code>emitter.setMaxListeners()</code>methods can be used to
127 temporarily avoid this warning:</p>
128 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">emitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">getMaxListeners</span><span class="hl-0">() + </span><span class="hl-1">1</span><span class="hl-0">);</span><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-8">// do stuff</span><br/><span class="hl-0"> </span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-3">Math</span><span class="hl-0">.</span><span class="hl-2">max</span><span class="hl-0">(</span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">getMaxListeners</span><span class="hl-0">() - </span><span class="hl-1">1</span><span class="hl-0">, </span><span class="hl-1">0</span><span class="hl-0">));</span><br/><span class="hl-0">});</span>
129 </code><button>Copy</button></pre>
130 <p>The <code>--trace-warnings</code> command-line flag can be used to display the
131 stack trace for such warnings.</p>
132 <p>The emitted warning can be inspected with <code>process.on(&#39;warning&#39;)</code> and will
133 have the additional <code>emitter</code>, <code>type</code>, and <code>count</code> properties, referring to
134 the event emitter instance, the event&#39;s name and the number of attached
135 listeners, respectively.
136 Its <code>name</code> property is set to <code>&#39;MaxListenersExceededWarning&#39;</code>.</p>
137 </div>
138 <div class="tsd-comment tsd-typography">
139 <h4>Since</h4><p>v0.11.2</p>
140 </div><aside class="tsd-sources">
141 <p>Inherited from EventEmitter.defaultMaxListeners</p>
142 <ul>
143 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:434</li></ul></aside></section>
144 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="errorMonitor" class="tsd-anchor"></a>
145 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
146 <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="PoolEmitter.html#errorMonitor" class="tsd-signature-type tsd-kind-property">errorMonitor</a></div>
147 <div class="tsd-comment tsd-typography"><p>This symbol shall be used to install a listener for only monitoring <code>&#39;error&#39;</code>events. Listeners installed using this symbol are called before the regular<code>&#39;error&#39;</code> listeners are called.</p>
148 <p>Installing a listener using this symbol does not change the behavior once an<code>&#39;error&#39;</code> event is emitted. Therefore, the process will still crash if no
149 regular <code>&#39;error&#39;</code> listener is installed.</p>
150 </div>
151 <div class="tsd-comment tsd-typography">
152 <h4>Since</h4><p>v13.6.0, v12.17.0</p>
153 </div><aside class="tsd-sources">
154 <p>Inherited from EventEmitter.errorMonitor</p>
155 <ul>
156 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:383</li></ul></aside></section></section>
157 <section class="tsd-panel-group tsd-member-group">
158 <h2>Methods</h2>
159 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="addListener" class="tsd-anchor"></a>
160 <h3 class="tsd-anchor-link"><span>add<wbr/>Listener</span><a href="#addListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
161 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
162 <li class="tsd-signature tsd-anchor-link" id="addListener.addListener-1"><span class="tsd-kind-call-signature">add<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="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#addListener.addListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
163 <li class="tsd-description">
164 <div class="tsd-comment tsd-typography"><p>Alias for <code>emitter.on(eventName, listener)</code>.</p>
165 </div>
166 <div class="tsd-parameters">
167 <h4 class="tsd-parameters-title">Parameters</h4>
168 <ul class="tsd-parameter-list">
169 <li>
170 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li>
171 <li>
172 <h5><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-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
173 <ul class="tsd-parameters">
174 <li class="tsd-parameter-signature">
175 <ul class="tsd-signatures tsd-is-external">
176 <li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
177 <li class="tsd-description">
178 <div class="tsd-parameters">
179 <h4 class="tsd-parameters-title">Parameters</h4>
180 <ul class="tsd-parameter-list">
181 <li>
182 <h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
183 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
184 <h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
185 <div class="tsd-comment tsd-typography">
186 <h4>Since</h4><p>v0.1.26</p>
187 </div><aside class="tsd-sources">
188 <p>Inherited from EventEmitter.addListener</p>
189 <ul>
190 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:454</li></ul></aside></li></ul></section>
191 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="emit" class="tsd-anchor"></a>
192 <h3 class="tsd-anchor-link"><span>emit</span><a href="#emit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
193 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
194 <li class="tsd-signature tsd-anchor-link" id="emit.emit-1"><span class="tsd-kind-call-signature">emit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#emit.emit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
195 <li class="tsd-description">
196 <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
197 to each.</p>
198 <p>Returns <code>true</code> if the event had listeners, <code>false</code> otherwise.</p>
199 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEmitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-8">// First listener</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">firstListener</span><span class="hl-0">() {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;Helloooo! first listener&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><span class="hl-8">// Second listener</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">secondListener</span><span class="hl-0">(</span><span class="hl-3">arg1</span><span class="hl-0">, </span><span class="hl-3">arg2</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">`event with parameters </span><span class="hl-4">${</span><span class="hl-3">arg1</span><span class="hl-4">}</span><span class="hl-6">, </span><span class="hl-4">${</span><span class="hl-3">arg2</span><span class="hl-4">}</span><span class="hl-6"> in second listener`</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><span class="hl-8">// Third listener</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">thirdListener</span><span class="hl-0">(...</span><span class="hl-3">args</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">parameters</span><span class="hl-0"> = </span><span class="hl-3">args</span><span class="hl-0">.</span><span class="hl-2">join</span><span class="hl-0">(</span><span class="hl-6">&#39;, &#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">`event with parameters </span><span class="hl-4">${</span><span class="hl-3">parameters</span><span class="hl-4">}</span><span class="hl-6"> in third listener`</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">listeners</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">));</span><br/><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-1">1</span><span class="hl-0">, </span><span class="hl-1">2</span><span class="hl-0">, </span><span class="hl-1">3</span><span class="hl-0">, </span><span class="hl-1">4</span><span class="hl-0">, </span><span class="hl-1">5</span><span class="hl-0">);</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>
200 </code><button>Copy</button></pre>
201 </div>
202 <div class="tsd-parameters">
203 <h4 class="tsd-parameters-title">Parameters</h4>
204 <ul class="tsd-parameter-list">
205 <li>
206 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li>
207 <li>
208 <h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
209 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
210 <div class="tsd-comment tsd-typography">
211 <h4>Since</h4><p>v0.1.26</p>
212 </div><aside class="tsd-sources">
213 <p>Inherited from EventEmitter.emit</p>
214 <ul>
215 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:716</li></ul></aside></li></ul></section>
216 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="eventNames" class="tsd-anchor"></a>
217 <h3 class="tsd-anchor-link"><span>event<wbr/>Names</span><a href="#eventNames" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
218 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
219 <li class="tsd-signature tsd-anchor-link" id="eventNames.eventNames-1"><span class="tsd-kind-call-signature">event<wbr/>Names</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><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><a href="#eventNames.eventNames-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
220 <li class="tsd-description">
221 <div class="tsd-comment tsd-typography"><p>Returns an array listing the events for which the emitter has registered
222 listeners. The values in the array are strings or <code>Symbol</code>s.</p>
223 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEE</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {});</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;bar&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {});</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">sym</span><span class="hl-0"> = </span><span class="hl-2">Symbol</span><span class="hl-0">(</span><span class="hl-6">&#39;symbol&#39;</span><span class="hl-0">);</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-3">sym</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {});</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">eventNames</span><span class="hl-0">());</span><br/><span class="hl-8">// Prints: [ &#39;foo&#39;, &#39;bar&#39;, Symbol(symbol) ]</span>
224 </code><button>Copy</button></pre>
225 </div>
226 <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>
227 <div class="tsd-comment tsd-typography">
228 <h4>Since</h4><p>v6.0.0</p>
229 </div><aside class="tsd-sources">
230 <p>Inherited from EventEmitter.eventNames</p>
231 <ul>
232 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:779</li></ul></aside></li></ul></section>
233 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getMaxListeners" class="tsd-anchor"></a>
234 <h3 class="tsd-anchor-link"><span>get<wbr/>Max<wbr/>Listeners</span><a href="#getMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
235 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
236 <li class="tsd-signature tsd-anchor-link" id="getMaxListeners.getMaxListeners-1"><span class="tsd-kind-call-signature">get<wbr/>Max<wbr/>Listeners</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="#getMaxListeners.getMaxListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
237 <li class="tsd-description">
238 <div class="tsd-comment tsd-typography"><p>Returns the current max listener value for the <code>EventEmitter</code> which is either
239 set by <code>emitter.setMaxListeners(n)</code> or defaults to <a href="PoolEmitter.html#defaultMaxListeners" class="tsd-kind-property">defaultMaxListeners</a>.</p>
240 </div>
241 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
242 <div class="tsd-comment tsd-typography">
243 <h4>Since</h4><p>v1.0.0</p>
244 </div><aside class="tsd-sources">
245 <p>Inherited from EventEmitter.getMaxListeners</p>
246 <ul>
247 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:631</li></ul></aside></li></ul></section>
248 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listenerCount" class="tsd-anchor"></a>
249 <h3 class="tsd-anchor-link"><span>listener<wbr/>Count</span><a href="#listenerCount" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
250 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
251 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
252 <li class="tsd-description">
253 <div class="tsd-comment tsd-typography"><p>Returns the number of listeners listening for the event named <code>eventName</code>.
254 If <code>listener</code> is provided, it will return how many times the listener is found
255 in the list of the listeners of the event.</p>
256 </div>
257 <div class="tsd-parameters">
258 <h4 class="tsd-parameters-title">Parameters</h4>
259 <ul class="tsd-parameter-list">
260 <li>
261 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
262 <div class="tsd-comment tsd-typography"><p>The name of the event being listened for</p>
263 </div>
264 <div class="tsd-comment tsd-typography"></div></li>
265 <li>
266 <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-type ">Function</span></h5>
267 <div class="tsd-comment tsd-typography"><p>The event handler function</p>
268 </div>
269 <div class="tsd-comment tsd-typography"></div></li></ul></div>
270 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
271 <div class="tsd-comment tsd-typography">
272 <h4>Since</h4><p>v3.2.0</p>
273 </div><aside class="tsd-sources">
274 <p>Inherited from EventEmitter.listenerCount</p>
275 <ul>
276 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:725</li></ul></aside></li></ul></section>
277 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listeners" class="tsd-anchor"></a>
278 <h3 class="tsd-anchor-link"><span>listeners</span><a href="#listeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
279 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
280 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
281 <li class="tsd-description">
282 <div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p>
283 <pre><code class="language-js"><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;someone connected!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">util</span><span class="hl-0">.</span><span class="hl-2">inspect</span><span class="hl-0">(</span><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">listeners</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">)));</span><br/><span class="hl-8">// Prints: [ [Function] ]</span>
284 </code><button>Copy</button></pre>
285 </div>
286 <div class="tsd-parameters">
287 <h4 class="tsd-parameters-title">Parameters</h4>
288 <ul class="tsd-parameter-list">
289 <li>
290 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li></ul></div>
291 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span></h4>
292 <div class="tsd-comment tsd-typography">
293 <h4>Since</h4><p>v0.1.26</p>
294 </div><aside class="tsd-sources">
295 <p>Inherited from EventEmitter.listeners</p>
296 <ul>
297 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:644</li></ul></aside></li></ul></section>
298 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="off" class="tsd-anchor"></a>
299 <h3 class="tsd-anchor-link"><span>off</span><a href="#off" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
300 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
301 <li class="tsd-signature tsd-anchor-link" id="off.off-1"><span class="tsd-kind-call-signature">off</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="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#off.off-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
302 <li class="tsd-description">
303 <div class="tsd-comment tsd-typography"><p>Alias for <code>emitter.removeListener()</code>.</p>
304 </div>
305 <div class="tsd-parameters">
306 <h4 class="tsd-parameters-title">Parameters</h4>
307 <ul class="tsd-parameter-list">
308 <li>
309 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li>
310 <li>
311 <h5><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-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
312 <ul class="tsd-parameters">
313 <li class="tsd-parameter-signature">
314 <ul class="tsd-signatures tsd-is-external">
315 <li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
316 <li class="tsd-description">
317 <div class="tsd-parameters">
318 <h4 class="tsd-parameters-title">Parameters</h4>
319 <ul class="tsd-parameter-list">
320 <li>
321 <h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
322 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
323 <h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
324 <div class="tsd-comment tsd-typography">
325 <h4>Since</h4><p>v10.0.0</p>
326 </div><aside class="tsd-sources">
327 <p>Inherited from EventEmitter.off</p>
328 <ul>
329 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:604</li></ul></aside></li></ul></section>
330 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="on" class="tsd-anchor"></a>
331 <h3 class="tsd-anchor-link"><span>on</span><a href="#on" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
332 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
333 <li class="tsd-signature tsd-anchor-link" id="on.on-1"><span class="tsd-kind-call-signature">on</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="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#on.on-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
334 <li class="tsd-description">
335 <div class="tsd-comment tsd-typography"><p>Adds the <code>listener</code> function to the end of the listeners array for the
336 event named <code>eventName</code>. No checks are made to see if the <code>listener</code> has
337 already been added. Multiple calls passing the same combination of <code>eventName</code>and <code>listener</code> will result in the <code>listener</code> being added, and called, multiple
338 times.</p>
339 <pre><code class="language-js"><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;someone connected!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span>
340 </code><button>Copy</button></pre>
341 <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
342 <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
343 event listener to the beginning of the listeners array.</p>
344 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEE</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;a&#39;</span><span class="hl-0">));</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">prependListener</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;b&#39;</span><span class="hl-0">));</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// b</span><br/><span class="hl-8">// a</span>
345 </code><button>Copy</button></pre>
346 </div>
347 <div class="tsd-parameters">
348 <h4 class="tsd-parameters-title">Parameters</h4>
349 <ul class="tsd-parameter-list">
350 <li>
351 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
352 <div class="tsd-comment tsd-typography"><p>The name of the event.</p>
353 </div>
354 <div class="tsd-comment tsd-typography"></div></li>
355 <li>
356 <h5><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-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
357 <div class="tsd-comment tsd-typography"><p>The callback function</p>
358 </div>
359 <div class="tsd-comment tsd-typography"></div>
360 <ul class="tsd-parameters">
361 <li class="tsd-parameter-signature">
362 <ul class="tsd-signatures tsd-is-external">
363 <li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
364 <li class="tsd-description">
365 <div class="tsd-parameters">
366 <h4 class="tsd-parameters-title">Parameters</h4>
367 <ul class="tsd-parameter-list">
368 <li>
369 <h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
370 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
371 <h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
372 <div class="tsd-comment tsd-typography">
373 <h4>Since</h4><p>v0.1.101</p>
374 </div><aside class="tsd-sources">
375 <p>Inherited from EventEmitter.on</p>
376 <ul>
377 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:486</li></ul></aside></li></ul></section>
378 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="once" class="tsd-anchor"></a>
379 <h3 class="tsd-anchor-link"><span>once</span><a href="#once" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
380 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
381 <li class="tsd-signature tsd-anchor-link" id="once.once-1"><span class="tsd-kind-call-signature">once</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="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#once.once-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
382 <li class="tsd-description">
383 <div class="tsd-comment tsd-typography"><p>Adds a <strong>one-time</strong><code>listener</code> function for the event named <code>eventName</code>. The
384 next time <code>eventName</code> is triggered, this listener is removed and then invoked.</p>
385 <pre><code class="language-js"><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;Ah, we have our first user!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span>
386 </code><button>Copy</button></pre>
387 <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
388 <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
389 event listener to the beginning of the listeners array.</p>
390 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEE</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;a&#39;</span><span class="hl-0">));</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">prependOnceListener</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;b&#39;</span><span class="hl-0">));</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// b</span><br/><span class="hl-8">// a</span>
391 </code><button>Copy</button></pre>
392 </div>
393 <div class="tsd-parameters">
394 <h4 class="tsd-parameters-title">Parameters</h4>
395 <ul class="tsd-parameter-list">
396 <li>
397 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
398 <div class="tsd-comment tsd-typography"><p>The name of the event.</p>
399 </div>
400 <div class="tsd-comment tsd-typography"></div></li>
401 <li>
402 <h5><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-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
403 <div class="tsd-comment tsd-typography"><p>The callback function</p>
404 </div>
405 <div class="tsd-comment tsd-typography"></div>
406 <ul class="tsd-parameters">
407 <li class="tsd-parameter-signature">
408 <ul class="tsd-signatures tsd-is-external">
409 <li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
410 <li class="tsd-description">
411 <div class="tsd-parameters">
412 <h4 class="tsd-parameters-title">Parameters</h4>
413 <ul class="tsd-parameter-list">
414 <li>
415 <h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
416 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
417 <h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
418 <div class="tsd-comment tsd-typography">
419 <h4>Since</h4><p>v0.3.0</p>
420 </div><aside class="tsd-sources">
421 <p>Inherited from EventEmitter.once</p>
422 <ul>
423 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:516</li></ul></aside></li></ul></section>
424 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="prependListener" class="tsd-anchor"></a>
425 <h3 class="tsd-anchor-link"><span>prepend<wbr/>Listener</span><a href="#prependListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
426 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
427 <li class="tsd-signature tsd-anchor-link" id="prependListener.prependListener-1"><span class="tsd-kind-call-signature">prepend<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="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#prependListener.prependListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
428 <li class="tsd-description">
429 <div class="tsd-comment tsd-typography"><p>Adds the <code>listener</code> function to the <em>beginning</em> of the listeners array for the
430 event named <code>eventName</code>. No checks are made to see if the <code>listener</code> has
431 already been added. Multiple calls passing the same combination of <code>eventName</code>and <code>listener</code> will result in the <code>listener</code> being added, and called, multiple
432 times.</p>
433 <pre><code class="language-js"><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">prependListener</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;someone connected!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span>
434 </code><button>Copy</button></pre>
435 <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
436 </div>
437 <div class="tsd-parameters">
438 <h4 class="tsd-parameters-title">Parameters</h4>
439 <ul class="tsd-parameter-list">
440 <li>
441 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
442 <div class="tsd-comment tsd-typography"><p>The name of the event.</p>
443 </div>
444 <div class="tsd-comment tsd-typography"></div></li>
445 <li>
446 <h5><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-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
447 <div class="tsd-comment tsd-typography"><p>The callback function</p>
448 </div>
449 <div class="tsd-comment tsd-typography"></div>
450 <ul class="tsd-parameters">
451 <li class="tsd-parameter-signature">
452 <ul class="tsd-signatures tsd-is-external">
453 <li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
454 <li class="tsd-description">
455 <div class="tsd-parameters">
456 <h4 class="tsd-parameters-title">Parameters</h4>
457 <ul class="tsd-parameter-list">
458 <li>
459 <h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
460 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
461 <h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
462 <div class="tsd-comment tsd-typography">
463 <h4>Since</h4><p>v6.0.0</p>
464 </div><aside class="tsd-sources">
465 <p>Inherited from EventEmitter.prependListener</p>
466 <ul>
467 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:743</li></ul></aside></li></ul></section>
468 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="prependOnceListener" class="tsd-anchor"></a>
469 <h3 class="tsd-anchor-link"><span>prepend<wbr/>Once<wbr/>Listener</span><a href="#prependOnceListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
470 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
471 <li class="tsd-signature tsd-anchor-link" id="prependOnceListener.prependOnceListener-1"><span class="tsd-kind-call-signature">prepend<wbr/>Once<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="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#prependOnceListener.prependOnceListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
472 <li class="tsd-description">
473 <div class="tsd-comment tsd-typography"><p>Adds a <strong>one-time</strong><code>listener</code> function for the event named <code>eventName</code> to the <em>beginning</em> of the listeners array. The next time <code>eventName</code> is triggered, this
474 listener is removed, and then invoked.</p>
475 <pre><code class="language-js"><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">prependOnceListener</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;Ah, we have our first user!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span>
476 </code><button>Copy</button></pre>
477 <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
478 </div>
479 <div class="tsd-parameters">
480 <h4 class="tsd-parameters-title">Parameters</h4>
481 <ul class="tsd-parameter-list">
482 <li>
483 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
484 <div class="tsd-comment tsd-typography"><p>The name of the event.</p>
485 </div>
486 <div class="tsd-comment tsd-typography"></div></li>
487 <li>
488 <h5><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-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
489 <div class="tsd-comment tsd-typography"><p>The callback function</p>
490 </div>
491 <div class="tsd-comment tsd-typography"></div>
492 <ul class="tsd-parameters">
493 <li class="tsd-parameter-signature">
494 <ul class="tsd-signatures tsd-is-external">
495 <li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
496 <li class="tsd-description">
497 <div class="tsd-parameters">
498 <h4 class="tsd-parameters-title">Parameters</h4>
499 <ul class="tsd-parameter-list">
500 <li>
501 <h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
502 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
503 <h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
504 <div class="tsd-comment tsd-typography">
505 <h4>Since</h4><p>v6.0.0</p>
506 </div><aside class="tsd-sources">
507 <p>Inherited from EventEmitter.prependOnceListener</p>
508 <ul>
509 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:759</li></ul></aside></li></ul></section>
510 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="rawListeners" class="tsd-anchor"></a>
511 <h3 class="tsd-anchor-link"><span>raw<wbr/>Listeners</span><a href="#rawListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
512 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
513 <li class="tsd-signature tsd-anchor-link" id="rawListeners.rawListeners-1"><span class="tsd-kind-call-signature">raw<wbr/>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="#rawListeners.rawListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
514 <li class="tsd-description">
515 <div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>,
516 including any wrappers (such as those created by <code>.once()</code>).</p>
517 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">emitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">&#39;log&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;log once&#39;</span><span class="hl-0">));</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-4">const</span><span class="hl-0"> </span><span class="hl-7">listeners</span><span class="hl-0"> = </span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">rawListeners</span><span class="hl-0">(</span><span class="hl-6">&#39;log&#39;</span><span class="hl-0">);</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">logFnWrapper</span><span class="hl-0"> = </span><span class="hl-3">listeners</span><span class="hl-0">[</span><span class="hl-1">0</span><span class="hl-0">];</span><br/><br/><span class="hl-8">// Logs &quot;log once&quot; to the console and does not unbind the `once` event</span><br/><span class="hl-3">logFnWrapper</span><span class="hl-0">.</span><span class="hl-2">listener</span><span class="hl-0">();</span><br/><br/><span class="hl-8">// Logs &quot;log once&quot; to the console and removes the listener</span><br/><span class="hl-2">logFnWrapper</span><span class="hl-0">();</span><br/><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;log&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;log persistently&#39;</span><span class="hl-0">));</span><br/><span class="hl-8">// Will return a new Array with a single function bound by `.on()` above</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">newListeners</span><span class="hl-0"> = </span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">rawListeners</span><span class="hl-0">(</span><span class="hl-6">&#39;log&#39;</span><span class="hl-0">);</span><br/><br/><span class="hl-8">// Logs &quot;log persistently&quot; twice</span><br/><span class="hl-3">newListeners</span><span class="hl-0">[</span><span class="hl-1">0</span><span class="hl-0">]();</span><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;log&#39;</span><span class="hl-0">);</span>
518 </code><button>Copy</button></pre>
519 </div>
520 <div class="tsd-parameters">
521 <h4 class="tsd-parameters-title">Parameters</h4>
522 <ul class="tsd-parameter-list">
523 <li>
524 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li></ul></div>
525 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span></h4>
526 <div class="tsd-comment tsd-typography">
527 <h4>Since</h4><p>v9.4.0</p>
528 </div><aside class="tsd-sources">
529 <p>Inherited from EventEmitter.rawListeners</p>
530 <ul>
531 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:675</li></ul></aside></li></ul></section>
532 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="removeAllListeners" class="tsd-anchor"></a>
533 <h3 class="tsd-anchor-link"><span>remove<wbr/>All<wbr/>Listeners</span><a href="#removeAllListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
534 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
535 <li class="tsd-signature tsd-anchor-link" id="removeAllListeners.removeAllListeners-1"><span class="tsd-kind-call-signature">remove<wbr/>All<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#removeAllListeners.removeAllListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
536 <li class="tsd-description">
537 <div class="tsd-comment tsd-typography"><p>Removes all listeners, or those of the specified <code>eventName</code>.</p>
538 <p>It is bad practice to remove listeners added elsewhere in the code,
539 particularly when the <code>EventEmitter</code> instance was created by some other
540 component or module (e.g. sockets or file streams).</p>
541 <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
542 </div>
543 <div class="tsd-parameters">
544 <h4 class="tsd-parameters-title">Parameters</h4>
545 <ul class="tsd-parameter-list">
546 <li>
547 <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li></ul></div>
548 <h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
549 <div class="tsd-comment tsd-typography">
550 <h4>Since</h4><p>v0.1.26</p>
551 </div><aside class="tsd-sources">
552 <p>Inherited from EventEmitter.removeAllListeners</p>
553 <ul>
554 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:615</li></ul></aside></li></ul></section>
555 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="removeListener" class="tsd-anchor"></a>
556 <h3 class="tsd-anchor-link"><span>remove<wbr/>Listener</span><a href="#removeListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
557 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
558 <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="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#removeListener.removeListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
559 <li class="tsd-description">
560 <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>
561 <pre><code class="language-js"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-2">callback</span><span class="hl-0"> = (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;someone connected!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">};</span><br/><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, </span><span class="hl-3">callback</span><span class="hl-0">);</span><br/><span class="hl-8">// ...</span><br/><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">removeListener</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, </span><span class="hl-3">callback</span><span class="hl-0">);</span>
562 </code><button>Copy</button></pre>
563 <p><code>removeListener()</code> will remove, at most, one instance of a listener from the
564 listener array. If any single listener has been added multiple times to the
565 listener array for the specified <code>eventName</code>, then <code>removeListener()</code> must be
566 called multiple times to remove each instance.</p>
567 <p>Once an event is emitted, all listeners attached to it at the
568 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
569 will not remove them from<code>emit()</code> in progress. Subsequent events behave as expected.</p>
570 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">class</span><span class="hl-0"> </span><span class="hl-9">MyEmitter</span><span class="hl-0"> </span><span class="hl-4">extends</span><span class="hl-0"> </span><span class="hl-9">EventEmitter</span><span class="hl-0"> {}</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEmitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">MyEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-2">callbackA</span><span class="hl-0"> = () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;A&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">removeListener</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-3">callbackB</span><span class="hl-0">);</span><br/><span class="hl-0">};</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-2">callbackB</span><span class="hl-0"> = () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;B&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">};</span><br/><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-3">callbackA</span><span class="hl-0">);</span><br/><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-3">callbackB</span><span class="hl-0">);</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-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">);</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-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// A</span>
571 </code><button>Copy</button></pre>
572 <p>Because listeners are managed using an internal array, calling this will
573 change the position indices of any listener registered <em>after</em> the listener
574 being removed. This will not impact the order in which listeners are called,
575 but it means that any copies of the listener array as returned by
576 the <code>emitter.listeners()</code> method will need to be recreated.</p>
577 <p>When a single function has been added as a handler multiple times for a single
578 event (as in the example below), <code>removeListener()</code> will remove the most
579 recently added instance. In the example the <code>once(&#39;ping&#39;)</code>listener is removed:</p>
580 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">pong</span><span class="hl-0">() {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;pong&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">}</span><br/><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;ping&#39;</span><span class="hl-0">, </span><span class="hl-3">pong</span><span class="hl-0">);</span><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">&#39;ping&#39;</span><span class="hl-0">, </span><span class="hl-3">pong</span><span class="hl-0">);</span><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">removeListener</span><span class="hl-0">(</span><span class="hl-6">&#39;ping&#39;</span><span class="hl-0">, </span><span class="hl-3">pong</span><span class="hl-0">);</span><br/><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;ping&#39;</span><span class="hl-0">);</span><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;ping&#39;</span><span class="hl-0">);</span>
581 </code><button>Copy</button></pre>
582 <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
583 </div>
584 <div class="tsd-parameters">
585 <h4 class="tsd-parameters-title">Parameters</h4>
586 <ul class="tsd-parameter-list">
587 <li>
588 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li>
589 <li>
590 <h5><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-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
591 <ul class="tsd-parameters">
592 <li class="tsd-parameter-signature">
593 <ul class="tsd-signatures tsd-is-external">
594 <li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
595 <li class="tsd-description">
596 <div class="tsd-parameters">
597 <h4 class="tsd-parameters-title">Parameters</h4>
598 <ul class="tsd-parameter-list">
599 <li>
600 <h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
601 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
602 <h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
603 <div class="tsd-comment tsd-typography">
604 <h4>Since</h4><p>v0.1.26</p>
605 </div><aside class="tsd-sources">
606 <p>Inherited from EventEmitter.removeListener</p>
607 <ul>
608 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:599</li></ul></aside></li></ul></section>
609 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="setMaxListeners" class="tsd-anchor"></a>
610 <h3 class="tsd-anchor-link"><span>set<wbr/>Max<wbr/>Listeners</span><a href="#setMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
611 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
612 <li class="tsd-signature tsd-anchor-link" id="setMaxListeners.setMaxListeners-1"><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><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#setMaxListeners.setMaxListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
613 <li class="tsd-description">
614 <div class="tsd-comment tsd-typography"><p>By default <code>EventEmitter</code>s will print a warning if more than <code>10</code> listeners are
615 added for a particular event. This is a useful default that helps finding
616 memory leaks. The <code>emitter.setMaxListeners()</code> method allows the limit to be
617 modified for this specific <code>EventEmitter</code> instance. The value can be set to<code>Infinity</code> (or <code>0</code>) to indicate an unlimited number of listeners.</p>
618 <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
619 </div>
620 <div class="tsd-parameters">
621 <h4 class="tsd-parameters-title">Parameters</h4>
622 <ul class="tsd-parameter-list">
623 <li>
624 <h5><span class="tsd-kind-parameter">n</span>: <span class="tsd-signature-type">number</span></h5></li></ul></div>
625 <h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
626 <div class="tsd-comment tsd-typography">
627 <h4>Since</h4><p>v0.3.5</p>
628 </div><aside class="tsd-sources">
629 <p>Inherited from EventEmitter.setMaxListeners</p>
630 <ul>
631 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:625</li></ul></aside></li></ul></section>
632 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="addAbortListener" class="tsd-anchor"></a>
633 <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>add<wbr/>Abort<wbr/>Listener</span><a href="#addAbortListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
634 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
635 <li class="tsd-signature tsd-anchor-link" id="addAbortListener.addAbortListener-1"><span class="tsd-kind-call-signature">add<wbr/>Abort<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">signal</span>, <span class="tsd-kind-parameter">resource</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Disposable</span><a href="#addAbortListener.addAbortListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
636 <li class="tsd-description"><code class="tsd-tag ts-flagExperimental">Experimental</code>
637 <div class="tsd-comment tsd-typography"><p>Listens once to the <code>abort</code> event on the provided <code>signal</code>.</p>
638 <p>Listening to the <code>abort</code> event on abort signals is unsafe and may
639 lead to resource leaks since another third party with the signal can
640 call <code>e.stopImmediatePropagation()</code>. Unfortunately Node.js cannot change
641 this since it would violate the web standard. Additionally, the original
642 API makes it easy to forget to remove listeners.</p>
643 <p>This API allows safely using <code>AbortSignal</code>s in Node.js APIs by solving these
644 two issues by listening to the event such that <code>stopImmediatePropagation</code> does
645 not prevent the listener from running.</p>
646 <p>Returns a disposable so that it may be unsubscribed from more easily.</p>
647 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">addAbortListener</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">example</span><span class="hl-0">(</span><span class="hl-3">signal</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-4">let</span><span class="hl-0"> </span><span class="hl-3">disposable</span><span class="hl-0">;</span><br/><span class="hl-0"> </span><span class="hl-5">try</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">signal</span><span class="hl-0">.</span><span class="hl-2">addEventListener</span><span class="hl-0">(</span><span class="hl-6">&#39;abort&#39;</span><span class="hl-0">, (</span><span class="hl-3">e</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">e</span><span class="hl-0">.</span><span class="hl-2">stopImmediatePropagation</span><span class="hl-0">());</span><br/><span class="hl-0"> </span><span class="hl-3">disposable</span><span class="hl-0"> = </span><span class="hl-2">addAbortListener</span><span class="hl-0">(</span><span class="hl-3">signal</span><span class="hl-0">, (</span><span class="hl-3">e</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-8">// Do something when signal is aborted.</span><br/><span class="hl-0"> });</span><br/><span class="hl-0"> } </span><span class="hl-5">finally</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">disposable</span><span class="hl-0">?.[</span><span class="hl-3">Symbol</span><span class="hl-0">.</span><span class="hl-3">dispose</span><span class="hl-0">]();</span><br/><span class="hl-0"> }</span><br/><span class="hl-0">}</span>
648 </code><button>Copy</button></pre>
649 </div>
650 <div class="tsd-parameters">
651 <h4 class="tsd-parameters-title">Parameters</h4>
652 <ul class="tsd-parameter-list">
653 <li>
654 <h5><span class="tsd-kind-parameter">signal</span>: <span class="tsd-signature-type ">AbortSignal</span></h5></li>
655 <li>
656 <h5><span class="tsd-kind-parameter">resource</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
657 <ul class="tsd-parameters">
658 <li class="tsd-parameter-signature">
659 <ul class="tsd-signatures tsd-is-external">
660 <li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
661 <li class="tsd-description">
662 <div class="tsd-parameters">
663 <h4 class="tsd-parameters-title">Parameters</h4>
664 <ul class="tsd-parameter-list">
665 <li>
666 <h5><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type ">Event</span></h5></li></ul></div>
667 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
668 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Disposable</span></h4><p>that removes the <code>abort</code> listener.</p>
669
670 <div class="tsd-comment tsd-typography">
671 <h4>Since</h4><p>v20.5.0</p>
672 </div><aside class="tsd-sources">
673 <p>Inherited from EventEmitter.addAbortListener</p>
674 <ul>
675 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:375</li></ul></aside></li></ul></section>
676 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getEventListeners" class="tsd-anchor"></a>
677 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
678 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
679 <li class="tsd-signature tsd-anchor-link" id="getEventListeners.getEventListeners-1"><span class="tsd-kind-call-signature">get<wbr/>Event<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">name</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="#getEventListeners.getEventListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
680 <li class="tsd-description">
681 <div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p>
682 <p>For <code>EventEmitter</code>s this behaves exactly the same as calling <code>.listeners</code> on
683 the emitter.</p>
684 <p>For <code>EventTarget</code>s this is the only way to get the event listeners for the
685 event target. This is useful for debugging and diagnostic purposes.</p>
686 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">getEventListeners</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-2">listener</span><span class="hl-0"> = () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;Events are fun&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-3">listener</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getEventListeners</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">)); </span><span class="hl-8">// [ [Function: listener] ]</span><br/><span class="hl-0">}</span><br/><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">et</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventTarget</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-2">listener</span><span class="hl-0"> = () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;Events are fun&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">et</span><span class="hl-0">.</span><span class="hl-2">addEventListener</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-3">listener</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getEventListeners</span><span class="hl-0">(</span><span class="hl-3">et</span><span class="hl-0">, </span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">)); </span><span class="hl-8">// [ [Function: listener] ]</span><br/><span class="hl-0">}</span>
687 </code><button>Copy</button></pre>
688 </div>
689 <div class="tsd-parameters">
690 <h4 class="tsd-parameters-title">Parameters</h4>
691 <ul class="tsd-parameter-list">
692 <li>
693 <h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">EventEmitter</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">_DOMEventTarget</span></h5></li>
694 <li>
695 <h5><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li></ul></div>
696 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span></h4>
697 <div class="tsd-comment tsd-typography">
698 <h4>Since</h4><p>v15.2.0, v14.17.0</p>
699 </div><aside class="tsd-sources">
700 <p>Inherited from EventEmitter.getEventListeners</p>
701 <ul>
702 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:296</li></ul></aside></li></ul></section>
703 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getMaxListeners-2" class="tsd-anchor"></a>
704 <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>get<wbr/>Max<wbr/>Listeners</span><a href="#getMaxListeners-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
705 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
706 <li class="tsd-signature tsd-anchor-link" id="getMaxListeners-2.getMaxListeners-3"><span class="tsd-kind-call-signature">get<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#getMaxListeners-2.getMaxListeners-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
707 <li class="tsd-description">
708 <div class="tsd-comment tsd-typography"><p>Returns the currently set max amount of listeners.</p>
709 <p>For <code>EventEmitter</code>s this behaves exactly the same as calling <code>.getMaxListeners</code> on
710 the emitter.</p>
711 <p>For <code>EventTarget</code>s this is the only way to get the max event listeners for the
712 event target. If the number of event handlers on a single EventTarget exceeds
713 the max set, the EventTarget will print a warning.</p>
714 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">getMaxListeners</span><span class="hl-0">, </span><span class="hl-3">setMaxListeners</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getMaxListeners</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">)); </span><span class="hl-8">// 10</span><br/><span class="hl-0"> </span><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-1">11</span><span class="hl-0">, </span><span class="hl-3">ee</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getMaxListeners</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">)); </span><span class="hl-8">// 11</span><br/><span class="hl-0">}</span><br/><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">et</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventTarget</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getMaxListeners</span><span class="hl-0">(</span><span class="hl-3">et</span><span class="hl-0">)); </span><span class="hl-8">// 10</span><br/><span class="hl-0"> </span><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-1">11</span><span class="hl-0">, </span><span class="hl-3">et</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getMaxListeners</span><span class="hl-0">(</span><span class="hl-3">et</span><span class="hl-0">)); </span><span class="hl-8">// 11</span><br/><span class="hl-0">}</span>
715 </code><button>Copy</button></pre>
716 </div>
717 <div class="tsd-parameters">
718 <h4 class="tsd-parameters-title">Parameters</h4>
719 <ul class="tsd-parameter-list">
720 <li>
721 <h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">EventEmitter</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">_DOMEventTarget</span></h5></li></ul></div>
722 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
723 <div class="tsd-comment tsd-typography">
724 <h4>Since</h4><p>v19.9.0</p>
725 </div><aside class="tsd-sources">
726 <p>Inherited from EventEmitter.getMaxListeners</p>
727 <ul>
728 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:325</li></ul></aside></li></ul></section>
729 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listenerCount-2" class="tsd-anchor"></a>
730 <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span class="deprecated">listener<wbr/>Count</span><a href="#listenerCount-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
731 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
732 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
733 <li class="tsd-description">
734 <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>
735 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0">, </span><span class="hl-3">listenerCount</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEmitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {});</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {});</span><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">listenerCount</span><span class="hl-0">(</span><span class="hl-3">myEmitter</span><span class="hl-0">, </span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">));</span><br/><span class="hl-8">// Prints: 2</span>
736 </code><button>Copy</button></pre>
737 </div>
738 <div class="tsd-parameters">
739 <h4 class="tsd-parameters-title">Parameters</h4>
740 <ul class="tsd-parameter-list">
741 <li>
742 <h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">EventEmitter</span></h5>
743 <div class="tsd-comment tsd-typography"><p>The emitter to query</p>
744 </div>
745 <div class="tsd-comment tsd-typography"></div></li>
746 <li>
747 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
748 <div class="tsd-comment tsd-typography"><p>The event name</p>
749 </div>
750 <div class="tsd-comment tsd-typography"></div></li></ul></div>
751 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
752 <div class="tsd-comment tsd-typography">
753 <h4>Since</h4><p>v0.9.12</p>
754
755 <h4>Deprecated</h4><p>Since v3.2.0 - Use <code>listenerCount</code> instead.</p>
756 </div><aside class="tsd-sources">
757 <p>Inherited from EventEmitter.listenerCount</p>
758 <ul>
759 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:268</li></ul></aside></li></ul></section>
760 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="on-2" class="tsd-anchor"></a>
761 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
762 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
763 <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">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><a href="#on-2.on-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
764 <li class="tsd-description">
765 <div class="tsd-comment tsd-typography"><pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">on</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-5">import</span><span class="hl-0"> </span><span class="hl-3">process</span><span class="hl-0"> </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:process&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-8">// Emit later on</span><br/><span class="hl-3">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-6">&#39;bar&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-1">42</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-5">for</span><span class="hl-0"> </span><span class="hl-5">await</span><span class="hl-0"> (</span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">event</span><span class="hl-0"> </span><span class="hl-4">of</span><span class="hl-0"> </span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">)) {</span><br/><span class="hl-0"> </span><span class="hl-8">// The execution of this inner block is synchronous and it</span><br/><span class="hl-0"> </span><span class="hl-8">// processes one event at a time (even with await). Do not use</span><br/><span class="hl-0"> </span><span class="hl-8">// if concurrent execution is required.</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">event</span><span class="hl-0">); </span><span class="hl-8">// prints [&#39;bar&#39;] [42]</span><br/><span class="hl-0">}</span><br/><span class="hl-8">// Unreachable here</span>
766 </code><button>Copy</button></pre>
767 <p>Returns an <code>AsyncIterator</code> that iterates <code>eventName</code> events. It will throw
768 if the <code>EventEmitter</code> emits <code>&#39;error&#39;</code>. It removes all listeners when
769 exiting the loop. The <code>value</code> returned by each iteration is an array
770 composed of the emitted event arguments.</p>
771 <p>An <code>AbortSignal</code> can be used to cancel waiting on events:</p>
772 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">on</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-5">import</span><span class="hl-0"> </span><span class="hl-3">process</span><span class="hl-0"> </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:process&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ac</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">AbortController</span><span class="hl-0">();</span><br/><br/><span class="hl-0">(</span><span class="hl-4">async</span><span class="hl-0"> () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-0"> </span><span class="hl-8">// Emit later on</span><br/><span class="hl-0"> </span><span class="hl-3">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-6">&#39;bar&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-1">42</span><span class="hl-0">);</span><br/><span class="hl-0"> });</span><br/><br/><span class="hl-0"> </span><span class="hl-5">for</span><span class="hl-0"> </span><span class="hl-5">await</span><span class="hl-0"> (</span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">event</span><span class="hl-0"> </span><span class="hl-4">of</span><span class="hl-0"> </span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, { </span><span class="hl-3">signal:</span><span class="hl-0"> </span><span class="hl-3">ac</span><span class="hl-0">.</span><span class="hl-3">signal</span><span class="hl-0"> })) {</span><br/><span class="hl-0"> </span><span class="hl-8">// The execution of this inner block is synchronous and it</span><br/><span class="hl-0"> </span><span class="hl-8">// processes one event at a time (even with await). Do not use</span><br/><span class="hl-0"> </span><span class="hl-8">// if concurrent execution is required.</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">event</span><span class="hl-0">); </span><span class="hl-8">// prints [&#39;bar&#39;] [42]</span><br/><span class="hl-0"> }</span><br/><span class="hl-0"> </span><span class="hl-8">// Unreachable here</span><br/><span class="hl-0">})();</span><br/><br/><span class="hl-3">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">ac</span><span class="hl-0">.</span><span class="hl-2">abort</span><span class="hl-0">());</span>
773 </code><button>Copy</button></pre>
774 </div>
775 <div class="tsd-parameters">
776 <h4 class="tsd-parameters-title">Parameters</h4>
777 <ul class="tsd-parameter-list">
778 <li>
779 <h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">EventEmitter</span></h5></li>
780 <li>
781 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span></h5>
782 <div class="tsd-comment tsd-typography"><p>The name of the event being listened for</p>
783 </div>
784 <div class="tsd-comment tsd-typography"></div></li>
785 <li>
786 <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type ">StaticEventEmitterOptions</span></h5></li></ul></div>
787 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">AsyncIterableIterator</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h4><p>that iterates <code>eventName</code> events emitted by the <code>emitter</code></p>
788
789 <div class="tsd-comment tsd-typography">
790 <h4>Since</h4><p>v13.6.0, v12.16.0</p>
791 </div><aside class="tsd-sources">
792 <p>Inherited from EventEmitter.on</p>
793 <ul>
794 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:250</li></ul></aside></li></ul></section>
795 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="once-2" class="tsd-anchor"></a>
796 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
797 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
798 <li class="tsd-signature tsd-anchor-link" id="once-2.once-3"><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">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span><a href="#once-2.once-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
799 <li class="tsd-description">
800 <div class="tsd-comment tsd-typography"><p>Creates a <code>Promise</code> that is fulfilled when the <code>EventEmitter</code> emits the given
801 event or that is rejected if the <code>EventEmitter</code> emits <code>&#39;error&#39;</code> while waiting.
802 The <code>Promise</code> will resolve with an array of all the arguments emitted to the
803 given event.</p>
804 <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>&#39;error&#39;</code> event
805 semantics and does not listen to the <code>&#39;error&#39;</code> event.</p>
806 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">once</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-5">import</span><span class="hl-0"> </span><span class="hl-3">process</span><span class="hl-0"> </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:process&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-3">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;myevent&#39;</span><span class="hl-0">, </span><span class="hl-1">42</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> [</span><span class="hl-7">value</span><span class="hl-0">] = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;myevent&#39;</span><span class="hl-0">);</span><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">);</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">err</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">Error</span><span class="hl-0">(</span><span class="hl-6">&#39;kaboom&#39;</span><span class="hl-0">);</span><br/><span class="hl-3">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;error&#39;</span><span class="hl-0">, </span><span class="hl-3">err</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-5">try</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;myevent&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">} </span><span class="hl-5">catch</span><span class="hl-0"> (</span><span class="hl-3">err</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">error</span><span class="hl-0">(</span><span class="hl-6">&#39;error happened&#39;</span><span class="hl-0">, </span><span class="hl-3">err</span><span class="hl-0">);</span><br/><span class="hl-0">}</span>
807 </code><button>Copy</button></pre>
808 <p>The special handling of the <code>&#39;error&#39;</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
809 &#39;<code>error&#39;</code> event itself, then it is treated as any other kind of event without
810 special handling:</p>
811 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0">, </span><span class="hl-3">once</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;error&#39;</span><span class="hl-0">)</span><br/><span class="hl-0"> .</span><span class="hl-2">then</span><span class="hl-0">(([</span><span class="hl-3">err</span><span class="hl-0">]) </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;ok&#39;</span><span class="hl-0">, </span><span class="hl-3">err</span><span class="hl-0">.</span><span class="hl-3">message</span><span class="hl-0">))</span><br/><span class="hl-0"> .</span><span class="hl-2">catch</span><span class="hl-0">((</span><span class="hl-3">err</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">error</span><span class="hl-0">(</span><span class="hl-6">&#39;error&#39;</span><span class="hl-0">, </span><span class="hl-3">err</span><span class="hl-0">.</span><span class="hl-3">message</span><span class="hl-0">));</span><br/><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;error&#39;</span><span class="hl-0">, </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">Error</span><span class="hl-0">(</span><span class="hl-6">&#39;boom&#39;</span><span class="hl-0">));</span><br/><br/><span class="hl-8">// Prints: ok boom</span>
812 </code><button>Copy</button></pre>
813 <p>An <code>AbortSignal</code> can be used to cancel waiting for the event:</p>
814 <pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0">, </span><span class="hl-3">once</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ac</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">AbortController</span><span class="hl-0">();</span><br/><br/><span class="hl-4">async</span><span class="hl-0"> </span><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">foo</span><span class="hl-0">(</span><span class="hl-3">emitter</span><span class="hl-0">, </span><span class="hl-3">event</span><span class="hl-0">, </span><span class="hl-3">signal</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-5">try</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-3">emitter</span><span class="hl-0">, </span><span class="hl-3">event</span><span class="hl-0">, { </span><span class="hl-3">signal</span><span class="hl-0"> });</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;event emitted!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> } </span><span class="hl-5">catch</span><span class="hl-0"> (</span><span class="hl-3">error</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-5">if</span><span class="hl-0"> (</span><span class="hl-3">error</span><span class="hl-0">.</span><span class="hl-3">name</span><span class="hl-0"> === </span><span class="hl-6">&#39;AbortError&#39;</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">error</span><span class="hl-0">(</span><span class="hl-6">&#39;Waiting for the event was canceled!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> } </span><span class="hl-5">else</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">error</span><span class="hl-0">(</span><span class="hl-6">&#39;There was an error&#39;</span><span class="hl-0">, </span><span class="hl-3">error</span><span class="hl-0">.</span><span class="hl-3">message</span><span class="hl-0">);</span><br/><span class="hl-0"> }</span><br/><span class="hl-0"> }</span><br/><span class="hl-0">}</span><br/><br/><span class="hl-2">foo</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-3">ac</span><span class="hl-0">.</span><span class="hl-3">signal</span><span class="hl-0">);</span><br/><span class="hl-3">ac</span><span class="hl-0">.</span><span class="hl-2">abort</span><span class="hl-0">(); </span><span class="hl-8">// Abort waiting for the event</span><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">); </span><span class="hl-8">// Prints: Waiting for the event was canceled!</span>
815 </code><button>Copy</button></pre>
816 </div>
817 <div class="tsd-parameters">
818 <h4 class="tsd-parameters-title">Parameters</h4>
819 <ul class="tsd-parameter-list">
820 <li>
821 <h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">_NodeEventTarget</span></h5></li>
822 <li>
823 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li>
824 <li>
825 <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type ">StaticEventEmitterOptions</span></h5></li></ul></div>
826 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4>
827 <div class="tsd-comment tsd-typography">
828 <h4>Since</h4><p>v11.13.0, v10.16.0</p>
829 </div><aside class="tsd-sources">
830 <p>Inherited from EventEmitter.once</p>
831 <ul>
832 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:189</li></ul></aside></li>
833 <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">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span><a href="#once-2.once-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
834 <li class="tsd-description">
835 <div class="tsd-parameters">
836 <h4 class="tsd-parameters-title">Parameters</h4>
837 <ul class="tsd-parameter-list">
838 <li>
839 <h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">_DOMEventTarget</span></h5></li>
840 <li>
841 <h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span></h5></li>
842 <li>
843 <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type ">StaticEventEmitterOptions</span></h5></li></ul></div>
844 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
845 <p>Inherited from EventEmitter.once</p>
846 <ul>
847 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:190</li></ul></aside></li></ul></section>
848 <section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="setMaxListeners-2" class="tsd-anchor"></a>
849 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
850 <ul class="tsd-signatures tsd-is-inherited tsd-is-external">
851 <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 viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
852 <li class="tsd-description">
853 <div class="tsd-comment tsd-typography"><pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">setMaxListeners</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">target</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventTarget</span><span class="hl-0">();</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">emitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-1">5</span><span class="hl-0">, </span><span class="hl-3">target</span><span class="hl-0">, </span><span class="hl-3">emitter</span><span class="hl-0">);</span>
854 </code><button>Copy</button></pre>
855 </div>
856 <div class="tsd-parameters">
857 <h4 class="tsd-parameters-title">Parameters</h4>
858 <ul class="tsd-parameter-list">
859 <li>
860 <h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">n</span>: <span class="tsd-signature-type">number</span></h5>
861 <div class="tsd-comment tsd-typography"><p>A non-negative number. The maximum number of listeners per <code>EventTarget</code> event.</p>
862 </div>
863 <div class="tsd-comment tsd-typography"></div></li>
864 <li>
865 <h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">eventTargets</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-type ">EventEmitter</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">_DOMEventTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
866 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
867 <div class="tsd-comment tsd-typography">
868 <h4>Since</h4><p>v15.4.0</p>
869 </div><aside class="tsd-sources">
870 <p>Inherited from EventEmitter.setMaxListeners</p>
871 <ul>
872 <li>Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/events.d.ts:340</li></ul></aside></li></ul></section></section></div>
873 <div class="col-sidebar">
874 <div class="page-menu">
875 <div class="tsd-navigation settings">
876 <details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
877 <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>Settings</h3></summary>
878 <div class="tsd-accordion-details">
879 <div class="tsd-filter-visibility">
880 <h4 class="uppercase">Member Visibility</h4><form>
881 <ul id="tsd-filter-options">
882 <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><use href="#icon-checkbox"></use></svg><span>Protected</span></label></li>
883 <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><use href="#icon-checkbox"></use></svg><span>Private</span></label></li>
884 <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><use href="#icon-checkbox"></use></svg><span>Inherited</span></label></li>
885 <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><use href="#icon-checkbox"></use></svg><span>External</span></label></li></ul></form></div>
886 <div class="tsd-theme-toggle">
887 <h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
888 <details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary">
889 <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>On This Page</h3></summary>
890 <div class="tsd-accordion-details">
891 <ul>
892 <li><a href="#constructor" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-512"></use></svg><span>constructor</span></a></li>
893 <li><a href="#captureRejectionSymbol" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>capture<wbr/>Rejection<wbr/>Symbol</span></a></li>
894 <li><a href="#captureRejections" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>capture<wbr/>Rejections</span></a></li>
895 <li><a href="#defaultMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>default<wbr/>Max<wbr/>Listeners</span></a></li>
896 <li><a href="#errorMonitor" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>error<wbr/>Monitor</span></a></li>
897 <li><a href="#addListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>add<wbr/>Listener</span></a></li>
898 <li><a href="#emit" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>emit</span></a></li>
899 <li><a href="#eventNames" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>event<wbr/>Names</span></a></li>
900 <li><a href="#getMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a></li>
901 <li><a href="#listenerCount" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listener<wbr/>Count</span></a></li>
902 <li><a href="#listeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listeners</span></a></li>
903 <li><a href="#off" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>off</span></a></li>
904 <li><a href="#on" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>on</span></a></li>
905 <li><a href="#once" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>once</span></a></li>
906 <li><a href="#prependListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>prepend<wbr/>Listener</span></a></li>
907 <li><a href="#prependOnceListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>prepend<wbr/>Once<wbr/>Listener</span></a></li>
908 <li><a href="#rawListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>raw<wbr/>Listeners</span></a></li>
909 <li><a href="#removeAllListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Listeners</span></a></li>
910 <li><a href="#removeListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>Listener</span></a></li>
911 <li><a href="#setMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a></li>
912 <li><a href="#addAbortListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>add<wbr/>Abort<wbr/>Listener</span></a></li>
913 <li><a href="#getEventListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Event<wbr/>Listeners</span></a></li>
914 <li><a href="#getMaxListeners-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a></li>
915 <li><a href="#listenerCount-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listener<wbr/>Count</span></a></li>
916 <li><a href="#on-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>on</span></a></li>
917 <li><a href="#once-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>once</span></a></li>
918 <li><a href="#setMaxListeners-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a></li></ul></div></details></div>
919 <div class="site-menu">
920 <nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1"></use></svg><span>poolifier - v2.7.0</span></a>
921 <ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="..">
922 <li><a href="AbstractPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>AbstractPool</a></li>
923 <li><a href="AbstractWorker.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>AbstractWorker</a></li>
924 <li><a href="CircularArray.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>CircularArray</a></li>
925 <li><a href="ClusterWorker.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>ClusterWorker</a></li>
926 <li><a href="Deque.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>Deque</a></li>
927 <li><a href="DynamicClusterPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>DynamicClusterPool</a></li>
928 <li><a href="DynamicThreadPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>DynamicThreadPool</a></li>
929 <li><a href="FixedClusterPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>FixedClusterPool</a></li>
930 <li><a href="FixedThreadPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>FixedThreadPool</a></li>
931 <li><a href="Node.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>Node</a></li>
932 <li><a href="PoolEmitter.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>PoolEmitter</a></li>
933 <li><a href="ThreadWorker.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>ThreadWorker</a></li>
934 <li><a href="WorkerChoiceStrategyContext.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>WorkerChoiceStrategyContext</a></li>
935 <li><a href="../interfaces/ClusterPoolOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>ClusterPoolOptions</a></li>
936 <li><a href="../interfaces/EventLoopUtilizationMeasurementStatistics.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>EventLoopUtilizationMeasurementStatistics</a></li>
937 <li><a href="../interfaces/IPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>IPool</a></li>
938 <li><a href="../interfaces/IWorker.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>IWorker</a></li>
939 <li><a href="../interfaces/IWorkerChoiceStrategy.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>IWorkerChoiceStrategy</a></li>
940 <li><a href="../interfaces/IWorkerNode.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>IWorkerNode</a></li>
941 <li><a href="../interfaces/MeasurementOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>MeasurementOptions</a></li>
942 <li><a href="../interfaces/MeasurementStatistics.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>MeasurementStatistics</a></li>
943 <li>Loading...</li></ul></nav></div></div></div>
944 <div class="tsd-generator">
945 <p>Generated using <a href="https://typedoc.org/" rel="noopener" target="_blank">TypeDoc</a></p></div>
946 <div class="overlay"></div><svg style="display: none"><g id="icon-1"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g><g id="icon-2"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g><g id="icon-16"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-32"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z" fill="var(--color-text)"></path></g><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g><g id="icon-512"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-2048"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g><g id="icon-4096"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g><g id="icon-8192"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-16384"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-32768"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-65536"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-131072"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-262144"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-524288"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-1048576"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="#FF4D82" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M10.354 17V8.24H13.066C13.586 8.24 14.042 8.348 14.434 8.564C14.826 8.772 15.13 9.064 15.346 9.44C15.562 9.816 15.67 10.256 15.67 10.76C15.67 11.352 15.514 11.86 15.202 12.284C14.898 12.708 14.482 13 13.954 13.16L15.79 17H14.518L12.838 13.28H11.434V17H10.354ZM11.434 12.308H13.066C13.514 12.308 13.874 12.168 14.146 11.888C14.418 11.6 14.554 11.224 14.554 10.76C14.554 10.288 14.418 9.912 14.146 9.632C13.874 9.352 13.514 9.212 13.066 9.212H11.434V12.308Z" fill="var(--color-text)"></path></g><g id="icon-chevronDown"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></g><g id="icon-chevronSmall"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></g><g id="icon-checkbox"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></g><g id="icon-menu"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></g><g id="icon-search"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></g><g id="icon-anchor"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></g></svg></body></html>