@types/node 15.14.9 → 16.0.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 v15.14 → node}/LICENSE +0 -0
- node v15.14/README.md → node/README.md +3 -3
- node/assert/strict.d.ts +9 -0
- node v15.14/assert.d.ts → node/assert.d.ts +32 -27
- node v15.14/async_hooks.d.ts → node/async_hooks.d.ts +5 -1
- {node v15.14 → node}/base.d.ts +0 -0
- node/buffer.d.ts +357 -0
- node v15.14/child_process.d.ts → node/child_process.d.ts +6 -2
- node v15.14/cluster.d.ts → node/cluster.d.ts +25 -100
- node v15.14/console.d.ts → node/console.d.ts +21 -20
- node v15.14/constants.d.ts → node/constants.d.ts +5 -0
- node v15.14/crypto.d.ts → node/crypto.d.ts +21 -6
- node v15.14/dgram.d.ts → node/dgram.d.ts +4 -0
- node v15.14/diagnostic_channel.d.ts → node/diagnostic_channel.d.ts +4 -0
- node v15.14/dns/promises.d.ts → node/dns/promises.d.ts +4 -0
- node v15.14/dns.d.ts → node/dns.d.ts +4 -0
- node/domain.d.ts +25 -0
- node v15.14/events.d.ts → node/events.d.ts +5 -0
- node v15.14/fs/promises.d.ts → node/fs/promises.d.ts +4 -0
- node v15.14/fs.d.ts → node/fs.d.ts +12 -20
- node/globals.d.ts +274 -0
- node/globals.global.d.ts +1 -0
- node v15.14/http.d.ts → node/http.d.ts +12 -70
- node v15.14/http2.d.ts → node/http2.d.ts +4 -1
- node/https.d.ts +40 -0
- node v15.14/index.d.ts → node/index.d.ts +1 -1
- node v15.14/inspector.d.ts → node/inspector.d.ts +4 -322
- node v15.14/module.d.ts → node/module.d.ts +25 -4
- node v15.14/net.d.ts → node/net.d.ts +4 -6
- node v15.14/os.d.ts → node/os.d.ts +4 -0
- node v15.14/package.json → node/package.json +3 -3
- node v15.14/path.d.ts → node/path.d.ts +5 -0
- node v15.14/perf_hooks.d.ts → node/perf_hooks.d.ts +66 -19
- node v15.14/process.d.ts → node/process.d.ts +42 -40
- node v15.14/punycode.d.ts → node/punycode.d.ts +4 -0
- node v15.14/querystring.d.ts → node/querystring.d.ts +4 -0
- node v15.14/readline.d.ts → node/readline.d.ts +5 -1
- node v15.14/repl.d.ts → node/repl.d.ts +4 -0
- node v15.14/stream/promises.d.ts → node/stream/promises.d.ts +4 -0
- node v15.14/stream.d.ts → node/stream.d.ts +5 -0
- node v15.14/string_decoder.d.ts → node/string_decoder.d.ts +4 -0
- node v15.14/timers/promises.d.ts → node/timers/promises.d.ts +4 -0
- node/timers.d.ts +92 -0
- node v15.14/tls.d.ts → node/tls.d.ts +4 -0
- node v15.14/trace_events.d.ts → node/trace_events.d.ts +4 -0
- node v15.14/ts3.6/assert.d.ts → node/ts3.6/assert.d.ts +26 -26
- {node v15.14 → node}/ts3.6/base.d.ts +0 -0
- {node v15.14 → node}/ts3.6/index.d.ts +0 -0
- node v15.14/tty.d.ts → node/tty.d.ts +4 -0
- node v15.14/url.d.ts → node/url.d.ts +4 -0
- node/util/types.d.ts +57 -0
- node v15.14/util.d.ts → node/util.d.ts +65 -19
- node v15.14/v8.d.ts → node/v8.d.ts +4 -0
- node v15.14/vm.d.ts → node/vm.d.ts +4 -0
- node v15.14/wasi.d.ts → node/wasi.d.ts +4 -0
- node v15.14/worker_threads.d.ts → node/worker_threads.d.ts +4 -0
- node v15.14/zlib.d.ts → node/zlib.d.ts +4 -0
- node v15.14/assert/strict.d.ts +0 -4
- node v15.14/buffer.d.ts +0 -112
- node v15.14/domain.d.ts +0 -24
- node v15.14/globals.d.ts +0 -659
- node v15.14/globals.global.d.ts +0 -1
- node v15.14/https.d.ts +0 -139
- node v15.14/timers.d.ts +0 -27
- node v15.14/util/types.d.ts +0 -53
|
@@ -59,6 +59,7 @@ declare module 'process' {
|
|
|
59
59
|
| 'android'
|
|
60
60
|
| 'darwin'
|
|
61
61
|
| 'freebsd'
|
|
62
|
+
| 'haiku'
|
|
62
63
|
| 'linux'
|
|
63
64
|
| 'openbsd'
|
|
64
65
|
| 'sunos'
|
|
@@ -72,14 +73,13 @@ declare module 'process' {
|
|
|
72
73
|
"SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
|
|
73
74
|
"SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
|
|
74
75
|
|
|
75
|
-
type UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection';
|
|
76
76
|
type MultipleResolveType = 'resolve' | 'reject';
|
|
77
77
|
|
|
78
78
|
type BeforeExitListener = (code: number) => void;
|
|
79
79
|
type DisconnectListener = () => void;
|
|
80
80
|
type ExitListener = (code: number) => void;
|
|
81
81
|
type RejectionHandledListener = (promise: Promise<any>) => void;
|
|
82
|
-
type UncaughtExceptionListener = (error: Error
|
|
82
|
+
type UncaughtExceptionListener = (error: Error) => void;
|
|
83
83
|
type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise<any>) => void;
|
|
84
84
|
type WarningListener = (warning: Error) => void;
|
|
85
85
|
type MessageListener = (message: any, sendHandle: any) => void;
|
|
@@ -210,6 +210,33 @@ declare module 'process' {
|
|
|
210
210
|
detail?: string;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
+
interface ProcessConfig {
|
|
214
|
+
readonly target_defaults: {
|
|
215
|
+
readonly cflags: any[];
|
|
216
|
+
readonly default_configuration: string;
|
|
217
|
+
readonly defines: string[];
|
|
218
|
+
readonly include_dirs: string[];
|
|
219
|
+
readonly libraries: string[];
|
|
220
|
+
};
|
|
221
|
+
readonly variables: {
|
|
222
|
+
readonly clang: number;
|
|
223
|
+
readonly host_arch: string;
|
|
224
|
+
readonly node_install_npm: boolean;
|
|
225
|
+
readonly node_install_waf: boolean;
|
|
226
|
+
readonly node_prefix: string;
|
|
227
|
+
readonly node_shared_openssl: boolean;
|
|
228
|
+
readonly node_shared_v8: boolean;
|
|
229
|
+
readonly node_shared_zlib: boolean;
|
|
230
|
+
readonly node_use_dtrace: boolean;
|
|
231
|
+
readonly node_use_etw: boolean;
|
|
232
|
+
readonly node_use_openssl: boolean;
|
|
233
|
+
readonly target_arch: string;
|
|
234
|
+
readonly v8_no_strict_aliasing: number;
|
|
235
|
+
readonly v8_use_snapshot: boolean;
|
|
236
|
+
readonly visibility: string;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
213
240
|
interface Process extends EventEmitter {
|
|
214
241
|
/**
|
|
215
242
|
* Can also be a tty.WriteStream, not typed due to limitations.
|
|
@@ -266,46 +293,21 @@ declare module 'process' {
|
|
|
266
293
|
setgroups(groups: ReadonlyArray<string | number>): void;
|
|
267
294
|
setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
|
|
268
295
|
hasUncaughtExceptionCaptureCallback(): boolean;
|
|
269
|
-
version: string;
|
|
270
|
-
versions: ProcessVersions;
|
|
271
|
-
config:
|
|
272
|
-
target_defaults: {
|
|
273
|
-
cflags: any[];
|
|
274
|
-
default_configuration: string;
|
|
275
|
-
defines: string[];
|
|
276
|
-
include_dirs: string[];
|
|
277
|
-
libraries: string[];
|
|
278
|
-
};
|
|
279
|
-
variables: {
|
|
280
|
-
clang: number;
|
|
281
|
-
host_arch: string;
|
|
282
|
-
node_install_npm: boolean;
|
|
283
|
-
node_install_waf: boolean;
|
|
284
|
-
node_prefix: string;
|
|
285
|
-
node_shared_openssl: boolean;
|
|
286
|
-
node_shared_v8: boolean;
|
|
287
|
-
node_shared_zlib: boolean;
|
|
288
|
-
node_use_dtrace: boolean;
|
|
289
|
-
node_use_etw: boolean;
|
|
290
|
-
node_use_openssl: boolean;
|
|
291
|
-
target_arch: string;
|
|
292
|
-
v8_no_strict_aliasing: number;
|
|
293
|
-
v8_use_snapshot: boolean;
|
|
294
|
-
visibility: string;
|
|
295
|
-
};
|
|
296
|
-
};
|
|
296
|
+
readonly version: string;
|
|
297
|
+
readonly versions: ProcessVersions;
|
|
298
|
+
readonly config: ProcessConfig;
|
|
297
299
|
kill(pid: number, signal?: string | number): true;
|
|
298
|
-
pid: number;
|
|
299
|
-
ppid: number;
|
|
300
|
+
readonly pid: number;
|
|
301
|
+
readonly ppid: number;
|
|
300
302
|
title: string;
|
|
301
|
-
arch: string;
|
|
302
|
-
platform: Platform;
|
|
303
|
+
readonly arch: string;
|
|
304
|
+
readonly platform: Platform;
|
|
303
305
|
/** @deprecated since v14.0.0 - use `require.main` instead. */
|
|
304
306
|
mainModule?: Module;
|
|
305
307
|
memoryUsage: MemoryUsageFn;
|
|
306
308
|
cpuUsage(previousValue?: CpuUsage): CpuUsage;
|
|
307
309
|
nextTick(callback: Function, ...args: any[]): void;
|
|
308
|
-
release: ProcessRelease;
|
|
310
|
+
readonly release: ProcessRelease;
|
|
309
311
|
features: {
|
|
310
312
|
inspector: boolean;
|
|
311
313
|
debug: boolean;
|
|
@@ -328,7 +330,6 @@ declare module 'process' {
|
|
|
328
330
|
umask(mask: string | number): number;
|
|
329
331
|
uptime(): number;
|
|
330
332
|
hrtime: HRTime;
|
|
331
|
-
domain: Domain;
|
|
332
333
|
|
|
333
334
|
// Worker
|
|
334
335
|
send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
|
|
@@ -451,12 +452,13 @@ declare module 'process' {
|
|
|
451
452
|
listeners(event: "removeListener"): RemoveListenerListener[];
|
|
452
453
|
listeners(event: "multipleResolves"): MultipleResolveListener[];
|
|
453
454
|
}
|
|
454
|
-
|
|
455
|
-
interface Global {
|
|
456
|
-
process: Process;
|
|
457
|
-
}
|
|
458
455
|
}
|
|
459
456
|
}
|
|
460
457
|
|
|
461
458
|
export = process;
|
|
462
459
|
}
|
|
460
|
+
|
|
461
|
+
declare module 'node:process' {
|
|
462
|
+
import process = require('process');
|
|
463
|
+
export = process;
|
|
464
|
+
}
|
|
@@ -132,7 +132,7 @@ declare module 'readline' {
|
|
|
132
132
|
type ReadLine = Interface; // type forwarded for backwards compatibility
|
|
133
133
|
|
|
134
134
|
type Completer = (line: string) => CompleterResult;
|
|
135
|
-
type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) =>
|
|
135
|
+
type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void;
|
|
136
136
|
|
|
137
137
|
type CompleterResult = [string[], string];
|
|
138
138
|
|
|
@@ -190,3 +190,7 @@ declare module 'readline' {
|
|
|
190
190
|
*/
|
|
191
191
|
function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
|
|
192
192
|
}
|
|
193
|
+
|
|
194
|
+
declare module 'node:readline' {
|
|
195
|
+
export * from 'readline';
|
|
196
|
+
}
|
node/timers.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
declare module 'timers' {
|
|
2
|
+
import { Abortable } from 'events';
|
|
3
|
+
import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'timers/promises';
|
|
4
|
+
|
|
5
|
+
interface TimerOptions extends Abortable {
|
|
6
|
+
/**
|
|
7
|
+
* Set to `false` to indicate that the scheduled `Timeout`
|
|
8
|
+
* should not require the Node.js event loop to remain active.
|
|
9
|
+
* @default true
|
|
10
|
+
*/
|
|
11
|
+
ref?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let setTimeout: typeof global.setTimeout;
|
|
15
|
+
let clearTimeout: typeof global.clearTimeout;
|
|
16
|
+
let setInterval: typeof global.setInterval;
|
|
17
|
+
let clearInterval: typeof global.clearInterval;
|
|
18
|
+
let setImmediate: typeof global.setImmediate;
|
|
19
|
+
let clearImmediate: typeof global.clearImmediate;
|
|
20
|
+
|
|
21
|
+
global {
|
|
22
|
+
namespace NodeJS {
|
|
23
|
+
// compatibility with older typings
|
|
24
|
+
interface Timer extends RefCounted {
|
|
25
|
+
hasRef(): boolean;
|
|
26
|
+
refresh(): this;
|
|
27
|
+
[Symbol.toPrimitive](): number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Immediate extends RefCounted {
|
|
31
|
+
hasRef(): boolean;
|
|
32
|
+
_onImmediate: Function; // to distinguish it from the Timeout class
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Timeout extends Timer {
|
|
36
|
+
hasRef(): boolean;
|
|
37
|
+
refresh(): this;
|
|
38
|
+
[Symbol.toPrimitive](): number;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function setTimeout<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout;
|
|
43
|
+
namespace setTimeout {
|
|
44
|
+
const __promisify__: typeof setTimeoutPromise;
|
|
45
|
+
}
|
|
46
|
+
function clearTimeout(timeoutId: NodeJS.Timeout): void;
|
|
47
|
+
|
|
48
|
+
function setInterval<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer;
|
|
49
|
+
namespace setInterval {
|
|
50
|
+
const __promisify__: typeof setIntervalPromise;
|
|
51
|
+
}
|
|
52
|
+
function clearInterval(intervalId: NodeJS.Timeout): void;
|
|
53
|
+
|
|
54
|
+
function setImmediate<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate;
|
|
55
|
+
namespace setImmediate {
|
|
56
|
+
const __promisify__: typeof setImmediatePromise;
|
|
57
|
+
}
|
|
58
|
+
function clearImmediate(immediateId: NodeJS.Immediate): void;
|
|
59
|
+
|
|
60
|
+
function queueMicrotask(callback: () => void): void;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare module 'node:timers' {
|
|
65
|
+
export * from 'timers';
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare module 'timers/promises' {
|
|
69
|
+
import { TimerOptions } from 'timers';
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Returns a promise that resolves after the specified delay in milliseconds.
|
|
73
|
+
* @param delay defaults to 1
|
|
74
|
+
*/
|
|
75
|
+
function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Returns a promise that resolves in the next tick.
|
|
79
|
+
*/
|
|
80
|
+
function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
* Returns an async iterator that generates values in an interval of delay ms.
|
|
85
|
+
* @param delay defaults to 1
|
|
86
|
+
*/
|
|
87
|
+
function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare module 'node:timers/promises' {
|
|
91
|
+
export * from 'timers/promises';
|
|
92
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare module 'assert' {
|
|
2
2
|
/** An alias of `assert.ok()`. */
|
|
3
|
-
function assert(value:
|
|
3
|
+
function assert(value: unknown, message?: string | Error): void;
|
|
4
4
|
namespace assert {
|
|
5
5
|
class AssertionError extends Error {
|
|
6
|
-
actual:
|
|
7
|
-
expected:
|
|
6
|
+
actual: unknown;
|
|
7
|
+
expected: unknown;
|
|
8
8
|
operator: string;
|
|
9
9
|
generatedMessage: boolean;
|
|
10
10
|
code: 'ERR_ASSERTION';
|
|
@@ -13,9 +13,9 @@ declare module 'assert' {
|
|
|
13
13
|
/** If provided, the error message is set to this value. */
|
|
14
14
|
message?: string;
|
|
15
15
|
/** The `actual` property on the error instance. */
|
|
16
|
-
actual?:
|
|
16
|
+
actual?: unknown;
|
|
17
17
|
/** The `expected` property on the error instance. */
|
|
18
|
-
expected?:
|
|
18
|
+
expected?: unknown;
|
|
19
19
|
/** The `operator` property on the error instance. */
|
|
20
20
|
operator?: string;
|
|
21
21
|
/** If provided, the generated stack trace omits frames before this function. */
|
|
@@ -42,48 +42,48 @@ declare module 'assert' {
|
|
|
42
42
|
stack: object;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
type AssertPredicate = RegExp | (new () => object) | ((thrown:
|
|
45
|
+
type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error;
|
|
46
46
|
|
|
47
47
|
function fail(message?: string | Error): never;
|
|
48
48
|
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
|
49
49
|
function fail(
|
|
50
|
-
actual:
|
|
51
|
-
expected:
|
|
50
|
+
actual: unknown,
|
|
51
|
+
expected: unknown,
|
|
52
52
|
message?: string | Error,
|
|
53
53
|
operator?: string,
|
|
54
54
|
// tslint:disable-next-line:ban-types
|
|
55
55
|
stackStartFn?: Function,
|
|
56
56
|
): never;
|
|
57
|
-
function ok(value:
|
|
57
|
+
function ok(value: unknown, message?: string | Error): void;
|
|
58
58
|
/** @deprecated since v9.9.0 - use strictEqual() instead. */
|
|
59
|
-
function equal(actual:
|
|
59
|
+
function equal(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
60
60
|
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
|
|
61
|
-
function notEqual(actual:
|
|
61
|
+
function notEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
62
62
|
/** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
|
|
63
|
-
function deepEqual(actual:
|
|
63
|
+
function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
64
64
|
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
|
|
65
|
-
function notDeepEqual(actual:
|
|
66
|
-
function strictEqual(actual:
|
|
67
|
-
function notStrictEqual(actual:
|
|
68
|
-
function deepStrictEqual(actual:
|
|
69
|
-
function notDeepStrictEqual(actual:
|
|
65
|
+
function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
66
|
+
function strictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
67
|
+
function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
68
|
+
function deepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
69
|
+
function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
70
70
|
|
|
71
|
-
function throws(block: () =>
|
|
72
|
-
function throws(block: () =>
|
|
73
|
-
function doesNotThrow(block: () =>
|
|
74
|
-
function doesNotThrow(block: () =>
|
|
71
|
+
function throws(block: () => unknown, message?: string | Error): void;
|
|
72
|
+
function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
|
|
73
|
+
function doesNotThrow(block: () => unknown, message?: string | Error): void;
|
|
74
|
+
function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
|
|
75
75
|
|
|
76
|
-
function ifError(value:
|
|
76
|
+
function ifError(value: unknown): void;
|
|
77
77
|
|
|
78
|
-
function rejects(block: (() => Promise<
|
|
78
|
+
function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
|
79
79
|
function rejects(
|
|
80
|
-
block: (() => Promise<
|
|
80
|
+
block: (() => Promise<unknown>) | Promise<unknown>,
|
|
81
81
|
error: AssertPredicate,
|
|
82
82
|
message?: string | Error,
|
|
83
83
|
): Promise<void>;
|
|
84
|
-
function doesNotReject(block: (() => Promise<
|
|
84
|
+
function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
|
|
85
85
|
function doesNotReject(
|
|
86
|
-
block: (() => Promise<
|
|
86
|
+
block: (() => Promise<unknown>) | Promise<unknown>,
|
|
87
87
|
error: AssertPredicate,
|
|
88
88
|
message?: string | Error,
|
|
89
89
|
): Promise<void>;
|
|
File without changes
|
|
File without changes
|
node/util/types.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
declare module 'util/types' {
|
|
2
|
+
function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike;
|
|
3
|
+
function isArgumentsObject(object: unknown): object is IArguments;
|
|
4
|
+
function isArrayBuffer(object: unknown): object is ArrayBuffer;
|
|
5
|
+
function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView;
|
|
6
|
+
function isAsyncFunction(object: unknown): boolean;
|
|
7
|
+
function isBigInt64Array(value: unknown): value is BigInt64Array;
|
|
8
|
+
function isBigUint64Array(value: unknown): value is BigUint64Array;
|
|
9
|
+
function isBooleanObject(object: unknown): object is Boolean;
|
|
10
|
+
function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol;
|
|
11
|
+
function isDataView(object: unknown): object is DataView;
|
|
12
|
+
function isDate(object: unknown): object is Date;
|
|
13
|
+
function isExternal(object: unknown): boolean;
|
|
14
|
+
function isFloat32Array(object: unknown): object is Float32Array;
|
|
15
|
+
function isFloat64Array(object: unknown): object is Float64Array;
|
|
16
|
+
function isGeneratorFunction(object: unknown): object is GeneratorFunction;
|
|
17
|
+
function isGeneratorObject(object: unknown): object is Generator;
|
|
18
|
+
function isInt8Array(object: unknown): object is Int8Array;
|
|
19
|
+
function isInt16Array(object: unknown): object is Int16Array;
|
|
20
|
+
function isInt32Array(object: unknown): 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<unknown, unknown>;
|
|
28
|
+
function isMapIterator(object: unknown): boolean;
|
|
29
|
+
function isModuleNamespaceObject(value: unknown): boolean;
|
|
30
|
+
function isNativeError(object: unknown): object is Error;
|
|
31
|
+
function isNumberObject(object: unknown): object is Number;
|
|
32
|
+
function isPromise(object: unknown): object is Promise<unknown>;
|
|
33
|
+
function isProxy(object: unknown): boolean;
|
|
34
|
+
function isRegExp(object: unknown): 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<unknown>;
|
|
42
|
+
function isSetIterator(object: unknown): boolean;
|
|
43
|
+
function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer;
|
|
44
|
+
function isStringObject(object: unknown): object is String;
|
|
45
|
+
function isSymbolObject(object: unknown): object is Symbol;
|
|
46
|
+
function isTypedArray(object: unknown): object is NodeJS.TypedArray;
|
|
47
|
+
function isUint8Array(object: unknown): object is Uint8Array;
|
|
48
|
+
function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray;
|
|
49
|
+
function isUint16Array(object: unknown): object is Uint16Array;
|
|
50
|
+
function isUint32Array(object: unknown): object is Uint32Array;
|
|
51
|
+
function isWeakMap(object: unknown): object is WeakMap<object, unknown>;
|
|
52
|
+
function isWeakSet(object: unknown): object is WeakSet<object>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare module 'node:util/types' {
|
|
56
|
+
export * from 'util/types';
|
|
57
|
+
}
|
|
@@ -1,7 +1,47 @@
|
|
|
1
1
|
declare module 'util' {
|
|
2
2
|
import * as types from 'util/types';
|
|
3
3
|
|
|
4
|
-
export interface InspectOptions
|
|
4
|
+
export interface InspectOptions {
|
|
5
|
+
/**
|
|
6
|
+
* If set to `true`, getters are going to be
|
|
7
|
+
* inspected as well. If set to `'get'` only getters without setter are going
|
|
8
|
+
* to be inspected. If set to `'set'` only getters having a corresponding
|
|
9
|
+
* setter are going to be inspected. This might cause side effects depending on
|
|
10
|
+
* the getter function.
|
|
11
|
+
* @default `false`
|
|
12
|
+
*/
|
|
13
|
+
getters?: 'get' | 'set' | boolean;
|
|
14
|
+
showHidden?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @default 2
|
|
17
|
+
*/
|
|
18
|
+
depth?: number | null;
|
|
19
|
+
colors?: boolean;
|
|
20
|
+
customInspect?: boolean;
|
|
21
|
+
showProxy?: boolean;
|
|
22
|
+
maxArrayLength?: number | null;
|
|
23
|
+
/**
|
|
24
|
+
* Specifies the maximum number of characters to
|
|
25
|
+
* include when formatting. Set to `null` or `Infinity` to show all elements.
|
|
26
|
+
* Set to `0` or negative to show no characters.
|
|
27
|
+
* @default 10000
|
|
28
|
+
*/
|
|
29
|
+
maxStringLength?: number | null;
|
|
30
|
+
breakLength?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Setting this to `false` causes each object key
|
|
33
|
+
* to be displayed on a new line. It will also add new lines to text that is
|
|
34
|
+
* longer than `breakLength`. If set to a number, the most `n` inner elements
|
|
35
|
+
* are united on a single line as long as all properties fit into
|
|
36
|
+
* `breakLength`. Short array elements are also grouped together. Note that no
|
|
37
|
+
* text will be reduced below 16 characters, no matter the `breakLength` size.
|
|
38
|
+
* For more information, see the example below.
|
|
39
|
+
* @default `true`
|
|
40
|
+
*/
|
|
41
|
+
compact?: boolean | number;
|
|
42
|
+
sorted?: boolean | ((a: string, b: string) => number);
|
|
43
|
+
}
|
|
44
|
+
|
|
5
45
|
export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module';
|
|
6
46
|
export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string;
|
|
7
47
|
export interface InspectOptionsStylized extends InspectOptions {
|
|
@@ -9,6 +49,8 @@ declare module 'util' {
|
|
|
9
49
|
}
|
|
10
50
|
export function format(format?: any, ...param: any[]): string;
|
|
11
51
|
export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
|
|
52
|
+
export function getSystemErrorMap(): Map<number, [string, string]>;
|
|
53
|
+
|
|
12
54
|
/** @deprecated since v0.11.3 - use a third party module instead. */
|
|
13
55
|
export function log(string: string): void;
|
|
14
56
|
export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
|
@@ -26,39 +68,39 @@ declare module 'util' {
|
|
|
26
68
|
const custom: unique symbol;
|
|
27
69
|
}
|
|
28
70
|
/** @deprecated since v4.0.0 - use `Array.isArray()` instead. */
|
|
29
|
-
export function isArray(object:
|
|
71
|
+
export function isArray(object: unknown): object is unknown[];
|
|
30
72
|
/** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */
|
|
31
|
-
export function isRegExp(object:
|
|
73
|
+
export function isRegExp(object: unknown): object is RegExp;
|
|
32
74
|
/** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */
|
|
33
|
-
export function isDate(object:
|
|
75
|
+
export function isDate(object: unknown): object is Date;
|
|
34
76
|
/** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */
|
|
35
|
-
export function isError(object:
|
|
36
|
-
export function inherits(constructor:
|
|
37
|
-
export function debuglog(key: string): (msg: string, ...param:
|
|
77
|
+
export function isError(object: unknown): object is Error;
|
|
78
|
+
export function inherits(constructor: unknown, superConstructor: unknown): void;
|
|
79
|
+
export function debuglog(key: string): (msg: string, ...param: unknown[]) => void;
|
|
38
80
|
/** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */
|
|
39
|
-
export function isBoolean(object:
|
|
81
|
+
export function isBoolean(object: unknown): object is boolean;
|
|
40
82
|
/** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */
|
|
41
|
-
export function isBuffer(object:
|
|
83
|
+
export function isBuffer(object: unknown): object is Buffer;
|
|
42
84
|
/** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */
|
|
43
|
-
export function isFunction(object:
|
|
85
|
+
export function isFunction(object: unknown): boolean;
|
|
44
86
|
/** @deprecated since v4.0.0 - use `value === null` instead. */
|
|
45
|
-
export function isNull(object:
|
|
87
|
+
export function isNull(object: unknown): object is null;
|
|
46
88
|
/** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */
|
|
47
|
-
export function isNullOrUndefined(object:
|
|
89
|
+
export function isNullOrUndefined(object: unknown): object is null | undefined;
|
|
48
90
|
/** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */
|
|
49
|
-
export function isNumber(object:
|
|
91
|
+
export function isNumber(object: unknown): object is number;
|
|
50
92
|
/** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */
|
|
51
|
-
export function isObject(object:
|
|
93
|
+
export function isObject(object: unknown): boolean;
|
|
52
94
|
/** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */
|
|
53
|
-
export function isPrimitive(object:
|
|
95
|
+
export function isPrimitive(object: unknown): boolean;
|
|
54
96
|
/** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */
|
|
55
|
-
export function isString(object:
|
|
97
|
+
export function isString(object: unknown): object is string;
|
|
56
98
|
/** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */
|
|
57
|
-
export function isSymbol(object:
|
|
99
|
+
export function isSymbol(object: unknown): object is symbol;
|
|
58
100
|
/** @deprecated since v4.0.0 - use `value === undefined` instead. */
|
|
59
|
-
export function isUndefined(object:
|
|
101
|
+
export function isUndefined(object: unknown): object is undefined;
|
|
60
102
|
export function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
|
|
61
|
-
export function isDeepStrictEqual(val1:
|
|
103
|
+
export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean;
|
|
62
104
|
|
|
63
105
|
export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
|
|
64
106
|
export function callbackify<TResult>(fn: () => Promise<TResult>): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
|
@@ -154,3 +196,7 @@ declare module 'util' {
|
|
|
154
196
|
encodeInto(input: string, output: Uint8Array): EncodeIntoResult;
|
|
155
197
|
}
|
|
156
198
|
}
|
|
199
|
+
|
|
200
|
+
declare module 'node:util' {
|
|
201
|
+
export * from 'util';
|
|
202
|
+
}
|