@types/node 15.9.0 → 15.12.0

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 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: Wed, 02 Jun 2021 22:31:36 GMT
11
+ * Last updated: Thu, 03 Jun 2021 14:01:34 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: number;
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/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;
@@ -1171,6 +1217,12 @@ declare module 'crypto' {
1171
1217
  data: NodeJS.ArrayBufferView,
1172
1218
  key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
1173
1219
  ): Buffer;
1220
+ function sign(
1221
+ algorithm: string | null | undefined,
1222
+ data: NodeJS.ArrayBufferView,
1223
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
1224
+ callback: (error: Error | null, data: Buffer) => void
1225
+ ): void;
1174
1226
 
1175
1227
  /**
1176
1228
  * Calculates and returns the signature for `data` using the given private key and
@@ -1186,6 +1238,13 @@ declare module 'crypto' {
1186
1238
  key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
1187
1239
  signature: NodeJS.ArrayBufferView,
1188
1240
  ): boolean;
1241
+ function verify(
1242
+ algorithm: string | null | undefined,
1243
+ data: NodeJS.ArrayBufferView,
1244
+ key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
1245
+ signature: NodeJS.ArrayBufferView,
1246
+ callback: (error: Error | null, result: boolean) => void
1247
+ ): void;
1189
1248
 
1190
1249
  /**
1191
1250
  * 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.
@@ -331,6 +332,11 @@ interface AbortSignal {
331
332
  * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
332
333
  */
333
334
  readonly aborted: boolean;
335
+
336
+ /**
337
+ * 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.
338
+ */
339
+ abort(): void;
334
340
  }
335
341
 
336
342
  declare var AbortController: {
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.9
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 2.8
54
- // - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5
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.5 and later should use individual files for overrides
57
- // within the respective ~/ts3.5 (or later) folder. However, this is disallowed for versions
58
- // prior to TypeScript 3.5, so the older definitions will be found here.
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.9.0",
3
+ "version": "15.12.0",
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": "cb014fbf92870923982004e4fca76f59150c147625c5fc51365d369f858eb620",
230
+ "typesPublisherContentHash": "2af6053c97f2d873b354fa2bd898df70fe2271585814d07e724e3f12c08d719e",
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.5/base.d.ts - Definitions specific to TypeScript 3.6 and earlier
7
- // - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.6 and earlier with assert pulled in
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.5-specific augmentations:
64
+ // TypeScript 3.6-specific augmentations:
65
65
  /// <reference path="../globals.global.d.ts" />
66
66
 
67
- // TypeScript 3.5-specific augmentations:
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.5 - 3.6.
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
  }