@types/node 10.11.5 → 10.12.1

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.
Files changed (4) hide show
  1. node/LICENSE +21 -21
  2. node/README.md +2 -2
  3. node/index.d.ts +172 -25
  4. node/package.json +8 -2
node/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) Microsoft Corporation. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
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: Mon, 08 Oct 2018 22:12:11 GMT
11
+ * Last updated: Mon, 29 Oct 2018 17:45:08 GMT
12
12
  * Dependencies: none
13
13
  * Global values: Buffer, NodeJS, SlowBuffer, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, 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>, Bruno Scheufler <https://github.com/brunoscheufler>, Chigozirim C. <https://github.com/smac89>, Christian Vaagland Tellnes <https://github.com/tellnes>, 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>.
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>, Bruno Scheufler <https://github.com/brunoscheufler>, Chigozirim C. <https://github.com/smac89>, Christian Vaagland Tellnes <https://github.com/tellnes>, 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>.
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for Node.js 10.11
1
+ // Type definitions for Node.js 10.12
2
2
  // Project: http://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
@@ -30,6 +30,7 @@
30
30
  // Wilco Bakker <https://github.com/WilcoBakker>
31
31
  // wwwy3y3 <https://github.com/wwwy3y3>
32
32
  // Zane Hannan AU <https://github.com/ZaneHannanAU>
33
+ // Jeremie Rodriguez <https://github.com/jeremiergz>
33
34
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
34
35
 
35
36
  /** inspector module types */
@@ -108,6 +109,10 @@ interface Console {
108
109
  * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`.
109
110
  */
110
111
  timeEnd(label?: string): void;
112
+ /**
113
+ * For a timer that was previously started by calling {@link console.time()}, prints the elapsed time and other `data` arguments to `stdout`.
114
+ */
115
+ timeLog(label: string, ...data: any[]): void;
111
116
  /**
112
117
  * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code.
113
118
  */
@@ -154,7 +159,7 @@ interface ErrorConstructor {
154
159
  stackTraceLimit: number;
155
160
  }
156
161
 
157
- // compat for TypeScript 1.8
162
+ // compat for TypeScript 1.8 and default es5 target
158
163
  // if you use with --target es3 or --target es5 and use below definitions,
159
164
  // use the lib.es6.d.ts that is bundled with TypeScript 1.8.
160
165
  interface MapConstructor { }
@@ -162,6 +167,9 @@ interface WeakMapConstructor { }
162
167
  interface SetConstructor { }
163
168
  interface WeakSetConstructor { }
164
169
 
170
+ interface Set<T> {}
171
+ interface ReadonlySet<T> {}
172
+
165
173
  // Forward-declare needed types from lib.es2015.d.ts (in case users are using `--lib es5`)
166
174
  interface Iterable<T> { }
167
175
  interface Iterator<T> {
@@ -200,20 +208,20 @@ declare var console: Console;
200
208
  declare var __filename: string;
201
209
  declare var __dirname: string;
202
210
 
203
- declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
211
+ declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
204
212
  declare namespace setTimeout {
205
213
  function __promisify__(ms: number): Promise<void>;
206
214
  function __promisify__<T>(ms: number, value: T): Promise<T>;
207
215
  }
208
- declare function clearTimeout(timeoutId: NodeJS.Timer): void;
209
- declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
210
- declare function clearInterval(intervalId: NodeJS.Timer): void;
211
- declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
216
+ declare function clearTimeout(timeoutId: NodeJS.Timeout): void;
217
+ declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
218
+ declare function clearInterval(intervalId: NodeJS.Timeout): void;
219
+ declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
212
220
  declare namespace setImmediate {
213
221
  function __promisify__(): Promise<void>;
214
222
  function __promisify__<T>(value: T): Promise<T>;
215
223
  }
216
- declare function clearImmediate(immediateId: any): void;
224
+ declare function clearImmediate(immediateId: NodeJS.Immediate): void;
217
225
 
218
226
  // TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version.
219
227
  interface NodeRequireFunction {
@@ -486,6 +494,7 @@ declare namespace NodeJS {
486
494
  maxArrayLength?: number | null;
487
495
  breakLength?: number;
488
496
  compact?: boolean;
497
+ sorted?: boolean | ((a: string, b: string) => number);
489
498
  }
490
499
 
491
500
  interface ConsoleConstructor {
@@ -684,6 +693,8 @@ declare namespace NodeJS {
684
693
  "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
685
694
  "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
686
695
 
696
+ type MultipleResolveType = 'resolve' | 'reject';
697
+
687
698
  type BeforeExitListener = (code: number) => void;
688
699
  type DisconnectListener = () => void;
689
700
  type ExitListener = (code: number) => void;
@@ -695,6 +706,7 @@ declare namespace NodeJS {
695
706
  type SignalsListener = (signal: Signals) => void;
696
707
  type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
697
708
  type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
709
+ type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
698
710
 
699
711
  interface Socket extends ReadWriteStream {
700
712
  isTTY?: true;
@@ -811,8 +823,7 @@ declare namespace NodeJS {
811
823
  * read-only `Set` of flags allowable within the [`NODE_OPTIONS`][]
812
824
  * environment variable.
813
825
  */
814
- // TODO: This Set is readonly
815
- allowedNodeEnvironmentFlags: Set<string>;
826
+ allowedNodeEnvironmentFlags: ReadonlySet<string>;
816
827
 
817
828
  /**
818
829
  * EventEmitter
@@ -839,6 +850,7 @@ declare namespace NodeJS {
839
850
  addListener(event: Signals, listener: SignalsListener): this;
840
851
  addListener(event: "newListener", listener: NewListenerListener): this;
841
852
  addListener(event: "removeListener", listener: RemoveListenerListener): this;
853
+ addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
842
854
 
843
855
  emit(event: "beforeExit", code: number): boolean;
844
856
  emit(event: "disconnect"): boolean;
@@ -851,6 +863,7 @@ declare namespace NodeJS {
851
863
  emit(event: Signals, signal: Signals): boolean;
852
864
  emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this;
853
865
  emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this;
866
+ emit(event: "multipleResolves", listener: MultipleResolveListener): this;
854
867
 
855
868
  on(event: "beforeExit", listener: BeforeExitListener): this;
856
869
  on(event: "disconnect", listener: DisconnectListener): this;
@@ -863,6 +876,7 @@ declare namespace NodeJS {
863
876
  on(event: Signals, listener: SignalsListener): this;
864
877
  on(event: "newListener", listener: NewListenerListener): this;
865
878
  on(event: "removeListener", listener: RemoveListenerListener): this;
879
+ on(event: "multipleResolves", listener: MultipleResolveListener): this;
866
880
 
867
881
  once(event: "beforeExit", listener: BeforeExitListener): this;
868
882
  once(event: "disconnect", listener: DisconnectListener): this;
@@ -875,6 +889,7 @@ declare namespace NodeJS {
875
889
  once(event: Signals, listener: SignalsListener): this;
876
890
  once(event: "newListener", listener: NewListenerListener): this;
877
891
  once(event: "removeListener", listener: RemoveListenerListener): this;
892
+ once(event: "multipleResolves", listener: MultipleResolveListener): this;
878
893
 
879
894
  prependListener(event: "beforeExit", listener: BeforeExitListener): this;
880
895
  prependListener(event: "disconnect", listener: DisconnectListener): this;
@@ -887,6 +902,7 @@ declare namespace NodeJS {
887
902
  prependListener(event: Signals, listener: SignalsListener): this;
888
903
  prependListener(event: "newListener", listener: NewListenerListener): this;
889
904
  prependListener(event: "removeListener", listener: RemoveListenerListener): this;
905
+ prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
890
906
 
891
907
  prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this;
892
908
  prependOnceListener(event: "disconnect", listener: DisconnectListener): this;
@@ -899,6 +915,7 @@ declare namespace NodeJS {
899
915
  prependOnceListener(event: Signals, listener: SignalsListener): this;
900
916
  prependOnceListener(event: "newListener", listener: NewListenerListener): this;
901
917
  prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this;
918
+ prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
902
919
 
903
920
  listeners(event: "beforeExit"): BeforeExitListener[];
904
921
  listeners(event: "disconnect"): DisconnectListener[];
@@ -911,6 +928,7 @@ declare namespace NodeJS {
911
928
  listeners(event: Signals): SignalsListener[];
912
929
  listeners(event: "newListener"): NewListenerListener[];
913
930
  listeners(event: "removeListener"): RemoveListenerListener[];
931
+ listeners(event: "multipleResolves"): MultipleResolveListener[];
914
932
  }
915
933
 
916
934
  interface Global {
@@ -953,9 +971,9 @@ declare namespace NodeJS {
953
971
  Uint8ClampedArray: Function;
954
972
  WeakMap: WeakMapConstructor;
955
973
  WeakSet: WeakSetConstructor;
956
- clearImmediate: (immediateId: any) => void;
957
- clearInterval: (intervalId: Timer) => void;
958
- clearTimeout: (timeoutId: Timer) => void;
974
+ clearImmediate: (immediateId: Immediate) => void;
975
+ clearInterval: (intervalId: Timeout) => void;
976
+ clearTimeout: (timeoutId: Timeout) => void;
959
977
  console: typeof console;
960
978
  decodeURI: typeof decodeURI;
961
979
  decodeURIComponent: typeof decodeURIComponent;
@@ -970,9 +988,9 @@ declare namespace NodeJS {
970
988
  parseInt: typeof parseInt;
971
989
  process: Process;
972
990
  root: Global;
973
- setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any;
974
- setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timer;
975
- setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timer;
991
+ setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => Immediate;
992
+ setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
993
+ setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
976
994
  undefined: typeof undefined;
977
995
  unescape: (str: string) => string;
978
996
  gc: () => void;
@@ -980,13 +998,27 @@ declare namespace NodeJS {
980
998
  }
981
999
 
982
1000
  interface Timer {
1001
+ ref(): void;
1002
+ refresh(): void;
1003
+ unref(): void;
1004
+ }
1005
+
1006
+ class Immediate {
983
1007
  ref(): void;
984
1008
  unref(): void;
1009
+ _onImmediate: Function; // to distinguish it from the Timeout class
1010
+ }
1011
+
1012
+ class Timeout implements Timer {
1013
+ ref(): void;
1014
+ refresh(): void;
1015
+ unref(): void;
985
1016
  }
986
1017
 
987
1018
  class Module {
988
1019
  static runMain(): void;
989
1020
  static wrap(code: string): string;
1021
+ static createRequireFromPath(path: string): (path: string) => any;
990
1022
  static builtinModules: string[];
991
1023
 
992
1024
  static Module: typeof Module;
@@ -2599,6 +2631,20 @@ declare module "url" {
2599
2631
  function domainToASCII(domain: string): string;
2600
2632
  function domainToUnicode(domain: string): string;
2601
2633
 
2634
+ /**
2635
+ * This function ensures the correct decodings of percent-encoded characters as
2636
+ * well as ensuring a cross-platform valid absolute path string.
2637
+ * @param url The file URL string or URL object to convert to a path.
2638
+ */
2639
+ function fileURLToPath(url: string | URL): string;
2640
+
2641
+ /**
2642
+ * This function ensures that path is resolved absolutely, and that the URL
2643
+ * control characters are correctly encoded when converting into a File URL.
2644
+ * @param url The path to convert to a File URL.
2645
+ */
2646
+ function pathToFileURL(url: string): URL;
2647
+
2602
2648
  interface URLFormatOptions {
2603
2649
  auth?: boolean;
2604
2650
  fragment?: boolean;
@@ -3975,12 +4021,25 @@ declare module "fs" {
3975
4021
  */
3976
4022
  function rmdirSync(path: PathLike): void;
3977
4023
 
4024
+ export interface MakeDirectoryOptions {
4025
+ /**
4026
+ * Indicates whether parent folders should be created.
4027
+ * @default false
4028
+ */
4029
+ recursive?: boolean;
4030
+ /**
4031
+ * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
4032
+ * @default 0o777.
4033
+ */
4034
+ mode?: number;
4035
+ }
4036
+
3978
4037
  /**
3979
4038
  * Asynchronous mkdir(2) - create a directory.
3980
4039
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3981
4040
  * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
3982
4041
  */
3983
- function mkdir(path: PathLike, mode: number | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
4042
+ function mkdir(path: PathLike, mode: number | string | MakeDirectoryOptions | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
3984
4043
 
3985
4044
  /**
3986
4045
  * Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
@@ -3995,7 +4054,7 @@ declare module "fs" {
3995
4054
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3996
4055
  * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
3997
4056
  */
3998
- function __promisify__(path: PathLike, mode?: number | string | null): Promise<void>;
4057
+ function __promisify__(path: PathLike, mode?: number | string | MakeDirectoryOptions | null): Promise<void>;
3999
4058
  }
4000
4059
 
4001
4060
  /**
@@ -4003,7 +4062,7 @@ declare module "fs" {
4003
4062
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
4004
4063
  * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
4005
4064
  */
4006
- function mkdirSync(path: PathLike, mode?: number | string | null): void;
4065
+ function mkdirSync(path: PathLike, mode?: number | string | MakeDirectoryOptions | null): void;
4007
4066
 
4008
4067
  /**
4009
4068
  * Asynchronously creates a unique temporary directory.
@@ -6330,6 +6389,88 @@ declare module "crypto" {
6330
6389
  function timingSafeEqual(a: Buffer | NodeJS.TypedArray | DataView, b: Buffer | NodeJS.TypedArray | DataView): boolean;
6331
6390
  /** @deprecated since v10.0.0 */
6332
6391
  const DEFAULT_ENCODING: string;
6392
+
6393
+ export type KeyType = 'rsa' | 'dsa' | 'ec';
6394
+ export type KeyFormat = 'pem' | 'der';
6395
+
6396
+ interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
6397
+ format: T;
6398
+ cipher: string;
6399
+ passphrase: string;
6400
+ }
6401
+
6402
+ interface RSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
6403
+ /**
6404
+ * Key size in bits
6405
+ */
6406
+ modulusLength: number;
6407
+ /**
6408
+ * @default 0x10001
6409
+ */
6410
+ publicExponent?: number;
6411
+
6412
+ publicKeyEncoding: {
6413
+ type: 'pkcs1' | 'spki';
6414
+ format: PubF;
6415
+ };
6416
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
6417
+ type: 'pkcs1' | 'pkcs8';
6418
+ };
6419
+ }
6420
+
6421
+ interface DSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
6422
+ /**
6423
+ * Key size in bits
6424
+ */
6425
+ modulusLength: number;
6426
+ /**
6427
+ * Size of q in bits
6428
+ */
6429
+ divisorLength: number;
6430
+
6431
+ publicKeyEncoding: {
6432
+ type: 'spki';
6433
+ format: PubF;
6434
+ };
6435
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
6436
+ type: 'pkcs8';
6437
+ };
6438
+ }
6439
+
6440
+ interface ECKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
6441
+ /**
6442
+ * Name of the curve to use.
6443
+ */
6444
+ namedCurve: string;
6445
+
6446
+ publicKeyEncoding: {
6447
+ type: 'pkcs1' | 'spki';
6448
+ format: PubF;
6449
+ };
6450
+ privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
6451
+ type: 'sec1' | 'pkcs8';
6452
+ };
6453
+ }
6454
+
6455
+ interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
6456
+ publicKey: T1;
6457
+ privateKey: T2;
6458
+ }
6459
+
6460
+ function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
6461
+ function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
6462
+ function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
6463
+ function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
6464
+
6465
+ function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
6466
+ function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
6467
+ function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
6468
+ function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
6469
+
6470
+ function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
6471
+ function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
6472
+ function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
6473
+ function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
6333
6474
  }
6334
6475
 
6335
6476
  declare module "stream" {
@@ -7205,20 +7346,20 @@ declare module "v8" {
7205
7346
  }
7206
7347
 
7207
7348
  declare module "timers" {
7208
- function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
7349
+ function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
7209
7350
  namespace setTimeout {
7210
7351
  function __promisify__(ms: number): Promise<void>;
7211
7352
  function __promisify__<T>(ms: number, value: T): Promise<T>;
7212
7353
  }
7213
- function clearTimeout(timeoutId: NodeJS.Timer): void;
7214
- function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
7215
- function clearInterval(intervalId: NodeJS.Timer): void;
7216
- function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
7354
+ function clearTimeout(timeoutId: NodeJS.Timeout): void;
7355
+ function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
7356
+ function clearInterval(intervalId: NodeJS.Timeout): void;
7357
+ function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
7217
7358
  namespace setImmediate {
7218
7359
  function __promisify__(): Promise<void>;
7219
7360
  function __promisify__<T>(value: T): Promise<T>;
7220
7361
  }
7221
- function clearImmediate(immediateId: any): void;
7362
+ function clearImmediate(immediateId: NodeJS.Immediate): void;
7222
7363
  }
7223
7364
 
7224
7365
  declare module "console" {
@@ -7646,6 +7787,7 @@ declare module "http2" {
7646
7787
  addListener(event: "localSettings", listener: (settings: Settings) => void): this;
7647
7788
  addListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
7648
7789
  addListener(event: "timeout", listener: () => void): this;
7790
+ addListener(event: "ping", listener: () => void): this;
7649
7791
 
7650
7792
  emit(event: string | symbol, ...args: any[]): boolean;
7651
7793
  emit(event: "close"): boolean;
@@ -7655,6 +7797,7 @@ declare module "http2" {
7655
7797
  emit(event: "localSettings", settings: Settings): boolean;
7656
7798
  emit(event: "remoteSettings", settings: Settings): boolean;
7657
7799
  emit(event: "timeout"): boolean;
7800
+ emit(event: "ping"): boolean;
7658
7801
 
7659
7802
  on(event: string, listener: (...args: any[]) => void): this;
7660
7803
  on(event: "close", listener: () => void): this;
@@ -7664,6 +7807,7 @@ declare module "http2" {
7664
7807
  on(event: "localSettings", listener: (settings: Settings) => void): this;
7665
7808
  on(event: "remoteSettings", listener: (settings: Settings) => void): this;
7666
7809
  on(event: "timeout", listener: () => void): this;
7810
+ on(event: "ping", listener: () => void): this;
7667
7811
 
7668
7812
  once(event: string, listener: (...args: any[]) => void): this;
7669
7813
  once(event: "close", listener: () => void): this;
@@ -7673,6 +7817,7 @@ declare module "http2" {
7673
7817
  once(event: "localSettings", listener: (settings: Settings) => void): this;
7674
7818
  once(event: "remoteSettings", listener: (settings: Settings) => void): this;
7675
7819
  once(event: "timeout", listener: () => void): this;
7820
+ once(event: "ping", listener: () => void): this;
7676
7821
 
7677
7822
  prependListener(event: string, listener: (...args: any[]) => void): this;
7678
7823
  prependListener(event: "close", listener: () => void): this;
@@ -7682,6 +7827,7 @@ declare module "http2" {
7682
7827
  prependListener(event: "localSettings", listener: (settings: Settings) => void): this;
7683
7828
  prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
7684
7829
  prependListener(event: "timeout", listener: () => void): this;
7830
+ prependListener(event: "ping", listener: () => void): this;
7685
7831
 
7686
7832
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
7687
7833
  prependOnceListener(event: "close", listener: () => void): this;
@@ -7691,6 +7837,7 @@ declare module "http2" {
7691
7837
  prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this;
7692
7838
  prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
7693
7839
  prependOnceListener(event: "timeout", listener: () => void): this;
7840
+ prependOnceListener(event: "ping", listener: () => void): this;
7694
7841
  }
7695
7842
 
7696
7843
  export interface ClientHttp2Session extends Http2Session {
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "10.11.5",
3
+ "version": "10.12.1",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -153,15 +153,21 @@
153
153
  "name": "Zane Hannan AU",
154
154
  "url": "https://github.com/ZaneHannanAU",
155
155
  "githubUsername": "ZaneHannanAU"
156
+ },
157
+ {
158
+ "name": "Jeremie Rodriguez",
159
+ "url": "https://github.com/jeremiergz",
160
+ "githubUsername": "jeremiergz"
156
161
  }
157
162
  ],
158
163
  "main": "",
164
+ "types": "",
159
165
  "repository": {
160
166
  "type": "git",
161
167
  "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
162
168
  },
163
169
  "scripts": {},
164
170
  "dependencies": {},
165
- "typesPublisherContentHash": "a23a6d7469ad545180ad4a6722d31b22683d1443ed4e0e03dd9c72d3936475a8",
171
+ "typesPublisherContentHash": "f104ca149a69ee16995ff2743e4dee753e9b01f745d576961305e804def6b9d3",
166
172
  "typeScriptVersion": "2.0"
167
173
  }