@types/node 22.15.21 → 24.10.1

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 (75) hide show
  1. node/README.md +2 -2
  2. node/assert/strict.d.ts +105 -2
  3. node/assert.d.ts +162 -101
  4. node/async_hooks.d.ts +26 -6
  5. node/buffer.buffer.d.ts +9 -0
  6. node/buffer.d.ts +15 -7
  7. node/child_process.d.ts +91 -164
  8. node/cluster.d.ts +19 -20
  9. node/console.d.ts +19 -18
  10. node/crypto.d.ts +1264 -356
  11. node/dgram.d.ts +10 -9
  12. node/diagnostics_channel.d.ts +18 -15
  13. node/dns/promises.d.ts +36 -9
  14. node/dns.d.ts +95 -37
  15. node/domain.d.ts +1 -1
  16. node/events.d.ts +81 -36
  17. node/fs/promises.d.ts +104 -59
  18. node/fs.d.ts +414 -137
  19. node/globals.d.ts +149 -350
  20. node/globals.typedarray.d.ts +20 -0
  21. node/http.d.ts +187 -37
  22. node/http2.d.ts +266 -67
  23. node/https.d.ts +97 -63
  24. node/index.d.ts +16 -7
  25. node/inspector.d.ts +206 -3931
  26. node/inspector.generated.d.ts +4233 -0
  27. node/module.d.ts +153 -31
  28. node/net.d.ts +35 -16
  29. node/os.d.ts +22 -10
  30. node/package.json +14 -84
  31. node/path.d.ts +1 -1
  32. node/perf_hooks.d.ts +30 -18
  33. node/process.d.ts +40 -34
  34. node/punycode.d.ts +1 -1
  35. node/querystring.d.ts +1 -1
  36. node/readline/promises.d.ts +1 -2
  37. node/readline.d.ts +13 -13
  38. node/repl.d.ts +25 -17
  39. node/sea.d.ts +10 -1
  40. node/sqlite.d.ts +438 -9
  41. node/stream/consumers.d.ts +2 -2
  42. node/stream/web.d.ts +13 -54
  43. node/stream.d.ts +68 -47
  44. node/string_decoder.d.ts +3 -3
  45. node/test.d.ts +2034 -1975
  46. node/timers/promises.d.ts +1 -1
  47. node/timers.d.ts +1 -3
  48. node/tls.d.ts +124 -114
  49. node/trace_events.d.ts +6 -6
  50. node/ts5.6/buffer.buffer.d.ts +10 -2
  51. node/ts5.6/compatibility/float16array.d.ts +71 -0
  52. node/ts5.6/globals.typedarray.d.ts +17 -0
  53. node/ts5.6/index.d.ts +18 -7
  54. node/ts5.7/compatibility/float16array.d.ts +72 -0
  55. node/ts5.7/index.d.ts +103 -0
  56. node/tty.d.ts +1 -1
  57. node/url.d.ts +119 -34
  58. node/util.d.ts +46 -305
  59. node/v8.d.ts +100 -37
  60. node/vm.d.ts +299 -110
  61. node/wasi.d.ts +23 -2
  62. node/web-globals/abortcontroller.d.ts +34 -0
  63. node/web-globals/crypto.d.ts +32 -0
  64. node/web-globals/domexception.d.ts +68 -0
  65. node/web-globals/events.d.ts +97 -0
  66. node/web-globals/fetch.d.ts +50 -0
  67. node/web-globals/navigator.d.ts +25 -0
  68. node/web-globals/storage.d.ts +24 -0
  69. node/web-globals/streams.d.ts +22 -0
  70. node/worker_threads.d.ts +225 -75
  71. node/zlib.d.ts +44 -33
  72. node/compatibility/disposable.d.ts +0 -16
  73. node/compatibility/index.d.ts +0 -9
  74. node/compatibility/indexable.d.ts +0 -23
  75. node/dom-events.d.ts +0 -124
@@ -0,0 +1,34 @@
1
+ export {};
2
+
3
+ type _AbortController = typeof globalThis extends { onmessage: any } ? {} : AbortController;
4
+ interface AbortController {
5
+ readonly signal: AbortSignal;
6
+ abort(reason?: any): void;
7
+ }
8
+
9
+ type _AbortSignal = typeof globalThis extends { onmessage: any } ? {} : AbortSignal;
10
+ interface AbortSignal extends EventTarget {
11
+ readonly aborted: boolean;
12
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
13
+ readonly reason: any;
14
+ throwIfAborted(): void;
15
+ }
16
+
17
+ declare global {
18
+ interface AbortController extends _AbortController {}
19
+ var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
20
+ : {
21
+ prototype: AbortController;
22
+ new(): AbortController;
23
+ };
24
+
25
+ interface AbortSignal extends _AbortSignal {}
26
+ var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
27
+ : {
28
+ prototype: AbortSignal;
29
+ new(): AbortSignal;
30
+ abort(reason?: any): AbortSignal;
31
+ any(signals: AbortSignal[]): AbortSignal;
32
+ timeout(milliseconds: number): AbortSignal;
33
+ };
34
+ }
@@ -0,0 +1,32 @@
1
+ export {};
2
+
3
+ import { webcrypto } from "crypto";
4
+
5
+ declare global {
6
+ var Crypto: typeof globalThis extends { onmessage: any; Crypto: infer T } ? T : {
7
+ prototype: webcrypto.Crypto;
8
+ new(): webcrypto.Crypto;
9
+ };
10
+
11
+ var CryptoKey: typeof globalThis extends { onmessage: any; CryptoKey: infer T } ? T : {
12
+ prototype: webcrypto.CryptoKey;
13
+ new(): webcrypto.CryptoKey;
14
+ };
15
+
16
+ var SubtleCrypto: typeof globalThis extends { onmessage: any; SubtleCrypto: infer T } ? T : {
17
+ prototype: webcrypto.SubtleCrypto;
18
+ new(): webcrypto.SubtleCrypto;
19
+ supports(
20
+ operation: string,
21
+ algorithm: webcrypto.AlgorithmIdentifier,
22
+ length?: number,
23
+ ): boolean;
24
+ supports(
25
+ operation: string,
26
+ algorithm: webcrypto.AlgorithmIdentifier,
27
+ additionalAlgorithm: webcrypto.AlgorithmIdentifier,
28
+ ): boolean;
29
+ };
30
+
31
+ var crypto: typeof globalThis extends { onmessage: any; crypto: infer T } ? T : webcrypto.Crypto;
32
+ }
@@ -0,0 +1,68 @@
1
+ export {};
2
+
3
+ type _DOMException = typeof globalThis extends { onmessage: any } ? {} : DOMException;
4
+ interface DOMException extends Error {
5
+ readonly code: number;
6
+ readonly message: string;
7
+ readonly name: string;
8
+ readonly INDEX_SIZE_ERR: 1;
9
+ readonly DOMSTRING_SIZE_ERR: 2;
10
+ readonly HIERARCHY_REQUEST_ERR: 3;
11
+ readonly WRONG_DOCUMENT_ERR: 4;
12
+ readonly INVALID_CHARACTER_ERR: 5;
13
+ readonly NO_DATA_ALLOWED_ERR: 6;
14
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
15
+ readonly NOT_FOUND_ERR: 8;
16
+ readonly NOT_SUPPORTED_ERR: 9;
17
+ readonly INUSE_ATTRIBUTE_ERR: 10;
18
+ readonly INVALID_STATE_ERR: 11;
19
+ readonly SYNTAX_ERR: 12;
20
+ readonly INVALID_MODIFICATION_ERR: 13;
21
+ readonly NAMESPACE_ERR: 14;
22
+ readonly INVALID_ACCESS_ERR: 15;
23
+ readonly VALIDATION_ERR: 16;
24
+ readonly TYPE_MISMATCH_ERR: 17;
25
+ readonly SECURITY_ERR: 18;
26
+ readonly NETWORK_ERR: 19;
27
+ readonly ABORT_ERR: 20;
28
+ readonly URL_MISMATCH_ERR: 21;
29
+ readonly QUOTA_EXCEEDED_ERR: 22;
30
+ readonly TIMEOUT_ERR: 23;
31
+ readonly INVALID_NODE_TYPE_ERR: 24;
32
+ readonly DATA_CLONE_ERR: 25;
33
+ }
34
+
35
+ declare global {
36
+ interface DOMException extends _DOMException {}
37
+ var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
38
+ : {
39
+ prototype: DOMException;
40
+ new(message?: string, name?: string): DOMException;
41
+ new(message?: string, options?: { name?: string; cause?: unknown }): DOMException;
42
+ readonly INDEX_SIZE_ERR: 1;
43
+ readonly DOMSTRING_SIZE_ERR: 2;
44
+ readonly HIERARCHY_REQUEST_ERR: 3;
45
+ readonly WRONG_DOCUMENT_ERR: 4;
46
+ readonly INVALID_CHARACTER_ERR: 5;
47
+ readonly NO_DATA_ALLOWED_ERR: 6;
48
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
49
+ readonly NOT_FOUND_ERR: 8;
50
+ readonly NOT_SUPPORTED_ERR: 9;
51
+ readonly INUSE_ATTRIBUTE_ERR: 10;
52
+ readonly INVALID_STATE_ERR: 11;
53
+ readonly SYNTAX_ERR: 12;
54
+ readonly INVALID_MODIFICATION_ERR: 13;
55
+ readonly NAMESPACE_ERR: 14;
56
+ readonly INVALID_ACCESS_ERR: 15;
57
+ readonly VALIDATION_ERR: 16;
58
+ readonly TYPE_MISMATCH_ERR: 17;
59
+ readonly SECURITY_ERR: 18;
60
+ readonly NETWORK_ERR: 19;
61
+ readonly ABORT_ERR: 20;
62
+ readonly URL_MISMATCH_ERR: 21;
63
+ readonly QUOTA_EXCEEDED_ERR: 22;
64
+ readonly TIMEOUT_ERR: 23;
65
+ readonly INVALID_NODE_TYPE_ERR: 24;
66
+ readonly DATA_CLONE_ERR: 25;
67
+ };
68
+ }
@@ -0,0 +1,97 @@
1
+ export {};
2
+
3
+ interface AddEventListenerOptions extends EventListenerOptions {
4
+ once?: boolean;
5
+ passive?: boolean;
6
+ signal?: AbortSignal;
7
+ }
8
+
9
+ type _CustomEvent<T = any> = typeof globalThis extends { onmessage: any } ? {} : CustomEvent<T>;
10
+ interface CustomEvent<T = any> extends Event {
11
+ readonly detail: T;
12
+ }
13
+
14
+ interface CustomEventInit<T = any> extends EventInit {
15
+ detail?: T;
16
+ }
17
+
18
+ type _Event = typeof globalThis extends { onmessage: any } ? {} : Event;
19
+ interface Event {
20
+ readonly bubbles: boolean;
21
+ cancelBubble: boolean;
22
+ readonly cancelable: boolean;
23
+ readonly composed: boolean;
24
+ readonly currentTarget: EventTarget | null;
25
+ readonly defaultPrevented: boolean;
26
+ readonly eventPhase: 0 | 2;
27
+ readonly isTrusted: boolean;
28
+ returnValue: boolean;
29
+ readonly srcElement: EventTarget | null;
30
+ readonly target: EventTarget | null;
31
+ readonly timeStamp: number;
32
+ readonly type: string;
33
+ composedPath(): [EventTarget?];
34
+ initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
35
+ preventDefault(): void;
36
+ stopImmediatePropagation(): void;
37
+ stopPropagation(): void;
38
+ }
39
+
40
+ interface EventInit {
41
+ bubbles?: boolean;
42
+ cancelable?: boolean;
43
+ composed?: boolean;
44
+ }
45
+
46
+ interface EventListener {
47
+ (evt: Event): void;
48
+ }
49
+
50
+ interface EventListenerObject {
51
+ handleEvent(object: Event): void;
52
+ }
53
+
54
+ type _EventListenerOptions = typeof globalThis extends { onmessage: any } ? {} : EventListenerOptions;
55
+ interface EventListenerOptions {
56
+ capture?: boolean;
57
+ }
58
+
59
+ type _EventTarget = typeof globalThis extends { onmessage: any } ? {} : EventTarget;
60
+ interface EventTarget {
61
+ addEventListener(
62
+ type: string,
63
+ listener: EventListener | EventListenerObject,
64
+ options?: AddEventListenerOptions | boolean,
65
+ ): void;
66
+ dispatchEvent(event: Event): boolean;
67
+ removeEventListener(
68
+ type: string,
69
+ listener: EventListener | EventListenerObject,
70
+ options?: EventListenerOptions | boolean,
71
+ ): void;
72
+ }
73
+
74
+ declare global {
75
+ interface CustomEvent<T = any> extends _CustomEvent<T> {}
76
+ var CustomEvent: typeof globalThis extends { onmessage: any; CustomEvent: infer T } ? T
77
+ : {
78
+ prototype: CustomEvent;
79
+ new<T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
80
+ };
81
+
82
+ interface Event extends _Event {}
83
+ var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
84
+ : {
85
+ prototype: Event;
86
+ new(type: string, eventInitDict?: EventInit): Event;
87
+ };
88
+
89
+ interface EventListenerOptions extends _EventListenerOptions {}
90
+
91
+ interface EventTarget extends _EventTarget {}
92
+ var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
93
+ : {
94
+ prototype: EventTarget;
95
+ new(): EventTarget;
96
+ };
97
+ }
@@ -0,0 +1,50 @@
1
+ export {};
2
+
3
+ import * as undici from "undici-types";
4
+
5
+ type _CloseEvent = typeof globalThis extends { onmessage: any } ? {} : undici.CloseEvent;
6
+ type _EventSource = typeof globalThis extends { onmessage: any } ? {} : undici.EventSource;
7
+ type _FormData = typeof globalThis extends { onmessage: any } ? {} : undici.FormData;
8
+ type _Headers = typeof globalThis extends { onmessage: any } ? {} : undici.Headers;
9
+ type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : undici.MessageEvent;
10
+ type _Request = typeof globalThis extends { onmessage: any } ? {} : undici.Request;
11
+ type _RequestInit = typeof globalThis extends { onmessage: any } ? {} : undici.RequestInit;
12
+ type _Response = typeof globalThis extends { onmessage: any } ? {} : undici.Response;
13
+ type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} : undici.ResponseInit;
14
+ type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : undici.WebSocket;
15
+
16
+ declare global {
17
+ function fetch(
18
+ input: string | URL | Request,
19
+ init?: RequestInit,
20
+ ): Promise<Response>;
21
+
22
+ interface CloseEvent extends _CloseEvent {}
23
+ var CloseEvent: typeof globalThis extends { onmessage: any; CloseEvent: infer T } ? T : typeof undici.CloseEvent;
24
+
25
+ interface EventSource extends _EventSource {}
26
+ var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T : typeof undici.EventSource;
27
+
28
+ interface FormData extends _FormData {}
29
+ var FormData: typeof globalThis extends { onmessage: any; FormData: infer T } ? T : typeof undici.FormData;
30
+
31
+ interface Headers extends _Headers {}
32
+ var Headers: typeof globalThis extends { onmessage: any; Headers: infer T } ? T : typeof undici.Headers;
33
+
34
+ interface MessageEvent extends _MessageEvent {}
35
+ var MessageEvent: typeof globalThis extends { onmessage: any; MessageEvent: infer T } ? T
36
+ : typeof undici.MessageEvent;
37
+
38
+ interface Request extends _Request {}
39
+ var Request: typeof globalThis extends { onmessage: any; Request: infer T } ? T : typeof undici.Request;
40
+
41
+ interface RequestInit extends _RequestInit {}
42
+
43
+ interface Response extends _Response {}
44
+ var Response: typeof globalThis extends { onmessage: any; Response: infer T } ? T : typeof undici.Response;
45
+
46
+ interface ResponseInit extends _ResponseInit {}
47
+
48
+ interface WebSocket extends _WebSocket {}
49
+ var WebSocket: typeof globalThis extends { onmessage: any; WebSocket: infer T } ? T : typeof undici.WebSocket;
50
+ }
@@ -0,0 +1,25 @@
1
+ export {};
2
+
3
+ import { LockManager } from "worker_threads";
4
+
5
+ // lib.webworker has `WorkerNavigator` rather than `Navigator`, so conditionals use `onabort` instead of `onmessage`
6
+ type _Navigator = typeof globalThis extends { onabort: any } ? {} : Navigator;
7
+ interface Navigator {
8
+ readonly hardwareConcurrency: number;
9
+ readonly language: string;
10
+ readonly languages: readonly string[];
11
+ readonly locks: LockManager;
12
+ readonly platform: string;
13
+ readonly userAgent: string;
14
+ }
15
+
16
+ declare global {
17
+ interface Navigator extends _Navigator {}
18
+ var Navigator: typeof globalThis extends { onabort: any; Navigator: infer T } ? T : {
19
+ prototype: Navigator;
20
+ new(): Navigator;
21
+ };
22
+
23
+ // Needs conditional inference for lib.dom and lib.webworker compatibility
24
+ var navigator: typeof globalThis extends { onmessage: any; navigator: infer T } ? T : Navigator;
25
+ }
@@ -0,0 +1,24 @@
1
+ export {};
2
+
3
+ // These interfaces are absent from lib.webworker, so the conditionals use `onabort` rather than `onmessage`
4
+ type _Storage = typeof globalThis extends { onabort: any } ? {} : Storage;
5
+ interface Storage {
6
+ readonly length: number;
7
+ clear(): void;
8
+ getItem(key: string): string | null;
9
+ key(index: number): string | null;
10
+ removeItem(key: string): void;
11
+ setItem(key: string, value: string): void;
12
+ [key: string]: any;
13
+ }
14
+
15
+ declare global {
16
+ interface Storage extends _Storage {}
17
+ var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T : {
18
+ prototype: Storage;
19
+ new(): Storage;
20
+ };
21
+
22
+ var localStorage: Storage;
23
+ var sessionStorage: Storage;
24
+ }
@@ -0,0 +1,22 @@
1
+ export {};
2
+
3
+ import * as webstreams from "stream/web";
4
+
5
+ type _CompressionStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.CompressionStream;
6
+ type _DecompressionStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.DecompressionStream;
7
+
8
+ declare global {
9
+ interface CompressionStream extends _CompressionStream {}
10
+ var CompressionStream: typeof globalThis extends {
11
+ onmessage: any;
12
+ CompressionStream: infer T;
13
+ } ? T
14
+ : typeof webstreams.CompressionStream;
15
+
16
+ interface DecompressionStream extends _DecompressionStream {}
17
+ var DecompressionStream: typeof globalThis extends {
18
+ onmessage: any;
19
+ DecompressionStream: infer T;
20
+ } ? T
21
+ : typeof webstreams.DecompressionStream;
22
+ }