|
36 | 36 | */
|
37 | 37 | declare module "events" {
|
38 | 38 | import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
39 |
| - // NOTE: This class is in the docs but is **not actually exported** by Node. |
40 |
| - // If https://github.com/nodejs/node/issues/39903 gets resolved and Node |
41 |
| - // actually starts exporting the class, uncomment below. |
42 |
| - // import { EventListener, EventListenerObject } from '__dom-events'; |
43 |
| - // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ |
44 |
| - // interface NodeEventTarget extends EventTarget { |
45 |
| - // /** |
46 |
| - // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. |
47 |
| - // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. |
48 |
| - // */ |
49 |
| - // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; |
50 |
| - // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ |
51 |
| - // eventNames(): string[]; |
52 |
| - // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ |
53 |
| - // listenerCount(type: string): number; |
54 |
| - // /** Node.js-specific alias for `eventTarget.removeListener()`. */ |
55 |
| - // off(type: string, listener: EventListener | EventListenerObject): this; |
56 |
| - // /** Node.js-specific alias for `eventTarget.addListener()`. */ |
57 |
| - // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; |
58 |
| - // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ |
59 |
| - // once(type: string, listener: EventListener | EventListenerObject): this; |
60 |
| - // /** |
61 |
| - // * Node.js-specific extension to the `EventTarget` class. |
62 |
| - // * If `type` is specified, removes all registered listeners for `type`, |
63 |
| - // * otherwise removes all registered listeners. |
64 |
| - // */ |
65 |
| - // removeAllListeners(type: string): this; |
66 |
| - // /** |
67 |
| - // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. |
68 |
| - // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. |
69 |
| - // */ |
70 |
| - // removeListener(type: string, listener: EventListener | EventListenerObject): this; |
71 |
| - // } |
72 | 39 | interface EventEmitterOptions {
|
73 | 40 | /**
|
74 | 41 | * Enables automatic capturing of promise rejection.
|
|
0 commit comments