@types/node 20.14.8 → 20.14.10

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.
Files changed (4) hide show
  1. node/README.md +1 -1
  2. node/events.d.ts +11 -27
  3. node/package.json +3 -3
  4. node/test.d.ts +11 -0
node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (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: Sat, 22 Jun 2024 07:35:32 GMT
11
+ * Last updated: Fri, 05 Jul 2024 19:07:00 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/events.d.ts CHANGED
@@ -80,39 +80,24 @@ declare module "events" {
80
80
  * Can be used to cancel awaiting events.
81
81
  */
82
82
  signal?: AbortSignal | undefined;
83
- /**
84
- * Names of events that will end the iteration.
85
- */
86
- close?: string[] | undefined;
87
- /**
88
- * The high watermark. The emitter is paused every time the size
89
- * of events being buffered is higher than it. Supported only
90
- * on emitters implementing `pause()` and `resume()` methods.
91
- * @default `Number.MAX_SAFE_INTEGER`
92
- */
93
- highWaterMark?: number | undefined;
94
- /**
95
- * The low watermark. The emitter is resumed every time the size of events being buffered
96
- * is lower than it. Supported only on emitters implementing `pause()` and `resume()` methods.
97
- * @default 1
98
- */
99
- lowWaterMark?: number | undefined;
100
83
  }
101
84
  interface StaticEventEmitterIteratorOptions extends StaticEventEmitterOptions {
102
85
  /**
103
86
  * Names of events that will end the iteration.
104
87
  */
105
- close?: string[];
88
+ close?: string[] | undefined;
106
89
  /**
107
- * The emitter is paused every time the size of events being buffered is higher than it. Supported only on emitters implementing pause() and resume() methods.
90
+ * The high watermark. The emitter is paused every time the size of events being buffered is higher than it.
91
+ * Supported only on emitters implementing `pause()` and `resume()` methods.
108
92
  * @default Number.MAX_SAFE_INTEGER
109
93
  */
110
- highWaterMark?: number;
94
+ highWaterMark?: number | undefined;
111
95
  /**
112
- * The emitter is resumed every time the size of events being buffered is lower than it. Supported only on emitters implementing pause() and resume() methods.
96
+ * The low watermark. The emitter is resumed every time the size of events being buffered is lower than it.
97
+ * Supported only on emitters implementing `pause()` and `resume()` methods.
113
98
  * @default 1
114
99
  */
115
- lowWaterMark?: number;
100
+ lowWaterMark?: number | undefined;
116
101
  }
117
102
  interface EventEmitter<T extends EventMap<T> = DefaultEventMap> extends NodeJS.EventEmitter<T> {}
118
103
  type EventMap<T> = Record<keyof T, any[]> | DefaultEventMap;
@@ -232,7 +217,7 @@ declare module "events" {
232
217
  static once(
233
218
  emitter: NodeJS.EventEmitter,
234
219
  eventName: string | symbol,
235
- options?: Pick<StaticEventEmitterOptions, "signal">,
220
+ options?: StaticEventEmitterOptions,
236
221
  ): Promise<any[]>;
237
222
  static once(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
238
223
  /**
@@ -313,19 +298,18 @@ declare module "events" {
313
298
  * console.log('done'); // prints 'done'
314
299
  * ```
315
300
  * @since v13.6.0, v12.16.0
316
- * @param eventName The name of the event being listened for
317
301
  * @return An `AsyncIterator` that iterates `eventName` events emitted by the `emitter`
318
302
  */
319
303
  static on(
320
304
  emitter: NodeJS.EventEmitter,
321
305
  eventName: string | symbol,
322
- options?: StaticEventEmitterOptions,
323
- ): AsyncIterableIterator<any>;
306
+ options?: StaticEventEmitterIteratorOptions,
307
+ ): AsyncIterableIterator<any[]>;
324
308
  static on(
325
309
  emitter: EventTarget,
326
310
  eventName: string,
327
311
  options?: StaticEventEmitterIteratorOptions,
328
- ): AsyncIterableIterator<any>;
312
+ ): AsyncIterableIterator<any[]>;
329
313
  /**
330
314
  * A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`.
331
315
  *
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.14.8",
3
+ "version": "20.14.10",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -212,6 +212,6 @@
212
212
  "dependencies": {
213
213
  "undici-types": "~5.26.4"
214
214
  },
215
- "typesPublisherContentHash": "7f1c7cbbd4b01202220b325496b6a96822975f892d3eb44558ea7ffcf74ae32c",
216
- "typeScriptVersion": "4.7"
215
+ "typesPublisherContentHash": "b17c0002475911f007185cf574aab21231670287a5241042fb3697a72c3d2ce3",
216
+ "typeScriptVersion": "4.8"
217
217
  }
node/test.d.ts CHANGED
@@ -941,6 +941,17 @@ declare module "node:test" {
941
941
  * @since v19.1.0, v18.13.0
942
942
  */
943
943
  restoreAll(): void;
944
+ /**
945
+ * This function is used to mock the exports of ECMAScript modules,
946
+ * CommonJS modules, and Node.js builtin modules. Any references to
947
+ * the original module prior to mocking are not impacted
948
+ * @since v22.3.0
949
+ */
950
+ module(speficier: string, options?: {
951
+ cache?: boolean;
952
+ defaultExport?: any;
953
+ namedExports?: object;
954
+ }): { restore: () => void };
944
955
  timers: MockTimers;
945
956
  }
946
957
  const mock: MockTracker;