@types/node 22.7.5 → 22.7.7
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/compatibility/disposable.d.ts +16 -0
- node/compatibility/index.d.ts +9 -0
- node/compatibility/indexable.d.ts +23 -0
- node/compatibility/iterators.d.ts +21 -0
- node/events.d.ts +2 -2
- node/fs/promises.d.ts +4 -4
- node/fs.d.ts +1 -1
- node/globals.d.ts +17 -48
- node/http.d.ts +36 -0
- node/index.d.ts +8 -10
- node/package.json +2 -2
- node/readline.d.ts +1 -1
- node/stream/web.d.ts +5 -2
- node/stream.d.ts +2 -2
- node/ts5.6/index.d.ts +8 -10
- node/url.d.ts +7 -4
- node/util.d.ts +4 -4
- node/globals.global.d.ts +0 -1
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:
|
11
|
+
* Last updated: Sat, 19 Oct 2024 03:38:51 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// Polyfills for the explicit resource management types added in TypeScript 5.2.
|
2
|
+
// TODO: remove once this package no longer supports TS 5.1, and replace with a
|
3
|
+
// <reference> to TypeScript's disposable library in index.d.ts.
|
4
|
+
|
5
|
+
interface SymbolConstructor {
|
6
|
+
readonly dispose: unique symbol;
|
7
|
+
readonly asyncDispose: unique symbol;
|
8
|
+
}
|
9
|
+
|
10
|
+
interface Disposable {
|
11
|
+
[Symbol.dispose](): void;
|
12
|
+
}
|
13
|
+
|
14
|
+
interface AsyncDisposable {
|
15
|
+
[Symbol.asyncDispose](): PromiseLike<void>;
|
16
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// Declaration files in this directory contain types relating to TypeScript library features
|
2
|
+
// that are not included in all TypeScript versions supported by DefinitelyTyped, but
|
3
|
+
// which can be made backwards-compatible without needing `typesVersions`.
|
4
|
+
// If adding declarations to this directory, please specify which versions of TypeScript require them,
|
5
|
+
// so that they can be removed when no longer needed.
|
6
|
+
|
7
|
+
/// <reference path="disposable.d.ts" />
|
8
|
+
/// <reference path="indexable.d.ts" />
|
9
|
+
/// <reference path="iterators.d.ts" />
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// Polyfill for ES2022's .at() method on string/array prototypes, added to TypeScript in 4.6.
|
2
|
+
// TODO: these methods are not used within @types/node, and should be removed at the next
|
3
|
+
// major @types/node version; users should include the es2022 TypeScript libraries
|
4
|
+
// if they need these features.
|
5
|
+
|
6
|
+
interface RelativeIndexable<T> {
|
7
|
+
at(index: number): T | undefined;
|
8
|
+
}
|
9
|
+
|
10
|
+
interface String extends RelativeIndexable<string> {}
|
11
|
+
interface Array<T> extends RelativeIndexable<T> {}
|
12
|
+
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
13
|
+
interface Int8Array extends RelativeIndexable<number> {}
|
14
|
+
interface Uint8Array extends RelativeIndexable<number> {}
|
15
|
+
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
16
|
+
interface Int16Array extends RelativeIndexable<number> {}
|
17
|
+
interface Uint16Array extends RelativeIndexable<number> {}
|
18
|
+
interface Int32Array extends RelativeIndexable<number> {}
|
19
|
+
interface Uint32Array extends RelativeIndexable<number> {}
|
20
|
+
interface Float32Array extends RelativeIndexable<number> {}
|
21
|
+
interface Float64Array extends RelativeIndexable<number> {}
|
22
|
+
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
23
|
+
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
// Backwards-compatible iterator interfaces, augmented with iterator helper methods by lib.esnext.iterator in TypeScript 5.6.
|
2
|
+
// The IterableIterator interface does not contain these methods, which creates assignability issues in places where IteratorObjects
|
3
|
+
// are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded.
|
4
|
+
// Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods
|
5
|
+
// if lib.esnext.iterator is loaded.
|
6
|
+
// TODO: remove once this package no longer supports TS 5.5, and replace NodeJS.BuiltinIteratorReturn with BuiltinIteratorReturn.
|
7
|
+
|
8
|
+
// Placeholders for TS <5.6
|
9
|
+
interface IteratorObject<T, TReturn, TNext> {}
|
10
|
+
interface AsyncIteratorObject<T, TReturn, TNext> {}
|
11
|
+
|
12
|
+
declare namespace NodeJS {
|
13
|
+
// Populate iterator methods for TS <5.6
|
14
|
+
interface Iterator<T, TReturn, TNext> extends globalThis.Iterator<T, TReturn, TNext> {}
|
15
|
+
interface AsyncIterator<T, TReturn, TNext> extends globalThis.AsyncIterator<T, TReturn, TNext> {}
|
16
|
+
|
17
|
+
// Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators
|
18
|
+
type BuiltinIteratorReturn = ReturnType<any[][typeof Symbol.iterator]> extends
|
19
|
+
globalThis.Iterator<any, infer TReturn> ? TReturn
|
20
|
+
: any;
|
21
|
+
}
|
node/events.d.ts
CHANGED
@@ -304,12 +304,12 @@ declare module "events" {
|
|
304
304
|
emitter: NodeJS.EventEmitter,
|
305
305
|
eventName: string | symbol,
|
306
306
|
options?: StaticEventEmitterIteratorOptions,
|
307
|
-
):
|
307
|
+
): NodeJS.AsyncIterator<any[]>;
|
308
308
|
static on(
|
309
309
|
emitter: EventTarget,
|
310
310
|
eventName: string,
|
311
311
|
options?: StaticEventEmitterIteratorOptions,
|
312
|
-
):
|
312
|
+
): NodeJS.AsyncIterator<any[]>;
|
313
313
|
/**
|
314
314
|
* A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`.
|
315
315
|
*
|
node/fs/promises.d.ts
CHANGED
@@ -1245,19 +1245,19 @@ declare module "fs/promises" {
|
|
1245
1245
|
/**
|
1246
1246
|
* Retrieves the files matching the specified pattern.
|
1247
1247
|
*/
|
1248
|
-
function glob(pattern: string | string[]):
|
1248
|
+
function glob(pattern: string | string[]): NodeJS.AsyncIterator<string>;
|
1249
1249
|
function glob(
|
1250
1250
|
pattern: string | string[],
|
1251
1251
|
opt: GlobOptionsWithFileTypes,
|
1252
|
-
):
|
1252
|
+
): NodeJS.AsyncIterator<Dirent>;
|
1253
1253
|
function glob(
|
1254
1254
|
pattern: string | string[],
|
1255
1255
|
opt: GlobOptionsWithoutFileTypes,
|
1256
|
-
):
|
1256
|
+
): NodeJS.AsyncIterator<string>;
|
1257
1257
|
function glob(
|
1258
1258
|
pattern: string | string[],
|
1259
1259
|
opt: GlobOptions,
|
1260
|
-
):
|
1260
|
+
): NodeJS.AsyncIterator<Dirent | string>;
|
1261
1261
|
}
|
1262
1262
|
declare module "node:fs/promises" {
|
1263
1263
|
export * from "fs/promises";
|
node/fs.d.ts
CHANGED
@@ -284,7 +284,7 @@ declare module "fs" {
|
|
284
284
|
/**
|
285
285
|
* Asynchronously iterates over the directory via `readdir(3)` until all entries have been read.
|
286
286
|
*/
|
287
|
-
[Symbol.asyncIterator]():
|
287
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<Dirent>;
|
288
288
|
/**
|
289
289
|
* Asynchronously close the directory's underlying resource handle.
|
290
290
|
* Subsequent reads will result in errors.
|
node/globals.d.ts
CHANGED
@@ -156,6 +156,8 @@ declare global {
|
|
156
156
|
interface RequireResolve extends NodeJS.RequireResolve {}
|
157
157
|
interface NodeModule extends NodeJS.Module {}
|
158
158
|
|
159
|
+
var global: typeof globalThis;
|
160
|
+
|
159
161
|
var process: NodeJS.Process;
|
160
162
|
var console: Console;
|
161
163
|
|
@@ -265,53 +267,6 @@ declare global {
|
|
265
267
|
var sessionStorage: Storage;
|
266
268
|
// #endregion Storage
|
267
269
|
|
268
|
-
// #region Disposable
|
269
|
-
interface SymbolConstructor {
|
270
|
-
/**
|
271
|
-
* A method that is used to release resources held by an object. Called by the semantics of the `using` statement.
|
272
|
-
*/
|
273
|
-
readonly dispose: unique symbol;
|
274
|
-
|
275
|
-
/**
|
276
|
-
* A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement.
|
277
|
-
*/
|
278
|
-
readonly asyncDispose: unique symbol;
|
279
|
-
}
|
280
|
-
|
281
|
-
interface Disposable {
|
282
|
-
[Symbol.dispose](): void;
|
283
|
-
}
|
284
|
-
|
285
|
-
interface AsyncDisposable {
|
286
|
-
[Symbol.asyncDispose](): PromiseLike<void>;
|
287
|
-
}
|
288
|
-
// #endregion Disposable
|
289
|
-
|
290
|
-
// #region ArrayLike.at()
|
291
|
-
interface RelativeIndexable<T> {
|
292
|
-
/**
|
293
|
-
* Takes an integer value and returns the item at that index,
|
294
|
-
* allowing for positive and negative integers.
|
295
|
-
* Negative integers count back from the last item in the array.
|
296
|
-
*/
|
297
|
-
at(index: number): T | undefined;
|
298
|
-
}
|
299
|
-
interface String extends RelativeIndexable<string> {}
|
300
|
-
interface Array<T> extends RelativeIndexable<T> {}
|
301
|
-
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
302
|
-
interface Int8Array extends RelativeIndexable<number> {}
|
303
|
-
interface Uint8Array extends RelativeIndexable<number> {}
|
304
|
-
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
305
|
-
interface Int16Array extends RelativeIndexable<number> {}
|
306
|
-
interface Uint16Array extends RelativeIndexable<number> {}
|
307
|
-
interface Int32Array extends RelativeIndexable<number> {}
|
308
|
-
interface Uint32Array extends RelativeIndexable<number> {}
|
309
|
-
interface Float32Array extends RelativeIndexable<number> {}
|
310
|
-
interface Float64Array extends RelativeIndexable<number> {}
|
311
|
-
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
312
|
-
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
313
|
-
// #endregion ArrayLike.at() end
|
314
|
-
|
315
270
|
/**
|
316
271
|
* @since v17.0.0
|
317
272
|
*
|
@@ -464,7 +419,7 @@ declare global {
|
|
464
419
|
unpipe(destination?: WritableStream): this;
|
465
420
|
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
466
421
|
wrap(oldStream: ReadableStream): this;
|
467
|
-
[Symbol.asyncIterator]():
|
422
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<string | Buffer>;
|
468
423
|
}
|
469
424
|
|
470
425
|
interface WritableStream extends EventEmitter {
|
@@ -533,6 +488,20 @@ declare global {
|
|
533
488
|
interface ReadOnlyDict<T> {
|
534
489
|
readonly [key: string]: T | undefined;
|
535
490
|
}
|
491
|
+
|
492
|
+
/** An iterable iterator returned by the Node.js API. */
|
493
|
+
// Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used IterableIterator.
|
494
|
+
// TODO: In next major @types/node version, change default TReturn to undefined.
|
495
|
+
interface Iterator<T, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
496
|
+
[Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
|
497
|
+
}
|
498
|
+
|
499
|
+
/** An async iterable iterator returned by the Node.js API. */
|
500
|
+
// Default TReturn/TNext in v22 is `any`, for compatibility with the previously-used AsyncIterableIterator.
|
501
|
+
// TODO: In next major @types/node version, change default TReturn to undefined.
|
502
|
+
interface AsyncIterator<T, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
503
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
|
504
|
+
}
|
536
505
|
}
|
537
506
|
|
538
507
|
interface RequestInit extends _RequestInit {}
|
node/http.d.ts
CHANGED
@@ -588,6 +588,42 @@ declare module "http" {
|
|
588
588
|
* @param value Header value
|
589
589
|
*/
|
590
590
|
setHeader(name: string, value: number | string | readonly string[]): this;
|
591
|
+
/**
|
592
|
+
* Sets multiple header values for implicit headers. headers must be an instance of
|
593
|
+
* `Headers` or `Map`, if a header already exists in the to-be-sent headers, its
|
594
|
+
* value will be replaced.
|
595
|
+
*
|
596
|
+
* ```js
|
597
|
+
* const headers = new Headers({ foo: 'bar' });
|
598
|
+
* outgoingMessage.setHeaders(headers);
|
599
|
+
* ```
|
600
|
+
*
|
601
|
+
* or
|
602
|
+
*
|
603
|
+
* ```js
|
604
|
+
* const headers = new Map([['foo', 'bar']]);
|
605
|
+
* outgoingMessage.setHeaders(headers);
|
606
|
+
* ```
|
607
|
+
*
|
608
|
+
* When headers have been set with `outgoingMessage.setHeaders()`, they will be
|
609
|
+
* merged with any headers passed to `response.writeHead()`, with the headers passed
|
610
|
+
* to `response.writeHead()` given precedence.
|
611
|
+
*
|
612
|
+
* ```js
|
613
|
+
* // Returns content-type = text/plain
|
614
|
+
* const server = http.createServer((req, res) => {
|
615
|
+
* const headers = new Headers({ 'Content-Type': 'text/html' });
|
616
|
+
* res.setHeaders(headers);
|
617
|
+
* res.writeHead(200, { 'Content-Type': 'text/plain' });
|
618
|
+
* res.end('ok');
|
619
|
+
* });
|
620
|
+
* ```
|
621
|
+
*
|
622
|
+
* @since v19.6.0, v18.15.0
|
623
|
+
* @param name Header name
|
624
|
+
* @param value Header value
|
625
|
+
*/
|
626
|
+
setHeaders(headers: Headers | Map<string, number | string | readonly string[]>): this;
|
591
627
|
/**
|
592
628
|
* Append a single header value to the header object.
|
593
629
|
*
|
node/index.d.ts
CHANGED
@@ -22,22 +22,22 @@
|
|
22
22
|
* IN THE SOFTWARE.
|
23
23
|
*/
|
24
24
|
|
25
|
-
// NOTE: These definitions support
|
25
|
+
// NOTE: These definitions support Node.js and TypeScript 5.7+.
|
26
26
|
|
27
|
-
// Reference required
|
27
|
+
// Reference required TypeScript libs:
|
28
28
|
/// <reference lib="es2020" />
|
29
|
-
/// <reference lib="esnext.asynciterable" />
|
30
|
-
/// <reference lib="esnext.intl" />
|
31
|
-
/// <reference lib="esnext.bigint" />
|
32
29
|
|
33
|
-
//
|
30
|
+
// TypeScript backwards-compatibility definitions:
|
31
|
+
/// <reference path="compatibility/index.d.ts" />
|
32
|
+
|
33
|
+
// Definitions specific to TypeScript 5.7+:
|
34
34
|
/// <reference path="globals.typedarray.d.ts" />
|
35
35
|
/// <reference path="buffer.buffer.d.ts" />
|
36
36
|
|
37
|
-
//
|
37
|
+
// Definitions for Node.js modules that are not specific to any version of TypeScript:
|
38
|
+
/// <reference path="globals.d.ts" />
|
38
39
|
/// <reference path="assert.d.ts" />
|
39
40
|
/// <reference path="assert/strict.d.ts" />
|
40
|
-
/// <reference path="globals.d.ts" />
|
41
41
|
/// <reference path="async_hooks.d.ts" />
|
42
42
|
/// <reference path="buffer.d.ts" />
|
43
43
|
/// <reference path="child_process.d.ts" />
|
@@ -90,5 +90,3 @@
|
|
90
90
|
/// <reference path="wasi.d.ts" />
|
91
91
|
/// <reference path="worker_threads.d.ts" />
|
92
92
|
/// <reference path="zlib.d.ts" />
|
93
|
-
|
94
|
-
/// <reference path="globals.global.d.ts" />
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.7.
|
3
|
+
"version": "22.7.7",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -219,6 +219,6 @@
|
|
219
219
|
"dependencies": {
|
220
220
|
"undici-types": "~6.19.2"
|
221
221
|
},
|
222
|
-
"typesPublisherContentHash": "
|
222
|
+
"typesPublisherContentHash": "fa31e6c2802baba25cea51cc9964246c953fcbf22ed95a34bb888cea10a202c4",
|
223
223
|
"typeScriptVersion": "4.8"
|
224
224
|
}
|
node/readline.d.ts
CHANGED
@@ -304,7 +304,7 @@ declare module "readline" {
|
|
304
304
|
prependOnceListener(event: "SIGINT", listener: () => void): this;
|
305
305
|
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
|
306
306
|
prependOnceListener(event: "history", listener: (history: string[]) => void): this;
|
307
|
-
[Symbol.asyncIterator]():
|
307
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<string>;
|
308
308
|
}
|
309
309
|
export type ReadLine = Interface; // type forwarded for backwards compatibility
|
310
310
|
export type Completer = (line: string) => CompleterResult;
|
node/stream/web.d.ts
CHANGED
@@ -166,6 +166,9 @@ declare module "stream/web" {
|
|
166
166
|
interface ReadableStreamErrorCallback {
|
167
167
|
(reason: any): void | PromiseLike<void>;
|
168
168
|
}
|
169
|
+
interface ReadableStreamAsyncIterator<T> extends NodeJS.AsyncIterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
|
170
|
+
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
|
171
|
+
}
|
169
172
|
/** This Streams API interface represents a readable stream of byte data. */
|
170
173
|
interface ReadableStream<R = any> {
|
171
174
|
readonly locked: boolean;
|
@@ -176,8 +179,8 @@ declare module "stream/web" {
|
|
176
179
|
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
177
180
|
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
178
181
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
179
|
-
values(options?: { preventCancel?: boolean }):
|
180
|
-
[Symbol.asyncIterator]():
|
182
|
+
values(options?: { preventCancel?: boolean }): ReadableStreamAsyncIterator<R>;
|
183
|
+
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<R>;
|
181
184
|
}
|
182
185
|
const ReadableStream: {
|
183
186
|
prototype: ReadableStream;
|
node/stream.d.ts
CHANGED
@@ -422,7 +422,7 @@ declare module "stream" {
|
|
422
422
|
* or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream.
|
423
423
|
* **Default: `true`**.
|
424
424
|
*/
|
425
|
-
iterator(options?: { destroyOnReturn?: boolean }):
|
425
|
+
iterator(options?: { destroyOnReturn?: boolean }): NodeJS.AsyncIterator<any>;
|
426
426
|
/**
|
427
427
|
* This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream.
|
428
428
|
* If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream.
|
@@ -651,7 +651,7 @@ declare module "stream" {
|
|
651
651
|
removeListener(event: "readable", listener: () => void): this;
|
652
652
|
removeListener(event: "resume", listener: () => void): this;
|
653
653
|
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
654
|
-
[Symbol.asyncIterator]():
|
654
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
|
655
655
|
/**
|
656
656
|
* Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished.
|
657
657
|
* @since v20.4.0
|
node/ts5.6/index.d.ts
CHANGED
@@ -22,22 +22,22 @@
|
|
22
22
|
* IN THE SOFTWARE.
|
23
23
|
*/
|
24
24
|
|
25
|
-
// NOTE: These definitions support
|
25
|
+
// NOTE: These definitions support Node.js and TypeScript 4.9 through 5.6.
|
26
26
|
|
27
|
-
// Reference required
|
27
|
+
// Reference required TypeScript libs:
|
28
28
|
/// <reference lib="es2020" />
|
29
|
-
/// <reference lib="esnext.asynciterable" />
|
30
|
-
/// <reference lib="esnext.intl" />
|
31
|
-
/// <reference lib="esnext.bigint" />
|
32
29
|
|
33
|
-
//
|
30
|
+
// TypeScript backwards-compatibility definitions:
|
31
|
+
/// <reference path="../compatibility/index.d.ts" />
|
32
|
+
|
33
|
+
// Definitions specific to TypeScript 4.9 through 5.6:
|
34
34
|
/// <reference path="./globals.typedarray.d.ts" />
|
35
35
|
/// <reference path="./buffer.buffer.d.ts" />
|
36
36
|
|
37
|
-
//
|
37
|
+
// Definitions for Node.js modules that are not specific to any version of TypeScript:
|
38
|
+
/// <reference path="../globals.d.ts" />
|
38
39
|
/// <reference path="../assert.d.ts" />
|
39
40
|
/// <reference path="../assert/strict.d.ts" />
|
40
|
-
/// <reference path="../globals.d.ts" />
|
41
41
|
/// <reference path="../async_hooks.d.ts" />
|
42
42
|
/// <reference path="../buffer.d.ts" />
|
43
43
|
/// <reference path="../child_process.d.ts" />
|
@@ -90,5 +90,3 @@
|
|
90
90
|
/// <reference path="../wasi.d.ts" />
|
91
91
|
/// <reference path="../worker_threads.d.ts" />
|
92
92
|
/// <reference path="../zlib.d.ts" />
|
93
|
-
|
94
|
-
/// <reference path="../globals.global.d.ts" />
|
node/url.d.ts
CHANGED
@@ -757,6 +757,9 @@ declare module "url" {
|
|
757
757
|
*/
|
758
758
|
toJSON(): string;
|
759
759
|
}
|
760
|
+
interface URLSearchParamsIterator<T> extends NodeJS.Iterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
|
761
|
+
[Symbol.iterator](): URLSearchParamsIterator<T>;
|
762
|
+
}
|
760
763
|
/**
|
761
764
|
* The `URLSearchParams` API provides read and write access to the query of a `URL`. The `URLSearchParams` class can also be used standalone with one of the
|
762
765
|
* four following constructors.
|
@@ -827,7 +830,7 @@ declare module "url" {
|
|
827
830
|
*
|
828
831
|
* Alias for `urlSearchParams[@@iterator]()`.
|
829
832
|
*/
|
830
|
-
entries():
|
833
|
+
entries(): URLSearchParamsIterator<[string, string]>;
|
831
834
|
/**
|
832
835
|
* Iterates over each name-value pair in the query and invokes the given function.
|
833
836
|
*
|
@@ -881,7 +884,7 @@ declare module "url" {
|
|
881
884
|
* // foo
|
882
885
|
* ```
|
883
886
|
*/
|
884
|
-
keys():
|
887
|
+
keys(): URLSearchParamsIterator<string>;
|
885
888
|
/**
|
886
889
|
* Sets the value in the `URLSearchParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`,
|
887
890
|
* set the first such pair's value to `value` and remove all others. If not,
|
@@ -931,8 +934,8 @@ declare module "url" {
|
|
931
934
|
/**
|
932
935
|
* Returns an ES6 `Iterator` over the values of each name-value pair.
|
933
936
|
*/
|
934
|
-
values():
|
935
|
-
[Symbol.iterator]():
|
937
|
+
values(): URLSearchParamsIterator<string>;
|
938
|
+
[Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
|
936
939
|
}
|
937
940
|
import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
|
938
941
|
global {
|
node/util.d.ts
CHANGED
@@ -1720,7 +1720,7 @@ declare module "util" {
|
|
1720
1720
|
* Each item of the iterator is a JavaScript `Array`. The first item of the array
|
1721
1721
|
* is the `name`, the second item of the array is the `value`.
|
1722
1722
|
*/
|
1723
|
-
entries():
|
1723
|
+
entries(): NodeJS.Iterator<[name: string, value: string]>;
|
1724
1724
|
/**
|
1725
1725
|
* Returns the value of the first name-value pair whose name is `name`. If there
|
1726
1726
|
* are no such pairs, `null` is returned.
|
@@ -1746,7 +1746,7 @@ declare module "util" {
|
|
1746
1746
|
* // bar
|
1747
1747
|
* ```
|
1748
1748
|
*/
|
1749
|
-
keys():
|
1749
|
+
keys(): NodeJS.Iterator<string>;
|
1750
1750
|
/**
|
1751
1751
|
* Sets the value in the `MIMEParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`,
|
1752
1752
|
* set the first such pair's value to `value`.
|
@@ -1765,11 +1765,11 @@ declare module "util" {
|
|
1765
1765
|
/**
|
1766
1766
|
* Returns an iterator over the values of each name-value pair.
|
1767
1767
|
*/
|
1768
|
-
values():
|
1768
|
+
values(): NodeJS.Iterator<string>;
|
1769
1769
|
/**
|
1770
1770
|
* Returns an iterator over each of the name-value pairs in the parameters.
|
1771
1771
|
*/
|
1772
|
-
[Symbol.iterator]:
|
1772
|
+
[Symbol.iterator](): NodeJS.Iterator<[name: string, value: string]>;
|
1773
1773
|
}
|
1774
1774
|
}
|
1775
1775
|
declare module "util/types" {
|
node/globals.global.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
declare var global: typeof globalThis;
|