@types/node 14.14.36 → 14.14.40

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 CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (http://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: Thu, 25 Mar 2021 18:01:17 GMT
11
+ * Last updated: Thu, 15 Apr 2021 14:01:21 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
node/async_hooks.d.ts CHANGED
@@ -151,7 +151,7 @@ declare module 'async_hooks' {
151
151
  /**
152
152
  * Call AsyncHooks destroy callbacks.
153
153
  */
154
- emitDestroy(): void;
154
+ emitDestroy(): this;
155
155
 
156
156
  /**
157
157
  * @return the unique ID assigned to this AsyncResource instance.
node/globals.d.ts CHANGED
@@ -71,7 +71,7 @@ declare var module: NodeModule;
71
71
  declare var exports: any;
72
72
 
73
73
  // Buffer class
74
- type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
74
+ type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex";
75
75
 
76
76
  type WithImplicitCoercion<T> = T | { valueOf(): T };
77
77
 
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.14.36",
3
+ "version": "14.14.40",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -231,6 +231,6 @@
231
231
  },
232
232
  "scripts": {},
233
233
  "dependencies": {},
234
- "typesPublisherContentHash": "7fc7a1ccd5ac4abb012f999b235b462bc8835d81eed319cb4555a0fba9731e85",
234
+ "typesPublisherContentHash": "821dd4f0f2c8e208803c501a018c6bd50b64d593c49fecd33fadde910f559d4a",
235
235
  "typeScriptVersion": "3.5"
236
236
  }
node/process.d.ts CHANGED
@@ -175,6 +175,32 @@ declare module 'process' {
175
175
  voluntaryContextSwitches: number;
176
176
  }
177
177
 
178
+ interface EmitWarningOptions {
179
+ /**
180
+ * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted.
181
+ *
182
+ * @default 'Warning'
183
+ */
184
+ type?: string;
185
+
186
+ /**
187
+ * A unique identifier for the warning instance being emitted.
188
+ */
189
+ code?: string;
190
+
191
+ /**
192
+ * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
193
+ *
194
+ * @default process.emitWarning
195
+ */
196
+ ctor?: Function;
197
+
198
+ /**
199
+ * Additional text to include with the error.
200
+ */
201
+ detail?: string;
202
+ }
203
+
178
204
  interface Process extends EventEmitter {
179
205
  /**
180
206
  * Can also be a tty.WriteStream, not typed due to limitations.
@@ -200,7 +226,22 @@ declare module 'process' {
200
226
  chdir(directory: string): void;
201
227
  cwd(): string;
202
228
  debugPort: number;
203
- emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
229
+
230
+ /**
231
+ * The `process.emitWarning()` method can be used to emit custom or application specific process warnings.
232
+ *
233
+ * These can be listened for by adding a handler to the `'warning'` event.
234
+ *
235
+ * @param warning The warning to emit.
236
+ * @param type When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. Default: `'Warning'`.
237
+ * @param code A unique identifier for the warning instance being emitted.
238
+ * @param ctor When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. Default: `process.emitWarning`.
239
+ */
240
+ emitWarning(warning: string | Error, ctor?: Function): void;
241
+ emitWarning(warning: string | Error, type?: string, ctor?: Function): void;
242
+ emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void;
243
+ emitWarning(warning: string | Error, options?: EmitWarningOptions): void;
244
+
204
245
  env: ProcessEnv;
205
246
  exit(code?: number): never;
206
247
  exitCode?: number;
node/stream.d.ts CHANGED
@@ -302,23 +302,76 @@ declare module 'stream' {
302
302
  function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
303
303
  }
304
304
 
305
- function pipeline<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: T, callback?: (err: NodeJS.ErrnoException | null) => void): T;
306
- function pipeline<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T, callback?: (err: NodeJS.ErrnoException | null) => void): T;
307
- function pipeline<T extends NodeJS.WritableStream>(
308
- stream1: NodeJS.ReadableStream,
309
- stream2: NodeJS.ReadWriteStream,
310
- stream3: NodeJS.ReadWriteStream,
311
- stream4: T,
312
- callback?: (err: NodeJS.ErrnoException | null) => void,
313
- ): T;
314
- function pipeline<T extends NodeJS.WritableStream>(
315
- stream1: NodeJS.ReadableStream,
316
- stream2: NodeJS.ReadWriteStream,
317
- stream3: NodeJS.ReadWriteStream,
318
- stream4: NodeJS.ReadWriteStream,
319
- stream5: T,
320
- callback?: (err: NodeJS.ErrnoException | null) => void,
321
- ): T;
305
+ type PipelineSourceFunction<T> = () => Iterable<T> | AsyncIterable<T>;
306
+ type PipelineSource<T> = Iterable<T> | AsyncIterable<T> | NodeJS.ReadableStream | PipelineSourceFunction<T>;
307
+ type PipelineTransform<S extends PipelineTransformSource<any>, U> =
308
+ NodeJS.ReadWriteStream |
309
+ ((source: S extends (...args: any[]) => Iterable<infer ST> | AsyncIterable<infer ST> ?
310
+ AsyncIterable<ST> : S) => AsyncIterable<U>);
311
+ type PipelineTransformSource<T> = PipelineSource<T> | PipelineTransform<any, T>;
312
+
313
+ type PipelineDestinationIterableFunction<T> = (source: AsyncIterable<T>) => AsyncIterable<any>;
314
+ type PipelineDestinationPromiseFunction<T, P> = (source: AsyncIterable<T>) => Promise<P>;
315
+
316
+ type PipelineDestination<S extends PipelineTransformSource<any>, P> =
317
+ S extends PipelineTransformSource<infer ST> ?
318
+ (NodeJS.WritableStream | PipelineDestinationIterableFunction<ST> | PipelineDestinationPromiseFunction<ST, P>) : never;
319
+ type PipelineCallback<S extends PipelineDestination<any, any>> =
320
+ S extends PipelineDestinationPromiseFunction<any, infer P> ? (err: NodeJS.ErrnoException | null, value: P) => void :
321
+ (err: NodeJS.ErrnoException | null) => void;
322
+ type PipelinePromise<S extends PipelineDestination<any, any>> =
323
+ S extends PipelineDestinationPromiseFunction<any, infer P> ? Promise<P> : Promise<void>;
324
+
325
+ function pipeline<A extends PipelineSource<any>,
326
+ B extends PipelineDestination<A, any>>(
327
+ source: A,
328
+ destination: B,
329
+ callback?: PipelineCallback<B>
330
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
331
+ function pipeline<A extends PipelineSource<any>,
332
+ T1 extends PipelineTransform<A, any>,
333
+ B extends PipelineDestination<T1, any>>(
334
+ source: A,
335
+ transform1: T1,
336
+ destination: B,
337
+ callback?: PipelineCallback<B>
338
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
339
+ function pipeline<A extends PipelineSource<any>,
340
+ T1 extends PipelineTransform<A, any>,
341
+ T2 extends PipelineTransform<T1, any>,
342
+ B extends PipelineDestination<T2, any>>(
343
+ source: A,
344
+ transform1: T1,
345
+ transform2: T2,
346
+ destination: B,
347
+ callback?: PipelineCallback<B>
348
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
349
+ function pipeline<A extends PipelineSource<any>,
350
+ T1 extends PipelineTransform<A, any>,
351
+ T2 extends PipelineTransform<T1, any>,
352
+ T3 extends PipelineTransform<T2, any>,
353
+ B extends PipelineDestination<T3, any>>(
354
+ source: A,
355
+ transform1: T1,
356
+ transform2: T2,
357
+ transform3: T3,
358
+ destination: B,
359
+ callback?: PipelineCallback<B>
360
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
361
+ function pipeline<A extends PipelineSource<any>,
362
+ T1 extends PipelineTransform<A, any>,
363
+ T2 extends PipelineTransform<T1, any>,
364
+ T3 extends PipelineTransform<T2, any>,
365
+ T4 extends PipelineTransform<T3, any>,
366
+ B extends PipelineDestination<T4, any>>(
367
+ source: A,
368
+ transform1: T1,
369
+ transform2: T2,
370
+ transform3: T3,
371
+ transform4: T4,
372
+ destination: B,
373
+ callback?: PipelineCallback<B>
374
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
322
375
  function pipeline(
323
376
  streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
324
377
  callback?: (err: NodeJS.ErrnoException | null) => void,
@@ -329,16 +382,52 @@ declare module 'stream' {
329
382
  ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void)>,
330
383
  ): NodeJS.WritableStream;
331
384
  namespace pipeline {
332
- function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.WritableStream): Promise<void>;
333
- function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.WritableStream): Promise<void>;
334
- function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.WritableStream): Promise<void>;
335
- function __promisify__(
336
- stream1: NodeJS.ReadableStream,
337
- stream2: NodeJS.ReadWriteStream,
338
- stream3: NodeJS.ReadWriteStream,
339
- stream4: NodeJS.ReadWriteStream,
340
- stream5: NodeJS.WritableStream,
341
- ): Promise<void>;
385
+ function __promisify__<A extends PipelineSource<any>,
386
+ B extends PipelineDestination<A, any>>(
387
+ source: A,
388
+ destination: B
389
+ ): PipelinePromise<B>;
390
+ function __promisify__<A extends PipelineSource<any>,
391
+ T1 extends PipelineTransform<A, any>,
392
+ B extends PipelineDestination<T1, any>>(
393
+ source: A,
394
+ transform1: T1,
395
+ destination: B
396
+ ): PipelinePromise<B>;
397
+ function __promisify__<A extends PipelineSource<any>,
398
+ T1 extends PipelineTransform<A, any>,
399
+ T2 extends PipelineTransform<T1, any>,
400
+ B extends PipelineDestination<T2, any>>(
401
+ source: A,
402
+ transform1: T1,
403
+ transform2: T2,
404
+ destination: B
405
+ ): PipelinePromise<B>;
406
+ function __promisify__<A extends PipelineSource<any>,
407
+ T1 extends PipelineTransform<A, any>,
408
+ T2 extends PipelineTransform<T1, any>,
409
+ T3 extends PipelineTransform<T2, any>,
410
+ B extends PipelineDestination<T3, any>>(
411
+ source: A,
412
+ transform1: T1,
413
+ transform2: T2,
414
+ transform3: T3,
415
+ destination: B
416
+ ): PipelinePromise<B>;
417
+ function __promisify__<A extends PipelineSource<any>,
418
+ T1 extends PipelineTransform<A, any>,
419
+ T2 extends PipelineTransform<T1, any>,
420
+ T3 extends PipelineTransform<T2, any>,
421
+ T4 extends PipelineTransform<T3, any>,
422
+ B extends PipelineDestination<T4, any>>(
423
+ source: A,
424
+ transform1: T1,
425
+ transform2: T2,
426
+ transform3: T3,
427
+ transform4: T4,
428
+ destination: B
429
+ ): PipelinePromise<B>;
430
+
342
431
  function __promisify__(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>): Promise<void>;
343
432
  function __promisify__(
344
433
  stream1: NodeJS.ReadableStream,
node/vm.d.ts CHANGED
@@ -99,6 +99,10 @@ declare module 'vm' {
99
99
  */
100
100
  wasm?: boolean;
101
101
  };
102
+ /**
103
+ * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
104
+ */
105
+ microtaskMode?: 'afterEvaluate';
102
106
  }
103
107
 
104
108
  type MeasureMemoryMode = 'summary' | 'detailed';