@types/node 11.10.0 → 11.10.4

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,9 +8,9 @@ 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: Fri, 01 Mar 2019 20:48:15 GMT
11
+ * Last updated: Sat, 02 Mar 2019 01:57:45 GMT
12
12
  * Dependencies: none
13
- * Global values: Buffer, NodeJS, SharedArrayBuffer, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, queueMicrotask, require, setImmediate, setInterval, setTimeout
13
+ * Global values: Buffer, NodeJS, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, queueMicrotask, require, setImmediate, setInterval, setTimeout
14
14
 
15
15
  # Credits
16
- These definitions were written by Microsoft TypeScript <https://github.com/Microsoft>, DefinitelyTyped <https://github.com/DefinitelyTyped>, Alberto Schiabel <https://github.com/jkomyno>, Alexander T. <https://github.com/a-tarasyuk>, Alvis HT Tang <https://github.com/alvis>, Andrew Makarov <https://github.com/r3nya>, Benjamin Toueg <https://github.com/btoueg>, Bruno Scheufler <https://github.com/brunoscheufler>, Chigozirim C. <https://github.com/smac89>, Christian Vaagland Tellnes <https://github.com/tellnes>, David Junger <https://github.com/touffy>, Deividas Bakanas <https://github.com/DeividasBakanas>, Eugene Y. Q. Shen <https://github.com/eyqs>, Flarna <https://github.com/Flarna>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Hoàng Văn Khải <https://github.com/KSXGitHub>, Huw <https://github.com/hoo29>, Kelvin Jin <https://github.com/kjin>, Klaus Meinhardt <https://github.com/ajafff>, Lishude <https://github.com/islishude>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, Matthieu Sieben <https://github.com/matthieusieben>, Mohsen Azimi <https://github.com/mohsen1>, Nicolas Even <https://github.com/n-e>, Nicolas Voigt <https://github.com/octo-sniffle>, Parambir Singh <https://github.com/parambirs>, Sebastian Silbermann <https://github.com/eps1lon>, Simon Schick <https://github.com/SimonSchick>, Thomas den Hollander <https://github.com/ThomasdenH>, Wilco Bakker <https://github.com/WilcoBakker>, wwwy3y3 <https://github.com/wwwy3y3>, Zane Hannan AU <https://github.com/ZaneHannanAU>, Jeremie Rodriguez <https://github.com/jeremiergz>, Samuel Ainsworth <https://github.com/samuela>, Kyle Uehlein <https://github.com/kuehlein>.
16
+ These definitions were written by Microsoft TypeScript <https://github.com/Microsoft>, DefinitelyTyped <https://github.com/DefinitelyTyped>, Alberto Schiabel <https://github.com/jkomyno>, Alexander T. <https://github.com/a-tarasyuk>, Alvis HT Tang <https://github.com/alvis>, Andrew Makarov <https://github.com/r3nya>, Benjamin Toueg <https://github.com/btoueg>, Bruno Scheufler <https://github.com/brunoscheufler>, Chigozirim C. <https://github.com/smac89>, Christian Vaagland Tellnes <https://github.com/tellnes>, David Junger <https://github.com/touffy>, Deividas Bakanas <https://github.com/DeividasBakanas>, Eugene Y. Q. Shen <https://github.com/eyqs>, Flarna <https://github.com/Flarna>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Hoàng Văn Khải <https://github.com/KSXGitHub>, Huw <https://github.com/hoo29>, Kelvin Jin <https://github.com/kjin>, Klaus Meinhardt <https://github.com/ajafff>, Lishude <https://github.com/islishude>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, Matthieu Sieben <https://github.com/matthieusieben>, Mohsen Azimi <https://github.com/mohsen1>, Nicolas Even <https://github.com/n-e>, Nicolas Voigt <https://github.com/octo-sniffle>, Parambir Singh <https://github.com/parambirs>, Sebastian Silbermann <https://github.com/eps1lon>, Simon Schick <https://github.com/SimonSchick>, Thomas den Hollander <https://github.com/ThomasdenH>, Wilco Bakker <https://github.com/WilcoBakker>, wwwy3y3 <https://github.com/wwwy3y3>, Zane Hannan AU <https://github.com/ZaneHannanAU>, Jeremie Rodriguez <https://github.com/jeremiergz>, Samuel Ainsworth <https://github.com/samuela>, Kyle Uehlein <https://github.com/kuehlein>, Jordi Oliveras Rovira <https://github.com/j-oliveras>.
node/buffer.d.ts CHANGED
@@ -2,6 +2,10 @@ declare module "buffer" {
2
2
  export const INSPECT_MAX_BYTES: number;
3
3
  const BuffType: typeof Buffer;
4
4
 
5
+ export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
6
+
7
+ export function transcode(source: Buffer | Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
8
+
5
9
  export const SlowBuffer: {
6
10
  /** @deprecated since v6.0.0, use Buffer.allocUnsafeSlow() */
7
11
  new(size: number): Buffer;
node/child_process.d.ts CHANGED
@@ -291,7 +291,7 @@ declare module "child_process" {
291
291
  stderr: T;
292
292
  status: number;
293
293
  signal: string;
294
- error: Error;
294
+ error?: Error;
295
295
  }
296
296
  function spawnSync(command: string): SpawnSyncReturns<Buffer>;
297
297
  function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
node/crypto.d.ts CHANGED
@@ -405,6 +405,42 @@ declare module "crypto" {
405
405
  passphrase: string;
406
406
  }
407
407
 
408
+ interface KeyPairKeyObjectResult {
409
+ publicKey: KeyObject;
410
+ privateKey: KeyObject;
411
+ }
412
+
413
+ interface ECKeyPairKeyObjectOptions {
414
+ /**
415
+ * Name of the curve to use.
416
+ */
417
+ namedCurve: string;
418
+ }
419
+
420
+ interface RSAKeyPairKeyObjectOptions {
421
+ /**
422
+ * Key size in bits
423
+ */
424
+ modulusLength: number;
425
+
426
+ /**
427
+ * @default 0x10001
428
+ */
429
+ publicExponent?: number;
430
+ }
431
+
432
+ interface DSAKeyPairKeyObjectOptions {
433
+ /**
434
+ * Key size in bits
435
+ */
436
+ modulusLength: number;
437
+
438
+ /**
439
+ * Size of q in bits
440
+ */
441
+ divisorLength: number;
442
+ }
443
+
408
444
  interface RSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
409
445
  /**
410
446
  * Key size in bits
@@ -467,46 +503,55 @@ declare module "crypto" {
467
503
  function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
468
504
  function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
469
505
  function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
506
+ function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
470
507
 
471
508
  function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
472
509
  function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
473
510
  function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
474
511
  function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
512
+ function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
475
513
 
476
514
  function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
477
515
  function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
478
516
  function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
479
517
  function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
518
+ function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
480
519
 
481
520
  function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
482
521
  function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
483
522
  function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
484
523
  function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
524
+ function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
485
525
 
486
526
  function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
487
527
  function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
488
528
  function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
489
529
  function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
530
+ function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
490
531
 
491
532
  function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
492
533
  function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
493
534
  function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
494
535
  function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
536
+ function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
495
537
 
496
538
  namespace generateKeyPair {
497
539
  function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
498
540
  function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
499
541
  function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
500
542
  function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
543
+ function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
501
544
 
502
545
  function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
503
546
  function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
504
547
  function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
505
548
  function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
549
+ function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
506
550
 
507
551
  function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
508
552
  function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
509
553
  function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
510
554
  function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
555
+ function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
511
556
  }
512
557
  }
node/globals.d.ts CHANGED
@@ -681,7 +681,7 @@ declare namespace NodeJS {
681
681
  type ExitListener = (code: number) => void;
682
682
  type RejectionHandledListener = (promise: Promise<any>) => void;
683
683
  type UncaughtExceptionListener = (error: Error) => void;
684
- type UnhandledRejectionListener = (reason: any, promise: Promise<any>) => void;
684
+ type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise<any>) => void;
685
685
  type WarningListener = (warning: Error) => void;
686
686
  type MessageListener = (message: any, sendHandle: any) => void;
687
687
  type SignalsListener = (signal: Signals) => void;
@@ -721,6 +721,10 @@ declare namespace NodeJS {
721
721
  destroy(error?: Error): void;
722
722
  }
723
723
 
724
+ interface HRTime {
725
+ (time?: [number, number]): [number, number];
726
+ }
727
+
724
728
  interface Process extends EventEmitter {
725
729
  /**
726
730
  * Can also be a tty.WriteStream, not typed due to limitation.s
@@ -810,7 +814,7 @@ declare namespace NodeJS {
810
814
  */
811
815
  umask(mask?: number): number;
812
816
  uptime(): number;
813
- hrtime(time?: [number, number]): [number, number];
817
+ hrtime: HRTime;
814
818
  domain: Domain;
815
819
 
816
820
  // Worker
node/http.d.ts CHANGED
@@ -159,6 +159,7 @@ declare module "http" {
159
159
 
160
160
  constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
161
161
 
162
+ readonly path: string;
162
163
  abort(): void;
163
164
  onSocket(socket: net.Socket): void;
164
165
  setTimeout(timeout: number, callback?: () => void): this;
node/index.d.ts CHANGED
@@ -35,18 +35,19 @@
35
35
  // Jeremie Rodriguez <https://github.com/jeremiergz>
36
36
  // Samuel Ainsworth <https://github.com/samuela>
37
37
  // Kyle Uehlein <https://github.com/kuehlein>
38
+ // Jordi Oliveras Rovira <https://github.com/j-oliveras>
38
39
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
39
40
 
40
- // NOTE: These definitions support NodeJS and TypeScript 3.1.
41
+ // NOTE: These definitions support NodeJS and TypeScript 3.2.
41
42
 
42
43
  // NOTE: TypeScript version-specific augmentations can be found in the following paths:
43
44
  // - ~/base.d.ts - Shared definitions common to all TypeScript versions
44
45
  // - ~/index.d.ts - Definitions specific to TypeScript 2.1
45
- // - ~/ts3.1/index.d.ts - Definitions specific to TypeScript 3.1
46
+ // - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2
46
47
 
47
- // NOTE: Augmentations for TypeScript 3.1 and later should use individual files for overrides
48
- // within the respective ~/ts3.1 (or later) folder. However, this is disallowed for versions
49
- // prior to TypeScript 3.1, so the older definitions will be found here.
48
+ // NOTE: Augmentations for TypeScript 3.2 and later should use individual files for overrides
49
+ // within the respective ~/ts3.2 (or later) folder. However, this is disallowed for versions
50
+ // prior to TypeScript 3.2, so the older definitions will be found here.
50
51
 
51
52
  // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
52
53
  /// <reference path="base.d.ts" />
@@ -54,6 +55,9 @@
54
55
  // TypeScript 2.1-specific augmentations:
55
56
 
56
57
  // Forward-declarations for needed types from es2015 and later (in case users are using `--lib es5`)
58
+ // Empty interfaces are used here which merge fine with the real declarations in the lib XXX files
59
+ // just to ensure the names are known and node typings can be sued without importing these libs.
60
+ // if someone really needs these types the libs need to be added via --lib or in tsconfig.json
57
61
  interface MapConstructor { }
58
62
  interface WeakMapConstructor { }
59
63
  interface SetConstructor { }
@@ -72,8 +76,9 @@ interface SymbolConstructor {
72
76
  readonly asyncIterator: symbol;
73
77
  }
74
78
  declare var Symbol: SymbolConstructor;
75
- declare class SharedArrayBuffer {
76
- constructor(byteSize: number);
79
+ // even this is just a forward declaration some properties are added otherwise
80
+ // it would be allowed to pass anything to e.g. Buffer.from()
81
+ interface SharedArrayBuffer {
77
82
  readonly byteLength: number;
78
83
  slice(begin?: number, end?: number): SharedArrayBuffer;
79
84
  }
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "11.10.0",
3
+ "version": "11.10.4",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -178,14 +178,19 @@
178
178
  "name": "Kyle Uehlein",
179
179
  "url": "https://github.com/kuehlein",
180
180
  "githubUsername": "kuehlein"
181
+ },
182
+ {
183
+ "name": "Jordi Oliveras Rovira",
184
+ "url": "https://github.com/j-oliveras",
185
+ "githubUsername": "j-oliveras"
181
186
  }
182
187
  ],
183
188
  "main": "",
184
189
  "types": "index",
185
190
  "typesVersions": {
186
- ">=3.1.0-0": {
191
+ ">=3.2.0-0": {
187
192
  "*": [
188
- "ts3.1/*"
193
+ "ts3.2/*"
189
194
  ]
190
195
  }
191
196
  },
@@ -196,6 +201,6 @@
196
201
  },
197
202
  "scripts": {},
198
203
  "dependencies": {},
199
- "typesPublisherContentHash": "54e02d9e6ce8e6c206db4cb4eb1f78b7158c08f78816d509fa2423564192b633",
204
+ "typesPublisherContentHash": "5b11db9d8055487b54a7fc4d5036fad1e1412dae96268aedb4db89b0b100d129",
200
205
  "typeScriptVersion": "2.0"
201
206
  }
@@ -0,0 +1,8 @@
1
+ // tslint:disable-next-line:no-bad-reference
2
+ /// <reference path="../globals.d.ts" />
3
+
4
+ declare namespace NodeJS {
5
+ interface HRTime {
6
+ bigint(): bigint;
7
+ }
8
+ }
@@ -1,18 +1,20 @@
1
- // NOTE: These definitions support NodeJS and TypeScript 3.1.
1
+ // NOTE: These definitions support NodeJS and TypeScript 3.2.
2
2
 
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 2.1
6
- // - ~/ts3.1/index.d.ts - Definitions specific to TypeScript 3.1
6
+ // - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2
7
7
 
8
8
  // Reference required types from the default lib:
9
9
  /// <reference lib="es2018" />
10
10
  /// <reference lib="esnext.asynciterable" />
11
11
  /// <reference lib="esnext.intl" />
12
+ /// <reference lib="esnext.bigint" />
12
13
 
13
14
  // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
14
15
  // tslint:disable-next-line:no-bad-reference
15
16
  /// <reference path="../base.d.ts" />
16
17
 
17
- // TypeScript 3.1-specific augmentations:
18
+ // TypeScript 3.2-specific augmentations:
18
19
  /// <reference path="util.d.ts" />
20
+ /// <reference path="globals.d.ts" />
File without changes