@types/node 14.14.37 → 14.14.41
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/globals.d.ts +1 -1
- node/http.d.ts +1 -0
- node/package.json +2 -2
- node/process.d.ts +42 -1
- node/stream.d.ts +116 -27
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:
|
|
11
|
+
* Last updated: Thu, 15 Apr 2021 17:31:22 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/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/http.d.ts
CHANGED
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "14.14.
|
|
3
|
+
"version": "14.14.41",
|
|
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": "
|
|
234
|
+
"typesPublisherContentHash": "1c2c72fafede518d2e474f285ec2091342f1c8aa4b3da3448931e76fbf219fe6",
|
|
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
|
-
|
|
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
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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__
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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,
|