@types/node 16.18.113 → 16.18.115
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 v16.18/README.md +1 -1
- node v16.18/assert.d.ts +2 -2
- node v16.18/compatibility/index.d.ts +8 -0
- node v16.18/compatibility/indexable.d.ts +20 -0
- node v16.18/compatibility/iterators.d.ts +20 -0
- node v16.18/events.d.ts +1 -1
- node v16.18/fs.d.ts +1 -1
- node v16.18/globals.d.ts +15 -26
- node v16.18/index.d.ts +8 -10
- node v16.18/package.json +3 -2
- node v16.18/readline.d.ts +1 -1
- node v16.18/stream/web.d.ts +6 -2
- node v16.18/stream.d.ts +2 -2
- node v16.18/ts5.6/index.d.ts +8 -10
- node v16.18/url.d.ts +7 -4
- node v16.18/globals.global.d.ts +0 -1
node v16.18/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/v16.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Wed, 23 Oct 2024 03:36:41 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
node v16.18/assert.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare module "assert" {
|
|
|
31
31
|
/** The `operator` property on the error instance. */
|
|
32
32
|
operator?: string | undefined;
|
|
33
33
|
/** If provided, the generated stack trace omits frames before this function. */
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
35
35
|
stackStartFn?: Function | undefined;
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -217,7 +217,7 @@ declare module "assert" {
|
|
|
217
217
|
expected: unknown,
|
|
218
218
|
message?: string | Error,
|
|
219
219
|
operator?: string,
|
|
220
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
220
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
221
221
|
stackStartFn?: Function,
|
|
222
222
|
): never;
|
|
223
223
|
/**
|
|
@@ -0,0 +1,8 @@
|
|
|
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="indexable.d.ts" />
|
|
8
|
+
/// <reference path="iterators.d.ts" />
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Polyfill for ES2022's .at() method on string/array prototypes, added to TypeScript in 4.6.
|
|
2
|
+
|
|
3
|
+
interface RelativeIndexable<T> {
|
|
4
|
+
at(index: number): T | undefined;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface String extends RelativeIndexable<string> {}
|
|
8
|
+
interface Array<T> extends RelativeIndexable<T> {}
|
|
9
|
+
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
|
10
|
+
interface Int8Array extends RelativeIndexable<number> {}
|
|
11
|
+
interface Uint8Array extends RelativeIndexable<number> {}
|
|
12
|
+
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
|
13
|
+
interface Int16Array extends RelativeIndexable<number> {}
|
|
14
|
+
interface Uint16Array extends RelativeIndexable<number> {}
|
|
15
|
+
interface Int32Array extends RelativeIndexable<number> {}
|
|
16
|
+
interface Uint32Array extends RelativeIndexable<number> {}
|
|
17
|
+
interface Float32Array extends RelativeIndexable<number> {}
|
|
18
|
+
interface Float64Array extends RelativeIndexable<number> {}
|
|
19
|
+
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
|
20
|
+
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
|
|
7
|
+
// Placeholders for TS <5.6
|
|
8
|
+
interface IteratorObject<T, TReturn, TNext> {}
|
|
9
|
+
interface AsyncIteratorObject<T, TReturn, TNext> {}
|
|
10
|
+
|
|
11
|
+
declare namespace NodeJS {
|
|
12
|
+
// Populate iterator methods for TS <5.6
|
|
13
|
+
interface Iterator<T, TReturn, TNext> extends globalThis.Iterator<T, TReturn, TNext> {}
|
|
14
|
+
interface AsyncIterator<T, TReturn, TNext> extends globalThis.AsyncIterator<T, TReturn, TNext> {}
|
|
15
|
+
|
|
16
|
+
// Polyfill for TS 5.6's instrinsic BuiltinIteratorReturn type, required for DOM-compatible iterators
|
|
17
|
+
type BuiltinIteratorReturn = ReturnType<any[][typeof Symbol.iterator]> extends
|
|
18
|
+
globalThis.Iterator<any, infer TReturn> ? TReturn
|
|
19
|
+
: any;
|
|
20
|
+
}
|
node v16.18/events.d.ts
CHANGED
|
@@ -243,7 +243,7 @@ declare module "events" {
|
|
|
243
243
|
emitter: NodeJS.EventEmitter,
|
|
244
244
|
eventName: string,
|
|
245
245
|
options?: StaticEventEmitterOptions,
|
|
246
|
-
):
|
|
246
|
+
): NodeJS.AsyncIterator<any>;
|
|
247
247
|
/**
|
|
248
248
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
|
249
249
|
*
|
node v16.18/fs.d.ts
CHANGED
|
@@ -215,7 +215,7 @@ declare module "fs" {
|
|
|
215
215
|
/**
|
|
216
216
|
* Asynchronously iterates over the directory via `readdir(3)` until all entries have been read.
|
|
217
217
|
*/
|
|
218
|
-
[Symbol.asyncIterator]():
|
|
218
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<Dirent>;
|
|
219
219
|
/**
|
|
220
220
|
* Asynchronously close the directory's underlying resource handle.
|
|
221
221
|
* Subsequent reads will result in errors.
|
node v16.18/globals.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ interface NodeModule extends NodeJS.Module {}
|
|
|
27
27
|
declare var process: NodeJS.Process;
|
|
28
28
|
declare var console: Console;
|
|
29
29
|
|
|
30
|
+
declare var global: typeof globalThis;
|
|
31
|
+
|
|
30
32
|
declare var __filename: string;
|
|
31
33
|
declare var __dirname: string;
|
|
32
34
|
|
|
@@ -82,31 +84,6 @@ declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal
|
|
|
82
84
|
};
|
|
83
85
|
// #endregion borrowed
|
|
84
86
|
|
|
85
|
-
// #region ArrayLike.at()
|
|
86
|
-
interface RelativeIndexable<T> {
|
|
87
|
-
/**
|
|
88
|
-
* Takes an integer value and returns the item at that index,
|
|
89
|
-
* allowing for positive and negative integers.
|
|
90
|
-
* Negative integers count back from the last item in the array.
|
|
91
|
-
*/
|
|
92
|
-
at(index: number): T | undefined;
|
|
93
|
-
}
|
|
94
|
-
interface String extends RelativeIndexable<string> {}
|
|
95
|
-
interface Array<T> extends RelativeIndexable<T> {}
|
|
96
|
-
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
|
97
|
-
interface Int8Array extends RelativeIndexable<number> {}
|
|
98
|
-
interface Uint8Array extends RelativeIndexable<number> {}
|
|
99
|
-
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
|
100
|
-
interface Int16Array extends RelativeIndexable<number> {}
|
|
101
|
-
interface Uint16Array extends RelativeIndexable<number> {}
|
|
102
|
-
interface Int32Array extends RelativeIndexable<number> {}
|
|
103
|
-
interface Uint32Array extends RelativeIndexable<number> {}
|
|
104
|
-
interface Float32Array extends RelativeIndexable<number> {}
|
|
105
|
-
interface Float64Array extends RelativeIndexable<number> {}
|
|
106
|
-
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
|
107
|
-
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
|
108
|
-
// #endregion ArrayLike.at() end
|
|
109
|
-
|
|
110
87
|
/*----------------------------------------------*
|
|
111
88
|
* *
|
|
112
89
|
* GLOBAL INTERFACES *
|
|
@@ -205,7 +182,7 @@ declare namespace NodeJS {
|
|
|
205
182
|
unpipe(destination?: WritableStream): this;
|
|
206
183
|
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
|
207
184
|
wrap(oldStream: ReadableStream): this;
|
|
208
|
-
[Symbol.asyncIterator]():
|
|
185
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<string | Buffer>;
|
|
209
186
|
}
|
|
210
187
|
|
|
211
188
|
interface WritableStream extends EventEmitter {
|
|
@@ -274,4 +251,16 @@ declare namespace NodeJS {
|
|
|
274
251
|
interface ReadOnlyDict<T> {
|
|
275
252
|
readonly [key: string]: T | undefined;
|
|
276
253
|
}
|
|
254
|
+
|
|
255
|
+
/** An iterable iterator returned by the Node.js API. */
|
|
256
|
+
// Default TReturn/TNext in v16 is `any`, for compatibility with the previously-used IterableIterator.
|
|
257
|
+
interface Iterator<T, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
|
258
|
+
[Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** An async iterable iterator returned by the Node.js API. */
|
|
262
|
+
// Default TReturn/TNext in v16 is `any`, for compatibility with the previously-used AsyncIterableIterator.
|
|
263
|
+
interface AsyncIterator<T, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
|
264
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
|
|
265
|
+
}
|
|
277
266
|
}
|
node v16.18/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" />
|
|
@@ -86,5 +86,3 @@
|
|
|
86
86
|
/// <reference path="wasi.d.ts" />
|
|
87
87
|
/// <reference path="worker_threads.d.ts" />
|
|
88
88
|
/// <reference path="zlib.d.ts" />
|
|
89
|
-
|
|
90
|
-
/// <reference path="globals.global.d.ts" />
|
node v16.18/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "16.18.
|
|
3
|
+
"version": "16.18.115",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -217,6 +217,7 @@
|
|
|
217
217
|
},
|
|
218
218
|
"scripts": {},
|
|
219
219
|
"dependencies": {},
|
|
220
|
-
"
|
|
220
|
+
"peerDependencies": {},
|
|
221
|
+
"typesPublisherContentHash": "68d7b887518bda67b2db4017b820dadd949d4f6527006aeb4fe65fa7feea0e1f",
|
|
221
222
|
"typeScriptVersion": "4.8"
|
|
222
223
|
}
|
node v16.18/readline.d.ts
CHANGED
|
@@ -314,7 +314,7 @@ declare module "readline" {
|
|
|
314
314
|
prependOnceListener(event: "SIGINT", listener: () => void): this;
|
|
315
315
|
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
|
|
316
316
|
prependOnceListener(event: "history", listener: (history: string[]) => void): this;
|
|
317
|
-
[Symbol.asyncIterator]():
|
|
317
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<string>;
|
|
318
318
|
}
|
|
319
319
|
type ReadLine = Interface; // type forwarded for backwards compatibility
|
|
320
320
|
type Completer = (line: string) => CompleterResult;
|
node v16.18/stream/web.d.ts
CHANGED
|
@@ -154,6 +154,10 @@ declare module "stream/web" {
|
|
|
154
154
|
(reason: any): void | PromiseLike<void>;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
interface ReadableStreamAsyncIterator<T> extends NodeJS.AsyncIterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
|
|
158
|
+
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
|
|
159
|
+
}
|
|
160
|
+
|
|
157
161
|
/** This Streams API interface represents a readable stream of byte data. */
|
|
158
162
|
interface ReadableStream<R = any> {
|
|
159
163
|
readonly locked: boolean;
|
|
@@ -162,8 +166,8 @@ declare module "stream/web" {
|
|
|
162
166
|
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
|
163
167
|
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
|
164
168
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
165
|
-
values(options?: { preventCancel?: boolean }):
|
|
166
|
-
[Symbol.asyncIterator]():
|
|
169
|
+
values(options?: { preventCancel?: boolean }): ReadableStreamAsyncIterator<R>;
|
|
170
|
+
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<R>;
|
|
167
171
|
}
|
|
168
172
|
|
|
169
173
|
const ReadableStream: {
|
node v16.18/stream.d.ts
CHANGED
|
@@ -412,7 +412,7 @@ declare module "stream" {
|
|
|
412
412
|
* or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream.
|
|
413
413
|
* **Default: `true`**.
|
|
414
414
|
*/
|
|
415
|
-
iterator(options?: { destroyOnReturn?: boolean }):
|
|
415
|
+
iterator(options?: { destroyOnReturn?: boolean }): NodeJS.AsyncIterator<any>;
|
|
416
416
|
/**
|
|
417
417
|
* This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream.
|
|
418
418
|
* If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream.
|
|
@@ -513,7 +513,7 @@ declare module "stream" {
|
|
|
513
513
|
removeListener(event: "readable", listener: () => void): this;
|
|
514
514
|
removeListener(event: "resume", listener: () => void): this;
|
|
515
515
|
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
516
|
-
[Symbol.asyncIterator]():
|
|
516
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
|
|
517
517
|
}
|
|
518
518
|
interface WritableOptions extends StreamOptions<Writable> {
|
|
519
519
|
decodeStrings?: boolean | undefined;
|
node v16.18/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" />
|
|
@@ -86,5 +86,3 @@
|
|
|
86
86
|
/// <reference path="../wasi.d.ts" />
|
|
87
87
|
/// <reference path="../worker_threads.d.ts" />
|
|
88
88
|
/// <reference path="../zlib.d.ts" />
|
|
89
|
-
|
|
90
|
-
/// <reference path="../globals.global.d.ts" />
|
node v16.18/url.d.ts
CHANGED
|
@@ -687,6 +687,9 @@ declare module "url" {
|
|
|
687
687
|
*/
|
|
688
688
|
toJSON(): string;
|
|
689
689
|
}
|
|
690
|
+
interface URLSearchParamsIterator<T> extends NodeJS.Iterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
|
|
691
|
+
[Symbol.iterator](): URLSearchParamsIterator<T>;
|
|
692
|
+
}
|
|
690
693
|
/**
|
|
691
694
|
* 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
|
|
692
695
|
* four following constructors.
|
|
@@ -755,7 +758,7 @@ declare module "url" {
|
|
|
755
758
|
*
|
|
756
759
|
* Alias for `urlSearchParams[@@iterator]()`.
|
|
757
760
|
*/
|
|
758
|
-
entries():
|
|
761
|
+
entries(): URLSearchParamsIterator<[string, string]>;
|
|
759
762
|
/**
|
|
760
763
|
* Iterates over each name-value pair in the query and invokes the given function.
|
|
761
764
|
*
|
|
@@ -803,7 +806,7 @@ declare module "url" {
|
|
|
803
806
|
* // foo
|
|
804
807
|
* ```
|
|
805
808
|
*/
|
|
806
|
-
keys():
|
|
809
|
+
keys(): URLSearchParamsIterator<string>;
|
|
807
810
|
/**
|
|
808
811
|
* 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`,
|
|
809
812
|
* set the first such pair's value to `value` and remove all others. If not,
|
|
@@ -848,8 +851,8 @@ declare module "url" {
|
|
|
848
851
|
/**
|
|
849
852
|
* Returns an ES6 `Iterator` over the values of each name-value pair.
|
|
850
853
|
*/
|
|
851
|
-
values():
|
|
852
|
-
[Symbol.iterator]():
|
|
854
|
+
values(): URLSearchParamsIterator<string>;
|
|
855
|
+
[Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
|
|
853
856
|
}
|
|
854
857
|
|
|
855
858
|
import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
|
node v16.18/globals.global.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare var global: typeof globalThis;
|