Skip to content

Commit 712848b

Browse files
aprilwebsterMylesBorins
authored andcommitted
doc: change eventName type annotations
Change type annotations for eventName in events API doc from {any} to {string|symbol}. PR-URL: #17666 Fixes: #17657 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent c24b4dd commit 712848b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

doc/api/events.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ added and `'removeListener'` when existing listeners are removed.
175175
added: v0.1.26
176176
-->
177177

178-
* `eventName` {any} The name of the event being listened for
178+
* `eventName` {string|symbol} The name of the event being listened for
179179
* `listener` {Function} The event handler function
180180

181181
The `EventEmitter` instance will emit its own `'newListener'` event *before*
@@ -219,7 +219,7 @@ changes:
219219
now yields the original listener function.
220220
-->
221221

222-
* `eventName` {any} The event name
222+
* `eventName` {string|symbol} The event name
223223
* `listener` {Function} The event handler function
224224

225225
The `'removeListener'` event is emitted *after* the `listener` is removed.
@@ -287,7 +287,7 @@ Its `name` property is set to `'MaxListenersExceededWarning'`.
287287
<!-- YAML
288288
added: v0.1.26
289289
-->
290-
- `eventName` {any}
290+
- `eventName` {string|symbol}
291291
- `listener` {Function}
292292

293293
Alias for `emitter.on(eventName, listener)`.
@@ -296,7 +296,7 @@ Alias for `emitter.on(eventName, listener)`.
296296
<!-- YAML
297297
added: v0.1.26
298298
-->
299-
- `eventName` {any}
299+
- `eventName` {string|symbol}
300300
- `...args` {any}
301301

302302
Synchronously calls each of the listeners registered for the event named
@@ -340,7 +340,7 @@ set by [`emitter.setMaxListeners(n)`][] or defaults to
340340
added: v3.2.0
341341
-->
342342

343-
* `eventName` {any} The name of the event being listened for
343+
* `eventName` {string|symbol} The name of the event being listened for
344344

345345
Returns the number of listeners listening to the event named `eventName`.
346346

@@ -353,7 +353,7 @@ changes:
353353
description: For listeners attached using `.once()` this returns the
354354
original listeners instead of wrapper functions now.
355355
-->
356-
- `eventName` {any}
356+
- `eventName` {string|symbol}
357357

358358
Returns a copy of the array of listeners for the event named `eventName`.
359359

@@ -370,7 +370,7 @@ console.log(util.inspect(server.listeners('connection')));
370370
added: v0.1.101
371371
-->
372372

373-
* `eventName` {any} The name of the event.
373+
* `eventName` {string|symbol} The name of the event.
374374
* `listener` {Function} The callback function
375375

376376
Adds the `listener` function to the end of the listeners array for the
@@ -406,7 +406,7 @@ myEE.emit('foo');
406406
added: v0.3.0
407407
-->
408408

409-
* `eventName` {any} The name of the event.
409+
* `eventName` {string|symbol} The name of the event.
410410
* `listener` {Function} The callback function
411411

412412
Adds a **one-time** `listener` function for the event named `eventName`. The
@@ -439,7 +439,7 @@ myEE.emit('foo');
439439
added: v6.0.0
440440
-->
441441

442-
* `eventName` {any} The name of the event.
442+
* `eventName` {string|symbol} The name of the event.
443443
* `listener` {Function} The callback function
444444

445445
Adds the `listener` function to the *beginning* of the listeners array for the
@@ -461,7 +461,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
461461
added: v6.0.0
462462
-->
463463

464-
* `eventName` {any} The name of the event.
464+
* `eventName` {string|symbol} The name of the event.
465465
* `listener` {Function} The callback function
466466

467467
Adds a **one-time** `listener` function for the event named `eventName` to the
@@ -480,7 +480,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
480480
<!-- YAML
481481
added: v0.1.26
482482
-->
483-
- `eventName` {any}
483+
- `eventName` {string|symbol}
484484

485485
Removes all listeners, or those of the specified `eventName`.
486486

@@ -494,7 +494,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
494494
<!-- YAML
495495
added: v0.1.26
496496
-->
497-
- `eventName` {any}
497+
- `eventName` {string|symbol}
498498
- `listener` {Function}
499499

500500
Removes the specified `listener` from the listener array for the event named
@@ -578,7 +578,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
578578
<!-- YAML
579579
added: REPLACEME
580580
-->
581-
- `eventName` {any}
581+
- `eventName` {string|symbol}
582582

583583
Returns a copy of the array of listeners for the event named `eventName`,
584584
including any wrappers (such as those created by `.once`).

0 commit comments

Comments
 (0)