@types/node 17.0.10 → 17.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node/README.md +1 -1
- node/events.d.ts +31 -3
- node/package.json +2 -2
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated: Tue,
|
|
11
|
+
* Last updated: Tue, 25 Jan 2022 00:31:34 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
|
14
14
|
|
node/events.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ declare module 'events' {
|
|
|
50
50
|
listener: (...args: any[]) => void,
|
|
51
51
|
opts?: {
|
|
52
52
|
once: boolean;
|
|
53
|
-
}
|
|
53
|
+
},
|
|
54
54
|
): any;
|
|
55
55
|
}
|
|
56
56
|
interface StaticEventEmitterOptions {
|
|
@@ -154,7 +154,11 @@ declare module 'events' {
|
|
|
154
154
|
* ```
|
|
155
155
|
* @since v11.13.0, v10.16.0
|
|
156
156
|
*/
|
|
157
|
-
static once(
|
|
157
|
+
static once(
|
|
158
|
+
emitter: NodeEventTarget,
|
|
159
|
+
eventName: string | symbol,
|
|
160
|
+
options?: StaticEventEmitterOptions,
|
|
161
|
+
): Promise<any[]>;
|
|
158
162
|
static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
159
163
|
/**
|
|
160
164
|
* ```js
|
|
@@ -214,7 +218,11 @@ declare module 'events' {
|
|
|
214
218
|
* @param eventName The name of the event being listened for
|
|
215
219
|
* @return that iterates `eventName` events emitted by the `emitter`
|
|
216
220
|
*/
|
|
217
|
-
static on(
|
|
221
|
+
static on(
|
|
222
|
+
emitter: NodeJS.EventEmitter,
|
|
223
|
+
eventName: string,
|
|
224
|
+
options?: StaticEventEmitterOptions,
|
|
225
|
+
): AsyncIterableIterator<any>;
|
|
218
226
|
/**
|
|
219
227
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
|
220
228
|
*
|
|
@@ -260,6 +268,26 @@ declare module 'events' {
|
|
|
260
268
|
* @since v15.2.0, v14.17.0
|
|
261
269
|
*/
|
|
262
270
|
static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
|
271
|
+
/**
|
|
272
|
+
* By default `EventEmitter`s will print a warning if more than `10` listeners are
|
|
273
|
+
* added for a particular event. This is a useful default that helps finding
|
|
274
|
+
* memory leaks. The `EventEmitter.setMaxListeners()` method allows the default limit to be
|
|
275
|
+
* modified (if eventTargets is empty) or modify the limit specified in every `EventTarget` | `EventEmitter` passed as arguments.
|
|
276
|
+
* The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
|
|
277
|
+
*
|
|
278
|
+
* ```js
|
|
279
|
+
* EventEmitter.setMaxListeners(20);
|
|
280
|
+
* // Equivalent to
|
|
281
|
+
* EventEmitter.defaultMaxListeners = 20;
|
|
282
|
+
*
|
|
283
|
+
* const eventTarget = new EventTarget();
|
|
284
|
+
* // Only way to increase limit for `EventTarget` instances
|
|
285
|
+
* // as these doesn't expose its own `setMaxListeners` method
|
|
286
|
+
* EventEmitter.setMaxListeners(20, eventTarget);
|
|
287
|
+
* ```
|
|
288
|
+
* @since v15.3.0, v14.17.0
|
|
289
|
+
*/
|
|
290
|
+
static setMaxListeners(n?: number, ...eventTargets: Array<DOMEventTarget | NodeJS.EventEmitter>): void;
|
|
263
291
|
/**
|
|
264
292
|
* This symbol shall be used to install a listener for only monitoring `'error'`
|
|
265
293
|
* events. Listeners installed using this symbol are called before the regular
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.11",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -220,6 +220,6 @@
|
|
|
220
220
|
},
|
|
221
221
|
"scripts": {},
|
|
222
222
|
"dependencies": {},
|
|
223
|
-
"typesPublisherContentHash": "
|
|
223
|
+
"typesPublisherContentHash": "8580d62fb3d2cb40ddc4d673d1b7468a080dd6c8a7c04a6fef13bcfffc3505c0",
|
|
224
224
|
"typeScriptVersion": "3.8"
|
|
225
225
|
}
|