@types/node 15.14.6 → 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.
Files changed (64) hide show
  1. {node v15.14 → node}/LICENSE +0 -0
  2. node v15.14/README.md → node/README.md +3 -3
  3. node/assert/strict.d.ts +9 -0
  4. node v15.14/assert.d.ts → node/assert.d.ts +32 -27
  5. node v15.14/async_hooks.d.ts → node/async_hooks.d.ts +5 -1
  6. {node v15.14 → node}/base.d.ts +0 -0
  7. node/buffer.d.ts +357 -0
  8. node v15.14/child_process.d.ts → node/child_process.d.ts +5 -1
  9. node v15.14/cluster.d.ts → node/cluster.d.ts +25 -100
  10. node v15.14/console.d.ts → node/console.d.ts +21 -20
  11. node v15.14/constants.d.ts → node/constants.d.ts +5 -0
  12. node v15.14/crypto.d.ts → node/crypto.d.ts +21 -6
  13. node v15.14/dgram.d.ts → node/dgram.d.ts +4 -0
  14. node v15.14/diagnostic_channel.d.ts → node/diagnostic_channel.d.ts +4 -0
  15. node v15.14/dns/promises.d.ts → node/dns/promises.d.ts +4 -0
  16. node v15.14/dns.d.ts → node/dns.d.ts +4 -0
  17. node/domain.d.ts +25 -0
  18. node v15.14/events.d.ts → node/events.d.ts +5 -0
  19. node v15.14/fs/promises.d.ts → node/fs/promises.d.ts +4 -0
  20. node v15.14/fs.d.ts → node/fs.d.ts +12 -20
  21. node/globals.d.ts +274 -0
  22. node/globals.global.d.ts +1 -0
  23. node v15.14/http.d.ts → node/http.d.ts +5 -1
  24. node v15.14/http2.d.ts → node/http2.d.ts +4 -1
  25. node v15.14/https.d.ts → node/https.d.ts +4 -0
  26. node v15.14/index.d.ts → node/index.d.ts +1 -1
  27. node v15.14/inspector.d.ts → node/inspector.d.ts +4 -322
  28. node v15.14/module.d.ts → node/module.d.ts +25 -4
  29. node v15.14/net.d.ts → node/net.d.ts +4 -6
  30. node v15.14/os.d.ts → node/os.d.ts +4 -0
  31. node v15.14/package.json → node/package.json +2 -2
  32. node v15.14/path.d.ts → node/path.d.ts +5 -0
  33. node v15.14/perf_hooks.d.ts → node/perf_hooks.d.ts +66 -19
  34. node v15.14/process.d.ts → node/process.d.ts +41 -38
  35. node v15.14/punycode.d.ts → node/punycode.d.ts +4 -0
  36. node v15.14/querystring.d.ts → node/querystring.d.ts +4 -0
  37. node v15.14/readline.d.ts → node/readline.d.ts +5 -1
  38. node v15.14/repl.d.ts → node/repl.d.ts +4 -0
  39. node v15.14/stream/promises.d.ts → node/stream/promises.d.ts +4 -0
  40. node v15.14/stream.d.ts → node/stream.d.ts +5 -0
  41. node v15.14/string_decoder.d.ts → node/string_decoder.d.ts +4 -0
  42. node v15.14/timers/promises.d.ts → node/timers/promises.d.ts +4 -0
  43. node/timers.d.ts +92 -0
  44. node v15.14/tls.d.ts → node/tls.d.ts +4 -0
  45. node v15.14/trace_events.d.ts → node/trace_events.d.ts +4 -0
  46. node v15.14/ts3.6/assert.d.ts → node/ts3.6/assert.d.ts +26 -26
  47. {node v15.14 → node}/ts3.6/base.d.ts +0 -0
  48. {node v15.14 → node}/ts3.6/index.d.ts +0 -0
  49. node v15.14/tty.d.ts → node/tty.d.ts +4 -0
  50. node v15.14/url.d.ts → node/url.d.ts +4 -0
  51. node/util/types.d.ts +57 -0
  52. node v15.14/util.d.ts → node/util.d.ts +65 -19
  53. node v15.14/v8.d.ts → node/v8.d.ts +4 -0
  54. node v15.14/vm.d.ts → node/vm.d.ts +4 -0
  55. node v15.14/wasi.d.ts → node/wasi.d.ts +4 -0
  56. node v15.14/worker_threads.d.ts → node/worker_threads.d.ts +4 -0
  57. node v15.14/zlib.d.ts → node/zlib.d.ts +4 -0
  58. node v15.14/assert/strict.d.ts +0 -4
  59. node v15.14/buffer.d.ts +0 -112
  60. node v15.14/domain.d.ts +0 -24
  61. node v15.14/globals.d.ts +0 -659
  62. node v15.14/globals.global.d.ts +0 -1
  63. node v15.14/timers.d.ts +0 -27
  64. 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'
@@ -209,6 +210,33 @@ declare module 'process' {
209
210
  detail?: string;
210
211
  }
211
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
+
212
240
  interface Process extends EventEmitter {
213
241
  /**
214
242
  * Can also be a tty.WriteStream, not typed due to limitations.
@@ -265,46 +293,21 @@ declare module 'process' {
265
293
  setgroups(groups: ReadonlyArray<string | number>): void;
266
294
  setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
267
295
  hasUncaughtExceptionCaptureCallback(): boolean;
268
- version: string;
269
- versions: ProcessVersions;
270
- config: {
271
- target_defaults: {
272
- cflags: any[];
273
- default_configuration: string;
274
- defines: string[];
275
- include_dirs: string[];
276
- libraries: string[];
277
- };
278
- variables: {
279
- clang: number;
280
- host_arch: string;
281
- node_install_npm: boolean;
282
- node_install_waf: boolean;
283
- node_prefix: string;
284
- node_shared_openssl: boolean;
285
- node_shared_v8: boolean;
286
- node_shared_zlib: boolean;
287
- node_use_dtrace: boolean;
288
- node_use_etw: boolean;
289
- node_use_openssl: boolean;
290
- target_arch: string;
291
- v8_no_strict_aliasing: number;
292
- v8_use_snapshot: boolean;
293
- visibility: string;
294
- };
295
- };
296
+ readonly version: string;
297
+ readonly versions: ProcessVersions;
298
+ readonly config: ProcessConfig;
296
299
  kill(pid: number, signal?: string | number): true;
297
- pid: number;
298
- ppid: number;
300
+ readonly pid: number;
301
+ readonly ppid: number;
299
302
  title: string;
300
- arch: string;
301
- platform: Platform;
303
+ readonly arch: string;
304
+ readonly platform: Platform;
302
305
  /** @deprecated since v14.0.0 - use `require.main` instead. */
303
306
  mainModule?: Module;
304
307
  memoryUsage: MemoryUsageFn;
305
308
  cpuUsage(previousValue?: CpuUsage): CpuUsage;
306
309
  nextTick(callback: Function, ...args: any[]): void;
307
- release: ProcessRelease;
310
+ readonly release: ProcessRelease;
308
311
  features: {
309
312
  inspector: boolean;
310
313
  debug: boolean;
@@ -327,7 +330,6 @@ declare module 'process' {
327
330
  umask(mask: string | number): number;
328
331
  uptime(): number;
329
332
  hrtime: HRTime;
330
- domain: Domain;
331
333
 
332
334
  // Worker
333
335
  send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
@@ -450,12 +452,13 @@ declare module 'process' {
450
452
  listeners(event: "removeListener"): RemoveListenerListener[];
451
453
  listeners(event: "multipleResolves"): MultipleResolveListener[];
452
454
  }
453
-
454
- interface Global {
455
- process: Process;
456
- }
457
455
  }
458
456
  }
459
457
 
460
458
  export = process;
461
459
  }
460
+
461
+ declare module 'node:process' {
462
+ import process = require('process');
463
+ export = process;
464
+ }
@@ -73,3 +73,7 @@ declare module 'punycode' {
73
73
  */
74
74
  const version: string;
75
75
  }
76
+
77
+ declare module 'node:punycode' {
78
+ export * from 'punycode';
79
+ }
@@ -26,3 +26,7 @@ declare module 'querystring' {
26
26
  function escape(str: string): string;
27
27
  function unescape(str: string): string;
28
28
  }
29
+
30
+ declare module 'node:querystring' {
31
+ export * from 'querystring';
32
+ }
@@ -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) => any;
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
+ }
@@ -393,3 +393,7 @@ declare module 'repl' {
393
393
  constructor(err: Error);
394
394
  }
395
395
  }
396
+
397
+ declare module 'node:repl' {
398
+ export * from 'repl';
399
+ }
@@ -65,3 +65,7 @@ declare module "stream/promises" {
65
65
  ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>,
66
66
  ): Promise<void>;
67
67
  }
68
+
69
+ declare module 'node:stream/promises' {
70
+ export * from 'stream/promises';
71
+ }
@@ -469,3 +469,8 @@ declare module 'stream' {
469
469
 
470
470
  export = internal;
471
471
  }
472
+
473
+ declare module 'node:stream' {
474
+ import stream = require('stream');
475
+ export = stream;
476
+ }
@@ -5,3 +5,7 @@ declare module 'string_decoder' {
5
5
  end(buffer?: Buffer): string;
6
6
  }
7
7
  }
8
+
9
+ declare module 'node:string_decoder' {
10
+ export * from 'string_decoder';
11
+ }
@@ -19,3 +19,7 @@ declare module 'timers/promises' {
19
19
  */
20
20
  function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
21
21
  }
22
+
23
+ declare module 'node:timers/promises' {
24
+ export * from 'timers/promises';
25
+ }
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
+ }
@@ -791,3 +791,7 @@ declare module 'tls' {
791
791
  */
792
792
  const rootCertificates: ReadonlyArray<string>;
793
793
  }
794
+
795
+ declare module 'node:tls' {
796
+ export * from 'tls';
797
+ }
@@ -59,3 +59,7 @@ declare module 'trace_events' {
59
59
  */
60
60
  function getEnabledCategories(): string | undefined;
61
61
  }
62
+
63
+ declare module 'node:trace_events' {
64
+ export * from 'trace_events';
65
+ }
@@ -1,10 +1,10 @@
1
1
  declare module 'assert' {
2
2
  /** An alias of `assert.ok()`. */
3
- function assert(value: any, message?: string | Error): void;
3
+ function assert(value: unknown, message?: string | Error): void;
4
4
  namespace assert {
5
5
  class AssertionError extends Error {
6
- actual: any;
7
- expected: any;
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?: any;
16
+ actual?: unknown;
17
17
  /** The `expected` property on the error instance. */
18
- expected?: any;
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: any) => boolean) | object | Error;
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: any,
51
- expected: any,
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: any, message?: string | Error): void;
57
+ function ok(value: unknown, message?: string | Error): void;
58
58
  /** @deprecated since v9.9.0 - use strictEqual() instead. */
59
- function equal(actual: any, expected: any, message?: string | Error): void;
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: any, expected: any, message?: string | Error): void;
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: any, expected: any, message?: string | Error): void;
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: any, expected: any, message?: string | Error): void;
66
- function strictEqual(actual: any, expected: any, message?: string | Error): void;
67
- function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
68
- function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
69
- function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
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: () => any, message?: string | Error): void;
72
- function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73
- function doesNotThrow(block: () => any, message?: string | Error): void;
74
- function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
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: any): void;
76
+ function ifError(value: unknown): void;
77
77
 
78
- function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
78
+ function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
79
79
  function rejects(
80
- block: (() => Promise<any>) | Promise<any>,
80
+ block: (() => Promise<unknown>) | Promise<unknown>,
81
81
  error: AssertPredicate,
82
82
  message?: string | Error,
83
83
  ): Promise<void>;
84
- function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
84
+ function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
85
85
  function doesNotReject(
86
- block: (() => Promise<any>) | Promise<any>,
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
@@ -64,3 +64,7 @@ declare module 'tty' {
64
64
  isTTY: boolean;
65
65
  }
66
66
  }
67
+
68
+ declare module 'node:tty' {
69
+ export * from 'tty';
70
+ }
@@ -114,3 +114,7 @@ declare module 'url' {
114
114
  [Symbol.iterator](): IterableIterator<[string, string]>;
115
115
  }
116
116
  }
117
+
118
+ declare module 'node:url' {
119
+ export * from 'url';
120
+ }
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 extends NodeJS.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: any): object is any[];
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: any): object is RegExp;
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: any): object is Date;
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: any): object is Error;
36
- export function inherits(constructor: any, superConstructor: any): void;
37
- export function debuglog(key: string): (msg: string, ...param: any[]) => void;
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: any): object is boolean;
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: any): object is Buffer;
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: any): boolean;
85
+ export function isFunction(object: unknown): boolean;
44
86
  /** @deprecated since v4.0.0 - use `value === null` instead. */
45
- export function isNull(object: any): object is null;
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: any): object is null | undefined;
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: any): object is number;
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: any): boolean;
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: any): boolean;
95
+ export function isPrimitive(object: unknown): boolean;
54
96
  /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */
55
- export function isString(object: any): object is string;
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: any): object is symbol;
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: any): object is undefined;
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: any, val2: any): boolean;
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
+ }
@@ -196,3 +196,7 @@ declare module 'v8' {
196
196
  */
197
197
  function stopCoverage(): void;
198
198
  }
199
+
200
+ declare module 'node:v8' {
201
+ export * from 'v8';
202
+ }
@@ -150,3 +150,7 @@ declare module 'vm' {
150
150
  */
151
151
  function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
152
152
  }
153
+
154
+ declare module 'node:vm' {
155
+ export * from 'vm';
156
+ }
@@ -84,3 +84,7 @@ declare module 'wasi' {
84
84
  readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
85
85
  }
86
86
  }
87
+
88
+ declare module 'node:wasi' {
89
+ export * from 'wasi';
90
+ }
@@ -280,3 +280,7 @@ declare module 'worker_threads' {
280
280
  */
281
281
  function setEnvironmentData(key: Serializable, value: Serializable): void;
282
282
  }
283
+
284
+ declare module 'node:worker_threads' {
285
+ export * from 'worker_threads';
286
+ }