@types/node 15.12.2 → 15.14.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: Mon, 07 Jun 2021 23:01:23 GMT
11
+ * Last updated: Thu, 01 Jul 2021 19:01:25 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/buffer.d.ts CHANGED
@@ -77,6 +77,34 @@ declare module 'buffer' {
77
77
  */
78
78
  text(): Promise<string>;
79
79
  }
80
+
81
+ /**
82
+ * Decodes a string of Base64-encoded data into bytes, and encodes those bytes into a string using Latin-1 (ISO-8859-1).
83
+ *
84
+ * This function is only provided for compatibility with legacy web platform APIs
85
+ * and should never be used in new code, because they use strings to represent
86
+ * binary data and predate the introduction of typed arrays in JavaScript.
87
+ * For code running using Node.js APIs, converting between base64-encoded strings
88
+ * and binary data should be performed using `Buffer.from(str, 'base64')` and
89
+ * `buf.toString('base64')`.
90
+ *
91
+ * @deprecated dom compatibility
92
+ */
93
+ export function atob(input: string): string;
94
+
95
+ /**
96
+ * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes into a string using Base64.
97
+ *
98
+ * This function is only provided for compatibility with legacy web platform APIs
99
+ * and should never be used in new code, because they use strings to represent
100
+ * binary data and predate the introduction of typed arrays in JavaScript.
101
+ * For code running using Node.js APIs, converting between base64-encoded strings
102
+ * and binary data should be performed using `Buffer.from(str, 'base64')` and
103
+ * `buf.toString('base64')`.
104
+ *
105
+ * @deprecated dom compatibility
106
+ */
107
+ export function btoa(input: string): string;
80
108
  }
81
109
 
82
110
  declare module 'node:buffer' {
node/child_process.d.ts CHANGED
@@ -147,6 +147,11 @@ declare module 'child_process' {
147
147
  * @default 'SIGTERM'
148
148
  */
149
149
  killSignal?: NodeJS.Signals | number;
150
+
151
+ /**
152
+ * In milliseconds the maximum amount of time the process is allowed to run.
153
+ */
154
+ timeout?: number;
150
155
  }
151
156
 
152
157
  interface ProcessEnvOptions {
@@ -483,14 +488,17 @@ declare module 'child_process' {
483
488
  function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
484
489
  function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
485
490
 
486
- interface ExecSyncOptions extends CommonOptions {
487
- input?: string | Uint8Array;
491
+ interface CommonExecOptions extends ProcessEnvOptions {
492
+ input?: string | NodeJS.ArrayBufferView;
488
493
  stdio?: StdioOptions;
489
- shell?: string;
490
494
  killSignal?: NodeJS.Signals | number;
491
495
  maxBuffer?: number;
492
496
  encoding?: BufferEncoding | 'buffer' | null;
493
497
  }
498
+
499
+ interface ExecSyncOptions extends CommonExecOptions {
500
+ shell?: string;
501
+ }
494
502
  interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
495
503
  encoding: BufferEncoding;
496
504
  }
@@ -502,12 +510,7 @@ declare module 'child_process' {
502
510
  function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
503
511
  function execSync(command: string, options?: ExecSyncOptions): Buffer;
504
512
 
505
- interface ExecFileSyncOptions extends CommonOptions {
506
- input?: string | NodeJS.ArrayBufferView;
507
- stdio?: StdioOptions;
508
- killSignal?: NodeJS.Signals | number;
509
- maxBuffer?: number;
510
- encoding?: BufferEncoding;
513
+ interface ExecFileSyncOptions extends CommonExecOptions {
511
514
  shell?: boolean | string;
512
515
  }
513
516
  interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
node/crypto.d.ts CHANGED
@@ -196,11 +196,9 @@ declare module 'crypto' {
196
196
  cipher?: string;
197
197
  passphrase?: string | Buffer;
198
198
  }
199
-
200
199
  interface JwkKeyExportOptions {
201
200
  format: 'jwk';
202
201
  }
203
-
204
202
  interface JsonWebKey {
205
203
  crv?: string;
206
204
  d?: string;
@@ -215,6 +213,7 @@ declare module 'crypto' {
215
213
  qi?: string;
216
214
  x?: string;
217
215
  y?: string;
216
+ [key: string]: unknown;
218
217
  }
219
218
 
220
219
  interface AsymmetricKeyDetails {
@@ -236,6 +235,10 @@ declare module 'crypto' {
236
235
  namedCurve?: string;
237
236
  }
238
237
 
238
+ interface JwkKeyExportOptions {
239
+ format: 'jwk';
240
+ }
241
+
239
242
  class KeyObject {
240
243
  private constructor();
241
244
  asymmetricKeyType?: KeyType;
@@ -253,6 +256,7 @@ declare module 'crypto' {
253
256
  asymmetricKeyDetails?: AsymmetricKeyDetails;
254
257
  export(options: KeyExportOptions<'pem'>): string | Buffer;
255
258
  export(options?: KeyExportOptions<'der'>): Buffer;
259
+ export(options?: JwkKeyExportOptions): JsonWebKey;
256
260
  symmetricKeySize?: number;
257
261
  type: KeyObjectType;
258
262
  }
@@ -376,8 +380,15 @@ declare module 'crypto' {
376
380
  type?: 'pkcs1' | 'spki';
377
381
  }
378
382
 
379
- function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject;
380
- function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject;
383
+ function generateKey(type: 'hmac' | 'aes', options: {length: number}, callback: (err: Error | null, key: KeyObject) => void): void;
384
+
385
+ interface JsonWebKeyInput {
386
+ key: JsonWebKey;
387
+ format: 'jwk';
388
+ }
389
+
390
+ function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject;
391
+ function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject;
381
392
  function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
382
393
 
383
394
  function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
node/fs/promises.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  declare module 'fs/promises' {
2
2
  import { Abortable } from 'events';
3
+ import { Stream } from 'stream';
3
4
  import {
4
5
  Stats,
5
6
  BigIntStats,
@@ -512,7 +513,11 @@ declare module 'fs/promises' {
512
513
  * If `mode` is a string, it is parsed as an octal integer.
513
514
  * If `flag` is not supplied, the default of `'w'` is used.
514
515
  */
515
- function writeFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } & Abortable | BufferEncoding | null): Promise<void>;
516
+ function writeFile(
517
+ path: PathLike | FileHandle,
518
+ data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | Stream,
519
+ options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } & Abortable | BufferEncoding | null
520
+ ): Promise<void>;
516
521
 
517
522
  /**
518
523
  * Asynchronously append data to a file, creating the file if it does not exist.
node/http.d.ts CHANGED
@@ -229,6 +229,11 @@ declare module 'http' {
229
229
  setTimeout(timeout: number, callback?: () => void): this;
230
230
  setNoDelay(noDelay?: boolean): void;
231
231
  setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
232
+ /**
233
+ * Returns an array containing the unique names of the current outgoing raw headers.
234
+ * Header names are returned with their exact casing being set.
235
+ */
236
+ getRawHeaderNames(): string[];
232
237
 
233
238
  addListener(event: 'abort', listener: () => void): this;
234
239
  addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 15.12
1
+ // Type definitions for non-npm package Node.js 15.14
2
2
  // Project: http://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
node/net.d.ts CHANGED
@@ -273,6 +273,7 @@ declare module 'net' {
273
273
  * @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
274
274
  */
275
275
  addAddress(address: string, type?: IPVersion): void;
276
+ addAddress(address: SocketAddress): void;
276
277
 
277
278
  /**
278
279
  * Adds a rule to block a range of IP addresses from start (inclusive) to end (inclusive).
@@ -282,6 +283,7 @@ declare module 'net' {
282
283
  * @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
283
284
  */
284
285
  addRange(start: string, end: string, type?: IPVersion): void;
286
+ addRange(start: SocketAddress, end: SocketAddress): void;
285
287
 
286
288
  /**
287
289
  * Adds a rule to block a range of IP addresses specified as a subnet mask.
@@ -291,6 +293,7 @@ declare module 'net' {
291
293
  * For IPv4, this must be a value between 0 and 32. For IPv6, this must be between 0 and 128.
292
294
  * @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
293
295
  */
296
+ addSubnet(net: SocketAddress, prefix: number): void;
294
297
  addSubnet(net: string, prefix: number, type?: IPVersion): void;
295
298
 
296
299
  /**
@@ -299,6 +302,7 @@ declare module 'net' {
299
302
  * @param address The IP address to check
300
303
  * @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
301
304
  */
305
+ check(address: SocketAddress): boolean;
302
306
  check(address: string, type?: IPVersion): boolean;
303
307
  }
304
308
 
@@ -323,4 +327,38 @@ declare module 'net' {
323
327
  function isIP(input: string): number;
324
328
  function isIPv4(input: string): boolean;
325
329
  function isIPv6(input: string): boolean;
330
+
331
+ interface SocketAddressInitOptions {
332
+ /**
333
+ * The network address as either an IPv4 or IPv6 string.
334
+ * @default 127.0.0.1
335
+ */
336
+ address?: string;
337
+ /**
338
+ * @default `'ipv4'`
339
+ */
340
+ family?: IPVersion;
341
+ /**
342
+ * An IPv6 flow-label used only if `family` is `'ipv6'`.
343
+ * @default 0
344
+ */
345
+ flowlabel?: number;
346
+ /**
347
+ * An IP port.
348
+ * @default 0
349
+ */
350
+ port?: number;
351
+ }
352
+
353
+ // TODO: Mark as clonable if `kClone` symbol is set in node.
354
+ /**
355
+ * Immutable socket address.
356
+ */
357
+ class SocketAddress {
358
+ constructor(options: SocketAddressInitOptions);
359
+ readonly address: string;
360
+ readonly family: IPVersion;
361
+ readonly port: number;
362
+ readonly flowlabel: number;
363
+ }
326
364
  }
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "15.12.2",
3
+ "version": "15.14.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": "9713490f7bb15f02ab4ef68c39e2ec33cdecadbc39062c33ca86f9e4d8018d9b",
230
+ "typesPublisherContentHash": "61808f4174f8094e6d1396d1a7038b6ff05a773d74844d41d45e476e5b30f0eb",
231
231
  "typeScriptVersion": "3.6"
232
232
  }
node/process.d.ts CHANGED
@@ -59,6 +59,7 @@ declare module 'process' {
59
59
  | 'android'
60
60
  | 'darwin'
61
61
  | 'freebsd'
62
+ | 'haiku'
62
63
  | 'linux'
63
64
  | 'openbsd'
64
65
  | 'sunos'