Skip to content

Commit 75fcf53

Browse files
ameliavoncatitaloacasas
authored andcommitted
doc: missing argument types for events methods
Refs: #9399 PR-URL: #11802 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Brian White <[email protected]>
1 parent ae52b63 commit 75fcf53

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

doc/api/events.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ added and `'removeListener'` when existing listeners are removed.
185185
added: v0.1.26
186186
-->
187187

188-
* `eventName` {string|symbol} The name of the event being listened for
188+
* `eventName` {any} The name of the event being listened for
189189
* `listener` {Function} The event handler function
190190

191191
The `EventEmitter` instance will emit its own `'newListener'` event *before*
@@ -229,7 +229,7 @@ changes:
229229
now yields the original listener function.
230230
-->
231231

232-
* `eventName` {string|symbol} The event name
232+
* `eventName` {any} The event name
233233
* `listener` {Function} The event handler function
234234

235235
The `'removeListener'` event is emitted *after* the `listener` is removed.
@@ -296,13 +296,17 @@ Its `name` property is set to `'MaxListenersExceededWarning'`.
296296
<!-- YAML
297297
added: v0.1.26
298298
-->
299+
- `eventName` {any}
300+
- `listener` {Function}
299301

300302
Alias for `emitter.on(eventName, listener)`.
301303

302304
### emitter.emit(eventName[, ...args])
303305
<!-- YAML
304306
added: v0.1.26
305307
-->
308+
- `eventName` {any}
309+
- `...args` {any}
306310

307311
Synchronously calls each of the listeners registered for the event named
308312
`eventName`, in the order they were registered, passing the supplied arguments
@@ -345,7 +349,7 @@ set by [`emitter.setMaxListeners(n)`][] or defaults to
345349
added: v3.2.0
346350
-->
347351

348-
* `eventName` {string|symbol} The name of the event being listened for
352+
* `eventName` {any} The name of the event being listened for
349353

350354
Returns the number of listeners listening to the event named `eventName`.
351355

@@ -358,6 +362,7 @@ changes:
358362
description: For listeners attached using `.once()` this returns the
359363
original listeners instead of wrapper functions now.
360364
-->
365+
- `eventName` {any}
361366

362367
Returns a copy of the array of listeners for the event named `eventName`.
363368

@@ -374,7 +379,7 @@ console.log(util.inspect(server.listeners('connection')));
374379
added: v0.1.101
375380
-->
376381

377-
* `eventName` {string|symbol} The name of the event.
382+
* `eventName` {any} The name of the event.
378383
* `listener` {Function} The callback function
379384

380385
Adds the `listener` function to the end of the listeners array for the
@@ -410,7 +415,7 @@ myEE.emit('foo');
410415
added: v0.3.0
411416
-->
412417

413-
* `eventName` {string|symbol} The name of the event.
418+
* `eventName` {any} The name of the event.
414419
* `listener` {Function} The callback function
415420

416421
Adds a **one time** `listener` function for the event named `eventName`. The
@@ -443,7 +448,7 @@ myEE.emit('foo');
443448
added: v6.0.0
444449
-->
445450

446-
* `eventName` {string|symbol} The name of the event.
451+
* `eventName` {any} The name of the event.
447452
* `listener` {Function} The callback function
448453

449454
Adds the `listener` function to the *beginning* of the listeners array for the
@@ -465,7 +470,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
465470
added: v6.0.0
466471
-->
467472

468-
* `eventName` {string|symbol} The name of the event.
473+
* `eventName` {any} The name of the event.
469474
* `listener` {Function} The callback function
470475

471476
Adds a **one time** `listener` function for the event named `eventName` to the
@@ -484,6 +489,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
484489
<!-- YAML
485490
added: v0.1.26
486491
-->
492+
- `eventName` {any}
487493

488494
Removes all listeners, or those of the specified `eventName`.
489495

@@ -497,6 +503,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
497503
<!-- YAML
498504
added: v0.1.26
499505
-->
506+
- `eventName` {any}
507+
- `listener` {Function}
500508

501509
Removes the specified `listener` from the listener array for the event named
502510
`eventName`.
@@ -564,6 +572,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
564572
<!-- YAML
565573
added: v0.3.5
566574
-->
575+
- `n` {integer}
567576

568577
By default EventEmitters will print a warning if more than `10` listeners are
569578
added for a particular event. This is a useful default that helps finding

0 commit comments

Comments
 (0)