@types/node 22.15.7 → 22.15.9
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/buffer.buffer.d.ts +2 -0
- node/buffer.d.ts +1 -1
- node/fs.d.ts +7 -7
- node/globals.d.ts +140 -280
- node/package.json +2 -2
- node/ts5.6/buffer.buffer.d.ts +2 -0
node/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated: Mon, 05 May 2025
|
11
|
+
* Last updated: Mon, 05 May 2025 23:02:37 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node/buffer.buffer.d.ts
CHANGED
@@ -451,6 +451,8 @@ declare module "buffer" {
|
|
451
451
|
*/
|
452
452
|
subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
|
453
453
|
}
|
454
|
+
type NonSharedBuffer = Buffer<ArrayBuffer>;
|
455
|
+
type AllowSharedBuffer = Buffer<ArrayBufferLike>;
|
454
456
|
}
|
455
457
|
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
456
458
|
var SlowBuffer: {
|
node/buffer.d.ts
CHANGED
@@ -122,7 +122,7 @@ declare module "buffer" {
|
|
122
122
|
* @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
|
123
123
|
*/
|
124
124
|
export function resolveObjectURL(id: string): Blob | undefined;
|
125
|
-
export { Buffer };
|
125
|
+
export { type AllowSharedBuffer, Buffer, type NonSharedBuffer };
|
126
126
|
/**
|
127
127
|
* @experimental
|
128
128
|
*/
|
node/fs.d.ts
CHANGED
@@ -2684,7 +2684,7 @@ declare module "fs" {
|
|
2684
2684
|
} & Abortable)
|
2685
2685
|
| undefined
|
2686
2686
|
| null,
|
2687
|
-
callback: (err: NodeJS.ErrnoException | null, data:
|
2687
|
+
callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void,
|
2688
2688
|
): void;
|
2689
2689
|
/**
|
2690
2690
|
* Asynchronously reads the entire contents of a file.
|
@@ -2719,7 +2719,7 @@ declare module "fs" {
|
|
2719
2719
|
| BufferEncoding
|
2720
2720
|
| undefined
|
2721
2721
|
| null,
|
2722
|
-
callback: (err: NodeJS.ErrnoException | null, data: string |
|
2722
|
+
callback: (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void,
|
2723
2723
|
): void;
|
2724
2724
|
/**
|
2725
2725
|
* Asynchronously reads the entire contents of a file.
|
@@ -2728,7 +2728,7 @@ declare module "fs" {
|
|
2728
2728
|
*/
|
2729
2729
|
export function readFile(
|
2730
2730
|
path: PathOrFileDescriptor,
|
2731
|
-
callback: (err: NodeJS.ErrnoException | null, data:
|
2731
|
+
callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void,
|
2732
2732
|
): void;
|
2733
2733
|
export namespace readFile {
|
2734
2734
|
/**
|
@@ -2744,7 +2744,7 @@ declare module "fs" {
|
|
2744
2744
|
encoding?: null | undefined;
|
2745
2745
|
flag?: string | undefined;
|
2746
2746
|
} | null,
|
2747
|
-
): Promise<
|
2747
|
+
): Promise<NonSharedBuffer>;
|
2748
2748
|
/**
|
2749
2749
|
* Asynchronously reads the entire contents of a file.
|
2750
2750
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
@@ -2778,7 +2778,7 @@ declare module "fs" {
|
|
2778
2778
|
})
|
2779
2779
|
| BufferEncoding
|
2780
2780
|
| null,
|
2781
|
-
): Promise<string |
|
2781
|
+
): Promise<string | NonSharedBuffer>;
|
2782
2782
|
}
|
2783
2783
|
/**
|
2784
2784
|
* Returns the contents of the `path`.
|
@@ -2810,7 +2810,7 @@ declare module "fs" {
|
|
2810
2810
|
encoding?: null | undefined;
|
2811
2811
|
flag?: string | undefined;
|
2812
2812
|
} | null,
|
2813
|
-
):
|
2813
|
+
): NonSharedBuffer;
|
2814
2814
|
/**
|
2815
2815
|
* Synchronously reads the entire contents of a file.
|
2816
2816
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
@@ -2842,7 +2842,7 @@ declare module "fs" {
|
|
2842
2842
|
})
|
2843
2843
|
| BufferEncoding
|
2844
2844
|
| null,
|
2845
|
-
): string |
|
2845
|
+
): string | NonSharedBuffer;
|
2846
2846
|
export type WriteFileOptions =
|
2847
2847
|
| (
|
2848
2848
|
& ObjectEncodingOptions
|
node/globals.d.ts
CHANGED
@@ -18,43 +18,11 @@ type _EventSource = typeof globalThis extends { onmessage: any } ? {} : import("
|
|
18
18
|
|
19
19
|
// Conditional type definitions for webstorage interface, which conflicts with lib.dom otherwise.
|
20
20
|
type _Storage = typeof globalThis extends { onabort: any } ? {} : {
|
21
|
-
/**
|
22
|
-
* Returns the number of key/value pairs.
|
23
|
-
*
|
24
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/length)
|
25
|
-
*/
|
26
21
|
readonly length: number;
|
27
|
-
/**
|
28
|
-
* Removes all key/value pairs, if there are any.
|
29
|
-
*
|
30
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/clear)
|
31
|
-
*/
|
32
22
|
clear(): void;
|
33
|
-
/**
|
34
|
-
* Returns the current value associated with the given key, or null if the given key does not exist.
|
35
|
-
*
|
36
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/getItem)
|
37
|
-
*/
|
38
23
|
getItem(key: string): string | null;
|
39
|
-
/**
|
40
|
-
* Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs.
|
41
|
-
*
|
42
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/key)
|
43
|
-
*/
|
44
24
|
key(index: number): string | null;
|
45
|
-
/**
|
46
|
-
* Removes the key/value pair with the given key, if a key/value pair with the given key exists.
|
47
|
-
*
|
48
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/removeItem)
|
49
|
-
*/
|
50
25
|
removeItem(key: string): void;
|
51
|
-
/**
|
52
|
-
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
|
53
|
-
*
|
54
|
-
* Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set.
|
55
|
-
*
|
56
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/setItem)
|
57
|
-
*/
|
58
26
|
setItem(key: string, value: string): void;
|
59
27
|
[key: string]: any;
|
60
28
|
};
|
@@ -62,15 +30,8 @@ type _Storage = typeof globalThis extends { onabort: any } ? {} : {
|
|
62
30
|
// #region DOMException
|
63
31
|
type _DOMException = typeof globalThis extends { onmessage: any } ? {} : NodeDOMException;
|
64
32
|
interface NodeDOMException extends Error {
|
65
|
-
/**
|
66
|
-
* @deprecated
|
67
|
-
*
|
68
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
69
|
-
*/
|
70
33
|
readonly code: number;
|
71
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
|
72
34
|
readonly message: string;
|
73
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
|
74
35
|
readonly name: string;
|
75
36
|
readonly INDEX_SIZE_ERR: 1;
|
76
37
|
readonly DOMSTRING_SIZE_ERR: 2;
|
@@ -130,263 +91,104 @@ interface NodeDOMExceptionConstructor {
|
|
130
91
|
// #endregion DOMException
|
131
92
|
|
132
93
|
declare global {
|
133
|
-
// Declare "static" methods in Error
|
134
|
-
interface ErrorConstructor {
|
135
|
-
/** Create .stack property on a target object */
|
136
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
137
|
-
|
138
|
-
/**
|
139
|
-
* Optional override for formatting stack traces
|
140
|
-
*
|
141
|
-
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
142
|
-
*/
|
143
|
-
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
144
|
-
|
145
|
-
stackTraceLimit: number;
|
146
|
-
}
|
147
|
-
|
148
|
-
/*-----------------------------------------------*
|
149
|
-
* *
|
150
|
-
* GLOBAL *
|
151
|
-
* *
|
152
|
-
------------------------------------------------*/
|
153
|
-
|
154
94
|
var global: typeof globalThis;
|
155
95
|
|
156
96
|
var process: NodeJS.Process;
|
157
97
|
var console: Console;
|
158
98
|
|
159
|
-
interface
|
160
|
-
(options: {
|
161
|
-
execution?: "sync";
|
162
|
-
flavor?: "regular" | "last-resort";
|
163
|
-
type?: "major-snapshot" | "major" | "minor";
|
164
|
-
filename?: string;
|
165
|
-
}): void;
|
166
|
-
(options: {
|
167
|
-
execution: "async";
|
168
|
-
flavor?: "regular" | "last-resort";
|
169
|
-
type?: "major-snapshot" | "major" | "minor";
|
170
|
-
filename?: string;
|
171
|
-
}): Promise<void>;
|
172
|
-
(options?: boolean): void;
|
173
|
-
}
|
174
|
-
|
175
|
-
/**
|
176
|
-
* Only available if `--expose-gc` is passed to the process.
|
177
|
-
*/
|
178
|
-
var gc: undefined | GCFunction;
|
179
|
-
|
180
|
-
// #region borrowed
|
181
|
-
// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
|
182
|
-
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
|
183
|
-
interface AbortController {
|
99
|
+
interface ErrorConstructor {
|
184
100
|
/**
|
185
|
-
*
|
101
|
+
* Creates a `.stack` property on `targetObject`, which when accessed returns
|
102
|
+
* a string representing the location in the code at which
|
103
|
+
* `Error.captureStackTrace()` was called.
|
104
|
+
*
|
105
|
+
* ```js
|
106
|
+
* const myObject = {};
|
107
|
+
* Error.captureStackTrace(myObject);
|
108
|
+
* myObject.stack; // Similar to `new Error().stack`
|
109
|
+
* ```
|
110
|
+
*
|
111
|
+
* The first line of the trace will be prefixed with
|
112
|
+
* `${myObject.name}: ${myObject.message}`.
|
113
|
+
*
|
114
|
+
* The optional `constructorOpt` argument accepts a function. If given, all frames
|
115
|
+
* above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
116
|
+
* generated stack trace.
|
117
|
+
*
|
118
|
+
* The `constructorOpt` argument is useful for hiding implementation
|
119
|
+
* details of error generation from the user. For instance:
|
120
|
+
*
|
121
|
+
* ```js
|
122
|
+
* function a() {
|
123
|
+
* b();
|
124
|
+
* }
|
125
|
+
*
|
126
|
+
* function b() {
|
127
|
+
* c();
|
128
|
+
* }
|
129
|
+
*
|
130
|
+
* function c() {
|
131
|
+
* // Create an error without stack trace to avoid calculating the stack trace twice.
|
132
|
+
* const { stackTraceLimit } = Error;
|
133
|
+
* Error.stackTraceLimit = 0;
|
134
|
+
* const error = new Error();
|
135
|
+
* Error.stackTraceLimit = stackTraceLimit;
|
136
|
+
*
|
137
|
+
* // Capture the stack trace above function b
|
138
|
+
* Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
139
|
+
* throw error;
|
140
|
+
* }
|
141
|
+
*
|
142
|
+
* a();
|
143
|
+
* ```
|
186
144
|
*/
|
187
|
-
|
188
|
-
readonly signal: AbortSignal;
|
145
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
189
146
|
/**
|
190
|
-
*
|
147
|
+
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
191
148
|
*/
|
192
|
-
|
193
|
-
}
|
194
|
-
|
195
|
-
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
|
196
|
-
interface AbortSignal extends EventTarget {
|
149
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
197
150
|
/**
|
198
|
-
*
|
151
|
+
* The `Error.stackTraceLimit` property specifies the number of stack frames
|
152
|
+
* collected by a stack trace (whether generated by `new Error().stack` or
|
153
|
+
* `Error.captureStackTrace(obj)`).
|
154
|
+
*
|
155
|
+
* The default value is `10` but may be set to any valid JavaScript number. Changes
|
156
|
+
* will affect any stack trace captured _after_ the value has been changed.
|
157
|
+
*
|
158
|
+
* If set to a non-number value, or set to a negative number, stack traces will
|
159
|
+
* not capture any frames.
|
199
160
|
*/
|
200
|
-
|
201
|
-
readonly reason: any;
|
202
|
-
onabort: null | ((this: AbortSignal, event: Event) => any);
|
203
|
-
throwIfAborted(): void;
|
161
|
+
stackTraceLimit: number;
|
204
162
|
}
|
205
163
|
|
206
|
-
var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
|
207
|
-
: {
|
208
|
-
prototype: AbortController;
|
209
|
-
new(): AbortController;
|
210
|
-
};
|
211
|
-
|
212
|
-
var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
|
213
|
-
: {
|
214
|
-
prototype: AbortSignal;
|
215
|
-
new(): AbortSignal;
|
216
|
-
abort(reason?: any): AbortSignal;
|
217
|
-
timeout(milliseconds: number): AbortSignal;
|
218
|
-
any(signals: AbortSignal[]): AbortSignal;
|
219
|
-
};
|
220
|
-
// #endregion borrowed
|
221
|
-
|
222
|
-
// #region Storage
|
223
|
-
/**
|
224
|
-
* This Web Storage API interface provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items.
|
225
|
-
*
|
226
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage)
|
227
|
-
*/
|
228
|
-
interface Storage extends _Storage {}
|
229
|
-
|
230
|
-
// Conditional on `onabort` rather than `onmessage`, in order to exclude lib.webworker
|
231
|
-
var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T
|
232
|
-
: {
|
233
|
-
prototype: Storage;
|
234
|
-
new(): Storage;
|
235
|
-
};
|
236
|
-
|
237
|
-
/**
|
238
|
-
* A browser-compatible implementation of [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage). Data is stored
|
239
|
-
* unencrypted in the file specified by the `--localstorage-file` CLI flag.
|
240
|
-
* The maximum amount of data that can be stored is 10 MB.
|
241
|
-
* Any modification of this data outside of the Web Storage API is not supported.
|
242
|
-
* Enable this API with the `--experimental-webstorage` CLI flag.
|
243
|
-
* `localStorage` data is not stored per user or per request when used in the context
|
244
|
-
* of a server, it is shared across all users and requests.
|
245
|
-
* @since v22.4.0
|
246
|
-
*/
|
247
|
-
var localStorage: Storage;
|
248
|
-
|
249
|
-
/**
|
250
|
-
* A browser-compatible implementation of [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage). Data is stored in
|
251
|
-
* memory, with a storage quota of 10 MB. `sessionStorage` data persists only within
|
252
|
-
* the currently running process, and is not shared between workers.
|
253
|
-
* @since v22.4.0
|
254
|
-
*/
|
255
|
-
var sessionStorage: Storage;
|
256
|
-
// #endregion Storage
|
257
|
-
|
258
|
-
/**
|
259
|
-
* @since v17.0.0
|
260
|
-
*
|
261
|
-
* Creates a deep clone of an object.
|
262
|
-
*/
|
263
|
-
function structuredClone<T>(
|
264
|
-
value: T,
|
265
|
-
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
|
266
|
-
): T;
|
267
|
-
|
268
|
-
// #region DOMException
|
269
|
-
/**
|
270
|
-
* @since v17.0.0
|
271
|
-
* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
|
272
|
-
*
|
273
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
274
|
-
*/
|
275
|
-
interface DOMException extends _DOMException {}
|
276
|
-
|
277
164
|
/**
|
278
|
-
*
|
279
|
-
*
|
280
|
-
* The WHATWG `DOMException` class. See [DOMException](https://developer.mozilla.org/docs/Web/API/DOMException) for more details.
|
165
|
+
* Enable this API with the `--expose-gc` CLI flag.
|
281
166
|
*/
|
282
|
-
var
|
283
|
-
: NodeDOMExceptionConstructor;
|
284
|
-
// #endregion DOMException
|
167
|
+
var gc: NodeJS.GCFunction | undefined;
|
285
168
|
|
286
|
-
/*----------------------------------------------*
|
287
|
-
* *
|
288
|
-
* GLOBAL INTERFACES *
|
289
|
-
* *
|
290
|
-
*-----------------------------------------------*/
|
291
169
|
namespace NodeJS {
|
292
170
|
interface CallSite {
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
/**
|
299
|
-
* Type of "this" as a string.
|
300
|
-
* This is the name of the function stored in the constructor field of
|
301
|
-
* "this", if available. Otherwise the object's [[Class]] internal
|
302
|
-
* property.
|
303
|
-
*/
|
304
|
-
getTypeName(): string | null;
|
305
|
-
|
306
|
-
/**
|
307
|
-
* Current function
|
308
|
-
*/
|
171
|
+
getColumnNumber(): number | null;
|
172
|
+
getEnclosingColumnNumber(): number | null;
|
173
|
+
getEnclosingLineNumber(): number | null;
|
174
|
+
getEvalOrigin(): string | undefined;
|
175
|
+
getFileName(): string | null;
|
309
176
|
getFunction(): Function | undefined;
|
310
|
-
|
311
|
-
/**
|
312
|
-
* Name of the current function, typically its name property.
|
313
|
-
* If a name property is not available an attempt will be made to try
|
314
|
-
* to infer a name from the function's context.
|
315
|
-
*/
|
316
177
|
getFunctionName(): string | null;
|
317
|
-
|
318
|
-
/**
|
319
|
-
* Name of the property [of "this" or one of its prototypes] that holds
|
320
|
-
* the current function
|
321
|
-
*/
|
322
|
-
getMethodName(): string | null;
|
323
|
-
|
324
|
-
/**
|
325
|
-
* Name of the script [if this function was defined in a script]
|
326
|
-
*/
|
327
|
-
getFileName(): string | undefined;
|
328
|
-
|
329
|
-
/**
|
330
|
-
* Current line number [if this function was defined in a script]
|
331
|
-
*/
|
332
178
|
getLineNumber(): number | null;
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
*/
|
343
|
-
getEvalOrigin(): string | undefined;
|
344
|
-
|
345
|
-
/**
|
346
|
-
* Is this a toplevel invocation, that is, is "this" the global object?
|
347
|
-
*/
|
348
|
-
isToplevel(): boolean;
|
349
|
-
|
350
|
-
/**
|
351
|
-
* Does this call take place in code defined by a call to eval?
|
352
|
-
*/
|
179
|
+
getMethodName(): string | null;
|
180
|
+
getPosition(): number;
|
181
|
+
getPromiseIndex(): number | null;
|
182
|
+
getScriptHash(): string;
|
183
|
+
getScriptNameOrSourceURL(): string | null;
|
184
|
+
getThis(): unknown;
|
185
|
+
getTypeName(): string | null;
|
186
|
+
isAsync(): boolean;
|
187
|
+
isConstructor(): boolean;
|
353
188
|
isEval(): boolean;
|
354
|
-
|
355
|
-
/**
|
356
|
-
* Is this call in native V8 code?
|
357
|
-
*/
|
358
189
|
isNative(): boolean;
|
359
|
-
|
360
|
-
/**
|
361
|
-
* Is this a constructor call?
|
362
|
-
*/
|
363
|
-
isConstructor(): boolean;
|
364
|
-
|
365
|
-
/**
|
366
|
-
* is this an async call (i.e. await, Promise.all(), or Promise.any())?
|
367
|
-
*/
|
368
|
-
isAsync(): boolean;
|
369
|
-
|
370
|
-
/**
|
371
|
-
* is this an async call to Promise.all()?
|
372
|
-
*/
|
373
190
|
isPromiseAll(): boolean;
|
374
|
-
|
375
|
-
/**
|
376
|
-
* returns the index of the promise element that was followed in
|
377
|
-
* Promise.all() or Promise.any() for async stack traces, or null
|
378
|
-
* if the CallSite is not an async
|
379
|
-
*/
|
380
|
-
getPromiseIndex(): number | null;
|
381
|
-
|
382
|
-
getScriptNameOrSourceURL(): string;
|
383
|
-
getScriptHash(): string;
|
384
|
-
|
385
|
-
getEnclosingColumnNumber(): number;
|
386
|
-
getEnclosingLineNumber(): number;
|
387
|
-
getPosition(): number;
|
388
|
-
|
389
|
-
toString(): string;
|
191
|
+
isToplevel(): boolean;
|
390
192
|
}
|
391
193
|
|
392
194
|
interface ErrnoException extends Error {
|
@@ -434,6 +236,19 @@ declare global {
|
|
434
236
|
readonly [key: string]: T | undefined;
|
435
237
|
}
|
436
238
|
|
239
|
+
interface GCFunction {
|
240
|
+
(minor?: boolean): void;
|
241
|
+
(options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;
|
242
|
+
(options: NodeJS.GCOptions): void;
|
243
|
+
}
|
244
|
+
|
245
|
+
interface GCOptions {
|
246
|
+
execution?: "sync" | "async" | undefined;
|
247
|
+
flavor?: "regular" | "last-resort" | undefined;
|
248
|
+
type?: "major-snapshot" | "major" | "minor" | undefined;
|
249
|
+
filename?: string | undefined;
|
250
|
+
}
|
251
|
+
|
437
252
|
/** An iterable iterator returned by the Node.js API. */
|
438
253
|
// Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used IterableIterator.
|
439
254
|
// TODO: In next major @types/node version, change default TReturn to undefined.
|
@@ -449,6 +264,58 @@ declare global {
|
|
449
264
|
}
|
450
265
|
}
|
451
266
|
|
267
|
+
// Global DOM types
|
268
|
+
|
269
|
+
function structuredClone<T>(
|
270
|
+
value: T,
|
271
|
+
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
|
272
|
+
): T;
|
273
|
+
|
274
|
+
interface DOMException extends _DOMException {}
|
275
|
+
var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
|
276
|
+
: NodeDOMExceptionConstructor;
|
277
|
+
|
278
|
+
// #region AbortController
|
279
|
+
interface AbortController {
|
280
|
+
readonly signal: AbortSignal;
|
281
|
+
abort(reason?: any): void;
|
282
|
+
}
|
283
|
+
var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
|
284
|
+
: {
|
285
|
+
prototype: AbortController;
|
286
|
+
new(): AbortController;
|
287
|
+
};
|
288
|
+
|
289
|
+
interface AbortSignal extends EventTarget {
|
290
|
+
readonly aborted: boolean;
|
291
|
+
onabort: ((this: AbortSignal, ev: Event) => any) | null;
|
292
|
+
readonly reason: any;
|
293
|
+
throwIfAborted(): void;
|
294
|
+
}
|
295
|
+
var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
|
296
|
+
: {
|
297
|
+
prototype: AbortSignal;
|
298
|
+
new(): AbortSignal;
|
299
|
+
abort(reason?: any): AbortSignal;
|
300
|
+
any(signals: AbortSignal[]): AbortSignal;
|
301
|
+
timeout(milliseconds: number): AbortSignal;
|
302
|
+
};
|
303
|
+
// #endregion AbortController
|
304
|
+
|
305
|
+
// #region Storage
|
306
|
+
interface Storage extends _Storage {}
|
307
|
+
// Conditional on `onabort` rather than `onmessage`, in order to exclude lib.webworker
|
308
|
+
var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T
|
309
|
+
: {
|
310
|
+
prototype: Storage;
|
311
|
+
new(): Storage;
|
312
|
+
};
|
313
|
+
|
314
|
+
var localStorage: Storage;
|
315
|
+
var sessionStorage: Storage;
|
316
|
+
// #endregion Storage
|
317
|
+
|
318
|
+
// #region fetch
|
452
319
|
interface RequestInit extends _RequestInit {}
|
453
320
|
|
454
321
|
function fetch(
|
@@ -487,9 +354,6 @@ declare global {
|
|
487
354
|
: typeof import("undici-types").Headers;
|
488
355
|
|
489
356
|
interface MessageEvent extends _MessageEvent {}
|
490
|
-
/**
|
491
|
-
* @since v15.0.0
|
492
|
-
*/
|
493
357
|
var MessageEvent: typeof globalThis extends {
|
494
358
|
onmessage: any;
|
495
359
|
MessageEvent: infer T;
|
@@ -501,11 +365,7 @@ declare global {
|
|
501
365
|
: typeof import("undici-types").WebSocket;
|
502
366
|
|
503
367
|
interface EventSource extends _EventSource {}
|
504
|
-
/**
|
505
|
-
* Only available through the [--experimental-eventsource](https://nodejs.org/api/cli.html#--experimental-eventsource) flag.
|
506
|
-
*
|
507
|
-
* @since v22.3.0
|
508
|
-
*/
|
509
368
|
var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T
|
510
369
|
: typeof import("undici-types").EventSource;
|
370
|
+
// #endregion fetch
|
511
371
|
}
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.15.
|
3
|
+
"version": "22.15.9",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -220,6 +220,6 @@
|
|
220
220
|
"undici-types": "~6.21.0"
|
221
221
|
},
|
222
222
|
"peerDependencies": {},
|
223
|
-
"typesPublisherContentHash": "
|
223
|
+
"typesPublisherContentHash": "6720be548d81d07c3915ff0ebadbd30c285033cb6e37cad29fb87a1a782ae142",
|
224
224
|
"typeScriptVersion": "5.1"
|
225
225
|
}
|
node/ts5.6/buffer.buffer.d.ts
CHANGED
@@ -448,6 +448,8 @@ declare module "buffer" {
|
|
448
448
|
*/
|
449
449
|
subarray(start?: number, end?: number): Buffer;
|
450
450
|
}
|
451
|
+
type NonSharedBuffer = Buffer;
|
452
|
+
type AllowSharedBuffer = Buffer;
|
451
453
|
}
|
452
454
|
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
453
455
|
var SlowBuffer: {
|