@types/node 15.0.2 → 15.6.0
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/async_hooks.d.ts +2 -2
- node/child_process.d.ts +19 -8
- node/crypto.d.ts +186 -0
- node/diagnostic_channel.d.ts +34 -0
- node/events.d.ts +11 -0
- node/fs/promises.d.ts +6 -5
- node/fs.d.ts +43 -34
- node/globals.d.ts +4 -0
- node/http.d.ts +4 -2
- node/http2.d.ts +11 -6
- node/index.d.ts +1 -1
- node/net.d.ts +6 -4
- node/package.json +2 -2
- node/path.d.ts +10 -0
- node/perf_hooks.d.ts +7 -4
- node/process.d.ts +13 -1
- node/readline.d.ts +1 -0
- node/repl.d.ts +3 -3
- node/stream.d.ts +21 -13
- node/tls.d.ts +3 -0
- node/ts3.6/base.d.ts +2 -0
- node/util/types.d.ts +53 -0
- node/util.d.ts +68 -119
- node/v8.d.ts +11 -0
- node/vm.d.ts +1 -1
- node/worker_threads.d.ts +26 -3
node/http2.d.ts
CHANGED
|
@@ -466,7 +466,16 @@ declare module 'http2' {
|
|
|
466
466
|
origins?: string[];
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
interface HTTP2ServerCommon {
|
|
470
|
+
setTimeout(msec?: number, callback?: () => void): this;
|
|
471
|
+
/**
|
|
472
|
+
* Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values.
|
|
473
|
+
* Throws ERR_INVALID_ARG_TYPE for invalid settings argument.
|
|
474
|
+
*/
|
|
475
|
+
updateSettings(settings: Settings): void;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export interface Http2Server extends net.Server, HTTP2ServerCommon {
|
|
470
479
|
addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
|
471
480
|
addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
|
472
481
|
addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
@@ -514,11 +523,9 @@ declare module 'http2' {
|
|
|
514
523
|
prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
|
515
524
|
prependOnceListener(event: "timeout", listener: () => void): this;
|
|
516
525
|
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
517
|
-
|
|
518
|
-
setTimeout(msec?: number, callback?: () => void): this;
|
|
519
526
|
}
|
|
520
527
|
|
|
521
|
-
export interface Http2SecureServer extends tls.Server {
|
|
528
|
+
export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon {
|
|
522
529
|
addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
|
523
530
|
addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
|
524
531
|
addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
|
|
@@ -572,8 +579,6 @@ declare module 'http2' {
|
|
|
572
579
|
prependOnceListener(event: "timeout", listener: () => void): this;
|
|
573
580
|
prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
|
574
581
|
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
575
|
-
|
|
576
|
-
setTimeout(msec?: number, callback?: () => void): this;
|
|
577
582
|
}
|
|
578
583
|
|
|
579
584
|
export class Http2ServerRequest extends stream.Readable {
|
node/index.d.ts
CHANGED
node/net.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare module 'net' {
|
|
2
2
|
import * as stream from 'stream';
|
|
3
|
-
import EventEmitter
|
|
3
|
+
import { Abortable, EventEmitter } from 'events';
|
|
4
4
|
import * as dns from 'dns';
|
|
5
5
|
|
|
6
6
|
type LookupFunction = (
|
|
@@ -168,7 +168,7 @@ declare module 'net' {
|
|
|
168
168
|
prependOnceListener(event: "timeout", listener: () => void): this;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
interface ListenOptions {
|
|
171
|
+
interface ListenOptions extends Abortable {
|
|
172
172
|
port?: number;
|
|
173
173
|
host?: string;
|
|
174
174
|
backlog?: number;
|
|
@@ -184,12 +184,14 @@ declare module 'net' {
|
|
|
184
184
|
|
|
185
185
|
interface ServerOpts {
|
|
186
186
|
/**
|
|
187
|
-
* Indicates whether half-opened TCP connections are allowed.
|
|
187
|
+
* Indicates whether half-opened TCP connections are allowed.
|
|
188
|
+
* @default false
|
|
188
189
|
*/
|
|
189
190
|
allowHalfOpen?: boolean;
|
|
190
191
|
|
|
191
192
|
/**
|
|
192
|
-
* Indicates whether the socket should be paused on incoming connections.
|
|
193
|
+
* Indicates whether the socket should be paused on incoming connections.
|
|
194
|
+
* @default false
|
|
193
195
|
*/
|
|
194
196
|
pauseOnConnect?: boolean;
|
|
195
197
|
}
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "15.0
|
|
3
|
+
"version": "15.6.0",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -226,6 +226,6 @@
|
|
|
226
226
|
},
|
|
227
227
|
"scripts": {},
|
|
228
228
|
"dependencies": {},
|
|
229
|
-
"typesPublisherContentHash": "
|
|
229
|
+
"typesPublisherContentHash": "fe5d90fe4c06a65d482f400f205828b1280c7062026d5afdccc3b2bbccf4adcd",
|
|
230
230
|
"typeScriptVersion": "3.5"
|
|
231
231
|
}
|
node/path.d.ts
CHANGED
node/perf_hooks.d.ts
CHANGED
|
@@ -84,6 +84,12 @@ declare module 'perf_hooks' {
|
|
|
84
84
|
utilization: number;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* @param util1 The result of a previous call to eventLoopUtilization()
|
|
89
|
+
* @param util2 The result of a previous call to eventLoopUtilization() prior to util1
|
|
90
|
+
*/
|
|
91
|
+
type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization;
|
|
92
|
+
|
|
87
93
|
interface Performance {
|
|
88
94
|
/**
|
|
89
95
|
* If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
|
|
@@ -144,11 +150,8 @@ declare module 'perf_hooks' {
|
|
|
144
150
|
* eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
|
|
145
151
|
* It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
|
|
146
152
|
* No other CPU idle time is taken into consideration.
|
|
147
|
-
*
|
|
148
|
-
* @param util1 The result of a previous call to eventLoopUtilization()
|
|
149
|
-
* @param util2 The result of a previous call to eventLoopUtilization() prior to util1
|
|
150
153
|
*/
|
|
151
|
-
eventLoopUtilization
|
|
154
|
+
eventLoopUtilization: EventLoopUtilityFunction;
|
|
152
155
|
}
|
|
153
156
|
|
|
154
157
|
interface PerformanceObserverEntryList {
|
node/process.d.ts
CHANGED
|
@@ -11,6 +11,18 @@ declare module 'process' {
|
|
|
11
11
|
interface ReadStream extends tty.ReadStream {}
|
|
12
12
|
interface WriteStream extends tty.WriteStream {}
|
|
13
13
|
|
|
14
|
+
interface MemoryUsageFn {
|
|
15
|
+
/**
|
|
16
|
+
* The `process.memoryUsage()` method iterate over each page to gather informations about memory
|
|
17
|
+
* usage which can be slow depending on the program memory allocations.
|
|
18
|
+
*/
|
|
19
|
+
(): MemoryUsage;
|
|
20
|
+
/**
|
|
21
|
+
* method returns an integer representing the Resident Set Size (RSS) in bytes.
|
|
22
|
+
*/
|
|
23
|
+
rss(): number;
|
|
24
|
+
}
|
|
25
|
+
|
|
14
26
|
interface MemoryUsage {
|
|
15
27
|
rss: number;
|
|
16
28
|
heapTotal: number;
|
|
@@ -289,7 +301,7 @@ declare module 'process' {
|
|
|
289
301
|
platform: Platform;
|
|
290
302
|
/** @deprecated since v14.0.0 - use `require.main` instead. */
|
|
291
303
|
mainModule?: Module;
|
|
292
|
-
memoryUsage
|
|
304
|
+
memoryUsage: MemoryUsageFn;
|
|
293
305
|
cpuUsage(previousValue?: CpuUsage): CpuUsage;
|
|
294
306
|
nextTick(callback: Function, ...args: any[]): void;
|
|
295
307
|
release: ProcessRelease;
|
node/readline.d.ts
CHANGED
node/repl.d.ts
CHANGED
|
@@ -6,17 +6,17 @@ declare module 'repl' {
|
|
|
6
6
|
interface ReplOptions {
|
|
7
7
|
/**
|
|
8
8
|
* The input prompt to display.
|
|
9
|
-
*
|
|
9
|
+
* @default "> "
|
|
10
10
|
*/
|
|
11
11
|
prompt?: string;
|
|
12
12
|
/**
|
|
13
13
|
* The `Readable` stream from which REPL input will be read.
|
|
14
|
-
*
|
|
14
|
+
* @default process.stdin
|
|
15
15
|
*/
|
|
16
16
|
input?: NodeJS.ReadableStream;
|
|
17
17
|
/**
|
|
18
18
|
* The `Writable` stream to which REPL output will be written.
|
|
19
|
-
*
|
|
19
|
+
* @default process.stdout
|
|
20
20
|
*/
|
|
21
21
|
output?: NodeJS.WritableStream;
|
|
22
22
|
/**
|
node/stream.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare module 'stream' {
|
|
2
|
-
import EventEmitter
|
|
2
|
+
import { EventEmitter, Abortable } from 'events';
|
|
3
3
|
import * as streamPromises from "stream/promises";
|
|
4
4
|
|
|
5
5
|
class internal extends EventEmitter {
|
|
@@ -11,16 +11,20 @@ declare module 'stream' {
|
|
|
11
11
|
constructor(opts?: ReadableOptions);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
interface
|
|
14
|
+
interface StreamOptions<T extends Stream> extends Abortable {
|
|
15
|
+
emitClose?: boolean;
|
|
15
16
|
highWaterMark?: number;
|
|
16
|
-
encoding?: BufferEncoding;
|
|
17
17
|
objectMode?: boolean;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
destroy?(this: Readable, error: Error | null, callback: (error: Error | null) => void): void;
|
|
18
|
+
construct?(this: T, callback: (error?: Error | null) => void): void;
|
|
19
|
+
destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void;
|
|
21
20
|
autoDestroy?: boolean;
|
|
22
21
|
}
|
|
23
22
|
|
|
23
|
+
interface ReadableOptions extends StreamOptions<Readable> {
|
|
24
|
+
encoding?: BufferEncoding;
|
|
25
|
+
read?(this: Readable, size: number): void;
|
|
26
|
+
}
|
|
27
|
+
|
|
24
28
|
class Readable extends Stream implements NodeJS.ReadableStream {
|
|
25
29
|
/**
|
|
26
30
|
* A utility method for creating Readable Streams out of iterators.
|
|
@@ -127,18 +131,12 @@ declare module 'stream' {
|
|
|
127
131
|
[Symbol.asyncIterator](): AsyncIterableIterator<any>;
|
|
128
132
|
}
|
|
129
133
|
|
|
130
|
-
interface WritableOptions {
|
|
131
|
-
highWaterMark?: number;
|
|
134
|
+
interface WritableOptions extends StreamOptions<Writable> {
|
|
132
135
|
decodeStrings?: boolean;
|
|
133
136
|
defaultEncoding?: BufferEncoding;
|
|
134
|
-
objectMode?: boolean;
|
|
135
|
-
emitClose?: boolean;
|
|
136
|
-
construct?(this: Writable, callback: (error?: Error | null) => void): void;
|
|
137
137
|
write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
138
138
|
writev?(this: Writable, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void;
|
|
139
|
-
destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void;
|
|
140
139
|
final?(this: Writable, callback: (error?: Error | null) => void): void;
|
|
141
|
-
autoDestroy?: boolean;
|
|
142
140
|
}
|
|
143
141
|
|
|
144
142
|
class Writable extends Stream implements NodeJS.WritableStream {
|
|
@@ -293,6 +291,16 @@ declare module 'stream' {
|
|
|
293
291
|
|
|
294
292
|
class PassThrough extends Transform { }
|
|
295
293
|
|
|
294
|
+
/**
|
|
295
|
+
* Attaches an AbortSignal to a readable or writeable stream. This lets code
|
|
296
|
+
* control stream destruction using an `AbortController`.
|
|
297
|
+
*
|
|
298
|
+
* Calling `abort` on the `AbortController` corresponding to the passed
|
|
299
|
+
* `AbortSignal` will behave the same way as calling `.destroy(new AbortError())`
|
|
300
|
+
* on the stream.
|
|
301
|
+
*/
|
|
302
|
+
function addAbortSignal<T extends Stream>(signal: AbortSignal, stream: T): T;
|
|
303
|
+
|
|
296
304
|
interface FinishedOptions {
|
|
297
305
|
error?: boolean;
|
|
298
306
|
readable?: boolean;
|
node/tls.d.ts
CHANGED
|
@@ -553,6 +553,9 @@ declare module 'tls' {
|
|
|
553
553
|
prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
+
/**
|
|
557
|
+
* @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
|
|
558
|
+
*/
|
|
556
559
|
interface SecurePair {
|
|
557
560
|
encrypted: TLSSocket;
|
|
558
561
|
cleartext: TLSSocket;
|
node/ts3.6/base.d.ts
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
/// <reference path="../constants.d.ts" />
|
|
24
24
|
/// <reference path="../crypto.d.ts" />
|
|
25
25
|
/// <reference path="../dgram.d.ts" />
|
|
26
|
+
/// <reference path="../diagnostic_channel.d.ts" />
|
|
26
27
|
/// <reference path="../dns.d.ts" />
|
|
27
28
|
/// <reference path="../dns/promises.d.ts" />
|
|
28
29
|
/// <reference path="../dns/promises.d.ts" />
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
/// <reference path="../tty.d.ts" />
|
|
55
56
|
/// <reference path="../url.d.ts" />
|
|
56
57
|
/// <reference path="../util.d.ts" />
|
|
58
|
+
/// <reference path="../util/types.d.ts" />
|
|
57
59
|
/// <reference path="../v8.d.ts" />
|
|
58
60
|
/// <reference path="../vm.d.ts" />
|
|
59
61
|
/// <reference path="../worker_threads.d.ts" />
|
node/util/types.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
declare module 'util/types' {
|
|
2
|
+
function isAnyArrayBuffer(object: any): object is ArrayBufferLike;
|
|
3
|
+
function isArgumentsObject(object: any): object is IArguments;
|
|
4
|
+
function isArrayBuffer(object: any): object is ArrayBuffer;
|
|
5
|
+
function isArrayBufferView(object: any): object is NodeJS.ArrayBufferView;
|
|
6
|
+
function isAsyncFunction(object: any): boolean;
|
|
7
|
+
function isBigInt64Array(value: any): value is BigInt64Array;
|
|
8
|
+
function isBigUint64Array(value: any): value is BigUint64Array;
|
|
9
|
+
function isBooleanObject(object: any): object is Boolean;
|
|
10
|
+
function isBoxedPrimitive(object: any): object is String | Number | BigInt | Boolean | Symbol;
|
|
11
|
+
function isDataView(object: any): object is DataView;
|
|
12
|
+
function isDate(object: any): object is Date;
|
|
13
|
+
function isExternal(object: any): boolean;
|
|
14
|
+
function isFloat32Array(object: any): object is Float32Array;
|
|
15
|
+
function isFloat64Array(object: any): object is Float64Array;
|
|
16
|
+
function isGeneratorFunction(object: any): object is GeneratorFunction;
|
|
17
|
+
function isGeneratorObject(object: any): object is Generator;
|
|
18
|
+
function isInt8Array(object: any): object is Int8Array;
|
|
19
|
+
function isInt16Array(object: any): object is Int16Array;
|
|
20
|
+
function isInt32Array(object: any): object is Int32Array;
|
|
21
|
+
function isMap<T>(
|
|
22
|
+
object: T | {},
|
|
23
|
+
): object is T extends ReadonlyMap<any, any>
|
|
24
|
+
? unknown extends T
|
|
25
|
+
? never
|
|
26
|
+
: ReadonlyMap<any, any>
|
|
27
|
+
: Map<any, any>;
|
|
28
|
+
function isMapIterator(object: any): boolean;
|
|
29
|
+
function isModuleNamespaceObject(value: any): boolean;
|
|
30
|
+
function isNativeError(object: any): object is Error;
|
|
31
|
+
function isNumberObject(object: any): object is Number;
|
|
32
|
+
function isPromise(object: any): object is Promise<any>;
|
|
33
|
+
function isProxy(object: any): boolean;
|
|
34
|
+
function isRegExp(object: any): object is RegExp;
|
|
35
|
+
function isSet<T>(
|
|
36
|
+
object: T | {},
|
|
37
|
+
): object is T extends ReadonlySet<any>
|
|
38
|
+
? unknown extends T
|
|
39
|
+
? never
|
|
40
|
+
: ReadonlySet<any>
|
|
41
|
+
: Set<any>;
|
|
42
|
+
function isSetIterator(object: any): boolean;
|
|
43
|
+
function isSharedArrayBuffer(object: any): object is SharedArrayBuffer;
|
|
44
|
+
function isStringObject(object: any): object is String;
|
|
45
|
+
function isSymbolObject(object: any): object is Symbol;
|
|
46
|
+
function isTypedArray(object: any): object is NodeJS.TypedArray;
|
|
47
|
+
function isUint8Array(object: any): object is Uint8Array;
|
|
48
|
+
function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
|
|
49
|
+
function isUint16Array(object: any): object is Uint16Array;
|
|
50
|
+
function isUint32Array(object: any): object is Uint32Array;
|
|
51
|
+
function isWeakMap(object: any): object is WeakMap<any, any>;
|
|
52
|
+
function isWeakSet(object: any): object is WeakSet<any>;
|
|
53
|
+
}
|
node/util.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
declare module 'util' {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import * as types from 'util/types';
|
|
3
|
+
|
|
4
|
+
export interface InspectOptions extends NodeJS.InspectOptions { }
|
|
5
|
+
export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module';
|
|
6
|
+
export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string;
|
|
7
|
+
export interface InspectOptionsStylized extends InspectOptions {
|
|
6
8
|
stylize(text: string, styleType: Style): string;
|
|
7
9
|
}
|
|
8
|
-
function format(format?: any, ...param: any[]): string;
|
|
9
|
-
function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
|
|
10
|
+
export function format(format?: any, ...param: any[]): string;
|
|
11
|
+
export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
|
|
10
12
|
/** @deprecated since v0.11.3 - use a third party module instead. */
|
|
11
|
-
function log(string: string): void;
|
|
12
|
-
function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
|
13
|
-
function inspect(object: any, options: InspectOptions): string;
|
|
14
|
-
namespace inspect {
|
|
13
|
+
export function log(string: string): void;
|
|
14
|
+
export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
|
15
|
+
export function inspect(object: any, options: InspectOptions): string;
|
|
16
|
+
export namespace inspect {
|
|
15
17
|
let colors: NodeJS.Dict<[number, number]>;
|
|
16
18
|
let styles: {
|
|
17
19
|
[K in Style]: string
|
|
@@ -24,156 +26,101 @@ declare module 'util' {
|
|
|
24
26
|
const custom: unique symbol;
|
|
25
27
|
}
|
|
26
28
|
/** @deprecated since v4.0.0 - use `Array.isArray()` instead. */
|
|
27
|
-
function isArray(object: any): object is any[];
|
|
29
|
+
export function isArray(object: any): object is any[];
|
|
28
30
|
/** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */
|
|
29
|
-
function isRegExp(object: any): object is RegExp;
|
|
31
|
+
export function isRegExp(object: any): object is RegExp;
|
|
30
32
|
/** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */
|
|
31
|
-
function isDate(object: any): object is Date;
|
|
33
|
+
export function isDate(object: any): object is Date;
|
|
32
34
|
/** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */
|
|
33
|
-
function isError(object: any): object is Error;
|
|
34
|
-
function inherits(constructor: any, superConstructor: any): void;
|
|
35
|
-
function debuglog(key: string): (msg: string, ...param: any[]) => void;
|
|
35
|
+
export function isError(object: any): object is Error;
|
|
36
|
+
export function inherits(constructor: any, superConstructor: any): void;
|
|
37
|
+
export function debuglog(key: string): (msg: string, ...param: any[]) => void;
|
|
36
38
|
/** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */
|
|
37
|
-
function isBoolean(object: any): object is boolean;
|
|
39
|
+
export function isBoolean(object: any): object is boolean;
|
|
38
40
|
/** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */
|
|
39
|
-
function isBuffer(object: any): object is Buffer;
|
|
41
|
+
export function isBuffer(object: any): object is Buffer;
|
|
40
42
|
/** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */
|
|
41
|
-
function isFunction(object: any): boolean;
|
|
43
|
+
export function isFunction(object: any): boolean;
|
|
42
44
|
/** @deprecated since v4.0.0 - use `value === null` instead. */
|
|
43
|
-
function isNull(object: any): object is null;
|
|
45
|
+
export function isNull(object: any): object is null;
|
|
44
46
|
/** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */
|
|
45
|
-
function isNullOrUndefined(object: any): object is null | undefined;
|
|
47
|
+
export function isNullOrUndefined(object: any): object is null | undefined;
|
|
46
48
|
/** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */
|
|
47
|
-
function isNumber(object: any): object is number;
|
|
49
|
+
export function isNumber(object: any): object is number;
|
|
48
50
|
/** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */
|
|
49
|
-
function isObject(object: any): boolean;
|
|
51
|
+
export function isObject(object: any): boolean;
|
|
50
52
|
/** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */
|
|
51
|
-
function isPrimitive(object: any): boolean;
|
|
53
|
+
export function isPrimitive(object: any): boolean;
|
|
52
54
|
/** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */
|
|
53
|
-
function isString(object: any): object is string;
|
|
55
|
+
export function isString(object: any): object is string;
|
|
54
56
|
/** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */
|
|
55
|
-
function isSymbol(object: any): object is symbol;
|
|
57
|
+
export function isSymbol(object: any): object is symbol;
|
|
56
58
|
/** @deprecated since v4.0.0 - use `value === undefined` instead. */
|
|
57
|
-
function isUndefined(object: any): object is undefined;
|
|
58
|
-
function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
|
|
59
|
-
function isDeepStrictEqual(val1: any, val2: any): boolean;
|
|
59
|
+
export function isUndefined(object: any): object is undefined;
|
|
60
|
+
export function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
|
|
61
|
+
export function isDeepStrictEqual(val1: any, val2: any): boolean;
|
|
60
62
|
|
|
61
|
-
function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
62
|
-
function callbackify<TResult>(fn: () => Promise<TResult>): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
|
63
|
-
function callbackify<T1>(fn: (arg1: T1) => Promise<void>): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
64
|
-
function callbackify<T1, TResult>(fn: (arg1: T1) => Promise<TResult>): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
|
65
|
-
function callbackify<T1, T2>(fn: (arg1: T1, arg2: T2) => Promise<void>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
66
|
-
function callbackify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2) => Promise<TResult>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
|
|
67
|
-
function callbackify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
68
|
-
function callbackify<T1, T2, T3, TResult>(
|
|
63
|
+
export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
64
|
+
export function callbackify<TResult>(fn: () => Promise<TResult>): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
|
65
|
+
export function callbackify<T1>(fn: (arg1: T1) => Promise<void>): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
66
|
+
export function callbackify<T1, TResult>(fn: (arg1: T1) => Promise<TResult>): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
|
67
|
+
export function callbackify<T1, T2>(fn: (arg1: T1, arg2: T2) => Promise<void>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
68
|
+
export function callbackify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2) => Promise<TResult>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
|
|
69
|
+
export function callbackify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
70
|
+
export function callbackify<T1, T2, T3, TResult>(
|
|
69
71
|
fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
|
|
70
|
-
|
|
72
|
+
export function callbackify<T1, T2, T3, T4>(
|
|
71
73
|
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
72
|
-
|
|
74
|
+
export function callbackify<T1, T2, T3, T4, TResult>(
|
|
73
75
|
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
|
|
74
|
-
|
|
76
|
+
export function callbackify<T1, T2, T3, T4, T5>(
|
|
75
77
|
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
76
|
-
|
|
78
|
+
export function callbackify<T1, T2, T3, T4, T5, TResult>(
|
|
77
79
|
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>,
|
|
78
80
|
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
|
|
79
|
-
function callbackify<T1, T2, T3, T4, T5, T6>(
|
|
81
|
+
export function callbackify<T1, T2, T3, T4, T5, T6>(
|
|
80
82
|
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>,
|
|
81
83
|
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
82
|
-
function callbackify<T1, T2, T3, T4, T5, T6, TResult>(
|
|
84
|
+
export function callbackify<T1, T2, T3, T4, T5, T6, TResult>(
|
|
83
85
|
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>
|
|
84
86
|
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
|
|
85
87
|
|
|
86
|
-
interface CustomPromisifyLegacy<TCustom extends Function> extends Function {
|
|
88
|
+
export interface CustomPromisifyLegacy<TCustom extends Function> extends Function {
|
|
87
89
|
__promisify__: TCustom;
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
interface CustomPromisifySymbol<TCustom extends Function> extends Function {
|
|
92
|
+
export interface CustomPromisifySymbol<TCustom extends Function> extends Function {
|
|
91
93
|
[promisify.custom]: TCustom;
|
|
92
94
|
}
|
|
93
95
|
|
|
94
|
-
type CustomPromisify<TCustom extends Function> = CustomPromisifySymbol<TCustom> | CustomPromisifyLegacy<TCustom>;
|
|
96
|
+
export type CustomPromisify<TCustom extends Function> = CustomPromisifySymbol<TCustom> | CustomPromisifyLegacy<TCustom>;
|
|
95
97
|
|
|
96
|
-
function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
|
|
97
|
-
function promisify<TResult>(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise<TResult>;
|
|
98
|
-
function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
|
|
99
|
-
function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
|
|
100
|
-
function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
|
|
101
|
-
function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
|
|
102
|
-
function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
|
|
103
|
-
function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void):
|
|
98
|
+
export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
|
|
99
|
+
export function promisify<TResult>(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise<TResult>;
|
|
100
|
+
export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
|
|
101
|
+
export function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
|
|
102
|
+
export function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
|
|
103
|
+
export function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
|
|
104
|
+
export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
|
|
105
|
+
export function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void):
|
|
104
106
|
(arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
|
|
105
|
-
function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
|
|
106
|
-
function promisify<T1, T2, T3, T4, TResult>(
|
|
107
|
+
export function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
|
|
108
|
+
export function promisify<T1, T2, T3, T4, TResult>(
|
|
107
109
|
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
|
|
108
110
|
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
|
|
109
|
-
function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void):
|
|
111
|
+
export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void):
|
|
110
112
|
(arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
|
|
111
|
-
|
|
113
|
+
export function promisify<T1, T2, T3, T4, T5, TResult>(
|
|
112
114
|
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
|
|
113
115
|
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
|
|
114
|
-
function promisify<T1, T2, T3, T4, T5>(
|
|
116
|
+
export function promisify<T1, T2, T3, T4, T5>(
|
|
115
117
|
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
|
|
116
118
|
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
|
|
117
|
-
function promisify(fn: Function): Function;
|
|
118
|
-
namespace promisify {
|
|
119
|
+
export function promisify(fn: Function): Function;
|
|
120
|
+
export namespace promisify {
|
|
119
121
|
const custom: unique symbol;
|
|
120
122
|
}
|
|
121
|
-
|
|
122
|
-
namespace types {
|
|
123
|
-
function isAnyArrayBuffer(object: any): object is ArrayBufferLike;
|
|
124
|
-
function isArgumentsObject(object: any): object is IArguments;
|
|
125
|
-
function isArrayBuffer(object: any): object is ArrayBuffer;
|
|
126
|
-
function isArrayBufferView(object: any): object is NodeJS.ArrayBufferView;
|
|
127
|
-
function isAsyncFunction(object: any): boolean;
|
|
128
|
-
function isBigInt64Array(value: any): value is BigInt64Array;
|
|
129
|
-
function isBigUint64Array(value: any): value is BigUint64Array;
|
|
130
|
-
function isBooleanObject(object: any): object is Boolean;
|
|
131
|
-
function isBoxedPrimitive(object: any): object is String | Number | BigInt | Boolean | Symbol;
|
|
132
|
-
function isDataView(object: any): object is DataView;
|
|
133
|
-
function isDate(object: any): object is Date;
|
|
134
|
-
function isExternal(object: any): boolean;
|
|
135
|
-
function isFloat32Array(object: any): object is Float32Array;
|
|
136
|
-
function isFloat64Array(object: any): object is Float64Array;
|
|
137
|
-
function isGeneratorFunction(object: any): object is GeneratorFunction;
|
|
138
|
-
function isGeneratorObject(object: any): object is Generator;
|
|
139
|
-
function isInt8Array(object: any): object is Int8Array;
|
|
140
|
-
function isInt16Array(object: any): object is Int16Array;
|
|
141
|
-
function isInt32Array(object: any): object is Int32Array;
|
|
142
|
-
function isMap<T>(
|
|
143
|
-
object: T | {},
|
|
144
|
-
): object is T extends ReadonlyMap<any, any>
|
|
145
|
-
? unknown extends T
|
|
146
|
-
? never
|
|
147
|
-
: ReadonlyMap<any, any>
|
|
148
|
-
: Map<any, any>;
|
|
149
|
-
function isMapIterator(object: any): boolean;
|
|
150
|
-
function isModuleNamespaceObject(value: any): boolean;
|
|
151
|
-
function isNativeError(object: any): object is Error;
|
|
152
|
-
function isNumberObject(object: any): object is Number;
|
|
153
|
-
function isPromise(object: any): object is Promise<any>;
|
|
154
|
-
function isProxy(object: any): boolean;
|
|
155
|
-
function isRegExp(object: any): object is RegExp;
|
|
156
|
-
function isSet<T>(
|
|
157
|
-
object: T | {},
|
|
158
|
-
): object is T extends ReadonlySet<any>
|
|
159
|
-
? unknown extends T
|
|
160
|
-
? never
|
|
161
|
-
: ReadonlySet<any>
|
|
162
|
-
: Set<any>;
|
|
163
|
-
function isSetIterator(object: any): boolean;
|
|
164
|
-
function isSharedArrayBuffer(object: any): object is SharedArrayBuffer;
|
|
165
|
-
function isStringObject(object: any): object is String;
|
|
166
|
-
function isSymbolObject(object: any): object is Symbol;
|
|
167
|
-
function isTypedArray(object: any): object is NodeJS.TypedArray;
|
|
168
|
-
function isUint8Array(object: any): object is Uint8Array;
|
|
169
|
-
function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
|
|
170
|
-
function isUint16Array(object: any): object is Uint16Array;
|
|
171
|
-
function isUint32Array(object: any): object is Uint32Array;
|
|
172
|
-
function isWeakMap(object: any): object is WeakMap<any, any>;
|
|
173
|
-
function isWeakSet(object: any): object is WeakSet<any>;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
class TextDecoder {
|
|
123
|
+
export class TextDecoder {
|
|
177
124
|
readonly encoding: string;
|
|
178
125
|
readonly fatal: boolean;
|
|
179
126
|
readonly ignoreBOM: boolean;
|
|
@@ -187,7 +134,7 @@ declare module 'util' {
|
|
|
187
134
|
): string;
|
|
188
135
|
}
|
|
189
136
|
|
|
190
|
-
interface EncodeIntoResult {
|
|
137
|
+
export interface EncodeIntoResult {
|
|
191
138
|
/**
|
|
192
139
|
* The read Unicode code units of input.
|
|
193
140
|
*/
|
|
@@ -199,7 +146,9 @@ declare module 'util' {
|
|
|
199
146
|
written: number;
|
|
200
147
|
}
|
|
201
148
|
|
|
202
|
-
|
|
149
|
+
export { types };
|
|
150
|
+
|
|
151
|
+
export class TextEncoder {
|
|
203
152
|
readonly encoding: string;
|
|
204
153
|
encode(input?: string): Uint8Array;
|
|
205
154
|
encodeInto(input: string, output: Uint8Array): EncodeIntoResult;
|
node/v8.d.ts
CHANGED
|
@@ -184,4 +184,15 @@ declare module 'v8' {
|
|
|
184
184
|
* Uses a `DefaultDeserializer` with default options to read a JS value from a buffer.
|
|
185
185
|
*/
|
|
186
186
|
function deserialize(data: NodeJS.TypedArray): any;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Begins writing coverage report based on the `NODE_V8_COVERAGE` env var.
|
|
190
|
+
* Noop is the env var is not set.
|
|
191
|
+
*/
|
|
192
|
+
function takeCoverage(): void;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Stops writing coverage report.
|
|
196
|
+
*/
|
|
197
|
+
function stopCoverage(): void;
|
|
187
198
|
}
|