@types/node 15.9.0 → 15.12.3
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/child_process.d.ts +9 -4
- node/console.d.ts +9 -9
- node/crypto.d.ts +61 -0
- node/globals.d.ts +5 -3
- node/http2.d.ts +7 -0
- node/index.d.ts +6 -6
- node/package.json +2 -2
- node/stream.d.ts +1 -1
- node/ts3.6/base.d.ts +4 -4
- node/ts3.6/index.d.ts +1 -1
- node/worker_threads.d.ts +17 -0
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (http://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: Fri, 18 Jun 2021 09:31:14 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
|
|
14
14
|
|
node/child_process.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare module 'child_process' {
|
|
|
4
4
|
import * as net from 'net';
|
|
5
5
|
import { Writable, Readable, Stream, Pipe } from 'stream';
|
|
6
6
|
|
|
7
|
-
type Serializable = string | object | number | boolean;
|
|
7
|
+
type Serializable = string | object | number | boolean | bigint;
|
|
8
8
|
type SendHandle = net.Socket | net.Server;
|
|
9
9
|
|
|
10
10
|
interface ChildProcess extends EventEmitter {
|
|
@@ -20,7 +20,7 @@ declare module 'child_process' {
|
|
|
20
20
|
Readable | Writable | null | undefined // extra
|
|
21
21
|
];
|
|
22
22
|
readonly killed: boolean;
|
|
23
|
-
readonly pid
|
|
23
|
+
readonly pid?: number;
|
|
24
24
|
readonly connected: boolean;
|
|
25
25
|
readonly exitCode: number | null;
|
|
26
26
|
readonly signalCode: NodeJS.Signals | null;
|
|
@@ -135,12 +135,18 @@ declare module 'child_process' {
|
|
|
135
135
|
|
|
136
136
|
type SerializationType = 'json' | 'advanced';
|
|
137
137
|
|
|
138
|
-
interface MessagingOptions {
|
|
138
|
+
interface MessagingOptions extends Abortable {
|
|
139
139
|
/**
|
|
140
140
|
* Specify the kind of serialization used for sending messages between processes.
|
|
141
141
|
* @default 'json'
|
|
142
142
|
*/
|
|
143
143
|
serialization?: SerializationType;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* The signal value to be used when the spawned process will be killed by the abort signal.
|
|
147
|
+
* @default 'SIGTERM'
|
|
148
|
+
*/
|
|
149
|
+
killSignal?: NodeJS.Signals | number;
|
|
144
150
|
}
|
|
145
151
|
|
|
146
152
|
interface ProcessEnvOptions {
|
|
@@ -451,7 +457,6 @@ declare module 'child_process' {
|
|
|
451
457
|
|
|
452
458
|
interface SpawnSyncOptions extends CommonSpawnOptions {
|
|
453
459
|
input?: string | NodeJS.ArrayBufferView;
|
|
454
|
-
killSignal?: NodeJS.Signals | number;
|
|
455
460
|
maxBuffer?: number;
|
|
456
461
|
encoding?: BufferEncoding | 'buffer' | null;
|
|
457
462
|
}
|
node/console.d.ts
CHANGED
|
@@ -25,16 +25,16 @@ declare module 'console' {
|
|
|
25
25
|
*/
|
|
26
26
|
countReset(label?: string): void;
|
|
27
27
|
/**
|
|
28
|
-
* The `console.debug()` function is an alias for {@link console.log
|
|
28
|
+
* The `console.debug()` function is an alias for {@link console.log}.
|
|
29
29
|
*/
|
|
30
30
|
debug(message?: any, ...optionalParams: any[]): void;
|
|
31
31
|
/**
|
|
32
|
-
* Uses {@link util.inspect
|
|
32
|
+
* Uses {@link util.inspect} on `obj` and prints the resulting string to `stdout`.
|
|
33
33
|
* This function bypasses any custom `inspect()` function defined on `obj`.
|
|
34
34
|
*/
|
|
35
35
|
dir(obj: any, options?: InspectOptions): void;
|
|
36
36
|
/**
|
|
37
|
-
* This method calls {@link console.log
|
|
37
|
+
* This method calls {@link console.log} passing it the arguments received. Please note that this method does not produce any XML formatting
|
|
38
38
|
*/
|
|
39
39
|
dirxml(...data: any[]): void;
|
|
40
40
|
/**
|
|
@@ -47,7 +47,7 @@ declare module 'console' {
|
|
|
47
47
|
*/
|
|
48
48
|
group(...label: any[]): void;
|
|
49
49
|
/**
|
|
50
|
-
* The `console.groupCollapsed()` function is an alias for {@link console.group
|
|
50
|
+
* The `console.groupCollapsed()` function is an alias for {@link console.group}.
|
|
51
51
|
*/
|
|
52
52
|
groupCollapsed(...label: any[]): void;
|
|
53
53
|
/**
|
|
@@ -55,7 +55,7 @@ declare module 'console' {
|
|
|
55
55
|
*/
|
|
56
56
|
groupEnd(): void;
|
|
57
57
|
/**
|
|
58
|
-
* The {@link console.info
|
|
58
|
+
* The {@link console.info} function is an alias for {@link console.log}.
|
|
59
59
|
*/
|
|
60
60
|
info(message?: any, ...optionalParams: any[]): void;
|
|
61
61
|
/**
|
|
@@ -72,19 +72,19 @@ declare module 'console' {
|
|
|
72
72
|
*/
|
|
73
73
|
time(label?: string): void;
|
|
74
74
|
/**
|
|
75
|
-
* Stops a timer that was previously started by calling {@link console.time
|
|
75
|
+
* Stops a timer that was previously started by calling {@link console.time} and prints the result to `stdout`.
|
|
76
76
|
*/
|
|
77
77
|
timeEnd(label?: string): void;
|
|
78
78
|
/**
|
|
79
|
-
* For a timer that was previously started by calling {@link console.time
|
|
79
|
+
* For a timer that was previously started by calling {@link console.time}, prints the elapsed time and other `data` arguments to `stdout`.
|
|
80
80
|
*/
|
|
81
81
|
timeLog(label?: string, ...data: any[]): void;
|
|
82
82
|
/**
|
|
83
|
-
* Prints to `stderr` the string 'Trace :', followed by the {@link util.format
|
|
83
|
+
* Prints to `stderr` the string 'Trace :', followed by the {@link util.format} formatted message and stack trace to the current position in the code.
|
|
84
84
|
*/
|
|
85
85
|
trace(message?: any, ...optionalParams: any[]): void;
|
|
86
86
|
/**
|
|
87
|
-
* The {@link console.warn
|
|
87
|
+
* The {@link console.warn} function is an alias for {@link console.error}.
|
|
88
88
|
*/
|
|
89
89
|
warn(message?: any, ...optionalParams: any[]): void;
|
|
90
90
|
|
node/crypto.d.ts
CHANGED
|
@@ -197,6 +197,45 @@ declare module 'crypto' {
|
|
|
197
197
|
passphrase?: string | Buffer;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
+
interface JwkKeyExportOptions {
|
|
201
|
+
format: 'jwk';
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
interface JsonWebKey {
|
|
205
|
+
crv?: string;
|
|
206
|
+
d?: string;
|
|
207
|
+
dp?: string;
|
|
208
|
+
dq?: string;
|
|
209
|
+
e?: string;
|
|
210
|
+
k?: string;
|
|
211
|
+
kty?: string;
|
|
212
|
+
n?: string;
|
|
213
|
+
p?: string;
|
|
214
|
+
q?: string;
|
|
215
|
+
qi?: string;
|
|
216
|
+
x?: string;
|
|
217
|
+
y?: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
interface AsymmetricKeyDetails {
|
|
221
|
+
/**
|
|
222
|
+
* Key size in bits (RSA, DSA).
|
|
223
|
+
*/
|
|
224
|
+
modulusLength?: number;
|
|
225
|
+
/**
|
|
226
|
+
* Public exponent (RSA).
|
|
227
|
+
*/
|
|
228
|
+
publicExponent?: bigint;
|
|
229
|
+
/**
|
|
230
|
+
* Size of q in bits (DSA).
|
|
231
|
+
*/
|
|
232
|
+
divisorLength?: number;
|
|
233
|
+
/**
|
|
234
|
+
* Name of the curve (EC).
|
|
235
|
+
*/
|
|
236
|
+
namedCurve?: string;
|
|
237
|
+
}
|
|
238
|
+
|
|
200
239
|
class KeyObject {
|
|
201
240
|
private constructor();
|
|
202
241
|
asymmetricKeyType?: KeyType;
|
|
@@ -205,6 +244,13 @@ declare module 'crypto' {
|
|
|
205
244
|
* bytes. This property is `undefined` for symmetric keys.
|
|
206
245
|
*/
|
|
207
246
|
asymmetricKeySize?: number;
|
|
247
|
+
/**
|
|
248
|
+
* This property exists only on asymmetric keys. Depending on the type of the key,
|
|
249
|
+
* this object contains information about the key. None of the information obtained
|
|
250
|
+
* through this property can be used to uniquely identify a key or to compromise the
|
|
251
|
+
* security of the key.
|
|
252
|
+
*/
|
|
253
|
+
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
208
254
|
export(options: KeyExportOptions<'pem'>): string | Buffer;
|
|
209
255
|
export(options?: KeyExportOptions<'der'>): Buffer;
|
|
210
256
|
symmetricKeySize?: number;
|
|
@@ -330,6 +376,8 @@ declare module 'crypto' {
|
|
|
330
376
|
type?: 'pkcs1' | 'spki';
|
|
331
377
|
}
|
|
332
378
|
|
|
379
|
+
function generateKey(type: 'hmac' | 'aes', options: {length: number}, callback: (err: Error | null, key: KeyObject) => void): KeyObject;
|
|
380
|
+
|
|
333
381
|
function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject;
|
|
334
382
|
function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject;
|
|
335
383
|
function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
|
|
@@ -1171,6 +1219,12 @@ declare module 'crypto' {
|
|
|
1171
1219
|
data: NodeJS.ArrayBufferView,
|
|
1172
1220
|
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
|
|
1173
1221
|
): Buffer;
|
|
1222
|
+
function sign(
|
|
1223
|
+
algorithm: string | null | undefined,
|
|
1224
|
+
data: NodeJS.ArrayBufferView,
|
|
1225
|
+
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
|
|
1226
|
+
callback: (error: Error | null, data: Buffer) => void
|
|
1227
|
+
): void;
|
|
1174
1228
|
|
|
1175
1229
|
/**
|
|
1176
1230
|
* Calculates and returns the signature for `data` using the given private key and
|
|
@@ -1186,6 +1240,13 @@ declare module 'crypto' {
|
|
|
1186
1240
|
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
|
|
1187
1241
|
signature: NodeJS.ArrayBufferView,
|
|
1188
1242
|
): boolean;
|
|
1243
|
+
function verify(
|
|
1244
|
+
algorithm: string | null | undefined,
|
|
1245
|
+
data: NodeJS.ArrayBufferView,
|
|
1246
|
+
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
|
|
1247
|
+
signature: NodeJS.ArrayBufferView,
|
|
1248
|
+
callback: (error: Error | null, result: boolean) => void
|
|
1249
|
+
): void;
|
|
1189
1250
|
|
|
1190
1251
|
/**
|
|
1191
1252
|
* Computes the Diffie-Hellman secret based on a privateKey and a publicKey.
|
node/globals.d.ts
CHANGED
|
@@ -37,9 +37,9 @@ interface ImportMeta {
|
|
|
37
37
|
------------------------------------------------*/
|
|
38
38
|
|
|
39
39
|
// For backwards compability
|
|
40
|
-
interface NodeRequire extends NodeJS.Require {}
|
|
41
|
-
interface RequireResolve extends NodeJS.RequireResolve {}
|
|
42
|
-
interface NodeModule extends NodeJS.Module {}
|
|
40
|
+
interface NodeRequire extends NodeJS.Require { }
|
|
41
|
+
interface RequireResolve extends NodeJS.RequireResolve { }
|
|
42
|
+
interface NodeModule extends NodeJS.Module { }
|
|
43
43
|
|
|
44
44
|
declare var process: NodeJS.Process;
|
|
45
45
|
declare var console: Console;
|
|
@@ -318,6 +318,7 @@ interface AbortController {
|
|
|
318
318
|
/**
|
|
319
319
|
* Returns the AbortSignal object associated with this object.
|
|
320
320
|
*/
|
|
321
|
+
|
|
321
322
|
readonly signal: AbortSignal;
|
|
322
323
|
/**
|
|
323
324
|
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
|
@@ -341,6 +342,7 @@ declare var AbortController: {
|
|
|
341
342
|
declare var AbortSignal: {
|
|
342
343
|
prototype: AbortSignal;
|
|
343
344
|
new(): AbortSignal;
|
|
345
|
+
// TODO: Add abort() static
|
|
344
346
|
};
|
|
345
347
|
//#endregion borrowed
|
|
346
348
|
|
node/http2.d.ts
CHANGED
|
@@ -438,6 +438,13 @@ declare module 'http2' {
|
|
|
438
438
|
paddingStrategy?: number;
|
|
439
439
|
peerMaxConcurrentStreams?: number;
|
|
440
440
|
settings?: Settings;
|
|
441
|
+
/**
|
|
442
|
+
* Specifies a timeout in milliseconds that
|
|
443
|
+
* a server should wait when an [`'unknownProtocol'`][] is emitted. If the
|
|
444
|
+
* socket has not been destroyed by that time the server will destroy it.
|
|
445
|
+
* @default 100000
|
|
446
|
+
*/
|
|
447
|
+
unknownProtocolTimeout?: number;
|
|
441
448
|
|
|
442
449
|
selectPadding?(frameLen: number, maxFrameLen: number): number;
|
|
443
450
|
createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex;
|
node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for non-npm package Node.js 15.
|
|
1
|
+
// Type definitions for non-npm package Node.js 15.12
|
|
2
2
|
// Project: http://nodejs.org/
|
|
3
3
|
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
|
4
4
|
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
|
|
51
51
|
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
|
|
52
52
|
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
|
|
53
|
-
// - ~/index.d.ts - Definitions specific to TypeScript
|
|
54
|
-
// - ~/ts3.
|
|
53
|
+
// - ~/index.d.ts - Definitions specific to TypeScript 3.7
|
|
54
|
+
// - ~/ts3.6/index.d.ts - Definitions specific to TypeScript 3.6
|
|
55
55
|
|
|
56
|
-
// NOTE: Augmentations for TypeScript 3.
|
|
57
|
-
// within the respective ~/ts3.
|
|
58
|
-
// prior to TypeScript 3.
|
|
56
|
+
// NOTE: Augmentations for TypeScript 3.6 and later should use individual files for overrides
|
|
57
|
+
// within the respective ~/ts3.6 (or later) folder. However, this is disallowed for versions
|
|
58
|
+
// prior to TypeScript 3.6, so the older definitions will be found here.
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.12.3",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -227,6 +227,6 @@
|
|
|
227
227
|
},
|
|
228
228
|
"scripts": {},
|
|
229
229
|
"dependencies": {},
|
|
230
|
-
"typesPublisherContentHash": "
|
|
230
|
+
"typesPublisherContentHash": "7d407772fe9c0edcbff7320cf0827e14396d3a734e2205f9ee6b37dc8ff8a33f",
|
|
231
231
|
"typeScriptVersion": "3.6"
|
|
232
232
|
}
|
node/stream.d.ts
CHANGED
|
@@ -301,7 +301,7 @@ declare module 'stream' {
|
|
|
301
301
|
*/
|
|
302
302
|
function addAbortSignal<T extends Stream>(signal: AbortSignal, stream: T): T;
|
|
303
303
|
|
|
304
|
-
interface FinishedOptions {
|
|
304
|
+
interface FinishedOptions extends Abortable {
|
|
305
305
|
error?: boolean;
|
|
306
306
|
readable?: boolean;
|
|
307
307
|
writable?: boolean;
|
node/ts3.6/base.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
|
|
4
4
|
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
|
|
5
5
|
// - ~/index.d.ts - Definitions specific to TypeScript 3.7 and above
|
|
6
|
-
// - ~/ts3.
|
|
7
|
-
// - ~/ts3.
|
|
6
|
+
// - ~/ts3.6/base.d.ts - Definitions specific to TypeScript 3.6 and earlier
|
|
7
|
+
// - ~/ts3.6/index.d.ts - Definitions specific to TypeScript 3.6 and earlier with assert pulled in
|
|
8
8
|
|
|
9
9
|
// Reference required types from the default lib:
|
|
10
10
|
/// <reference lib="es2018" />
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
/// <reference path="../worker_threads.d.ts" />
|
|
62
62
|
/// <reference path="../zlib.d.ts" />
|
|
63
63
|
|
|
64
|
-
// TypeScript 3.
|
|
64
|
+
// TypeScript 3.6-specific augmentations:
|
|
65
65
|
/// <reference path="../globals.global.d.ts" />
|
|
66
66
|
|
|
67
|
-
// TypeScript 3.
|
|
67
|
+
// TypeScript 3.6-specific augmentations:
|
|
68
68
|
/// <reference path="../wasi.d.ts" />
|
node/ts3.6/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// NOTE: These definitions support NodeJS and TypeScript 3.
|
|
1
|
+
// NOTE: These definitions support NodeJS and TypeScript 3.6.
|
|
2
2
|
// This is required to enable typing assert in ts3.7 without causing errors
|
|
3
3
|
// Typically type modifications should be made in base.d.ts instead of here
|
|
4
4
|
|
node/worker_threads.d.ts
CHANGED
|
@@ -262,4 +262,21 @@ declare module 'worker_threads' {
|
|
|
262
262
|
* `MessagePort`’s queue.
|
|
263
263
|
*/
|
|
264
264
|
function receiveMessageOnPort(port: MessagePort): { message: any } | undefined;
|
|
265
|
+
|
|
266
|
+
type Serializable = string | object | number | boolean | bigint;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
|
|
270
|
+
* @experimental
|
|
271
|
+
*/
|
|
272
|
+
function getEnvironmentData(key: Serializable): Serializable;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
|
|
276
|
+
* @param value Any arbitrary, cloneable JavaScript value that will be cloned
|
|
277
|
+
* and passed automatically to all new `Worker` instances. If `value` is passed
|
|
278
|
+
* as `undefined`, any previously set value for the `key` will be deleted.
|
|
279
|
+
* @experimental
|
|
280
|
+
*/
|
|
281
|
+
function setEnvironmentData(key: Serializable, value: Serializable): void;
|
|
265
282
|
}
|