@types/node 12.11.7 → 12.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 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: Thu, 24 Oct 2019 17:31:23 GMT
11
+ * Last updated: Wed, 30 Oct 2019 16:11:55 GMT
12
12
  * Dependencies: none
13
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>, 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>, Samuel Ainsworth <https://github.com/samuela>, Kyle Uehlein <https://github.com/kuehlein>, Jordi Oliveras Rovira <https://github.com/j-oliveras>, Thanik Bhongbhibhat <https://github.com/bhongy>, Marcin Kopacz <https://github.com/chyzwar>, Trivikram Kamat <https://github.com/trivikr>, and Minh Son Nguyen <https://github.com/nguymin4>.
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>, Mohsen Azimi <https://github.com/mohsen1>, Nicolas Even <https://github.com/n-e>, Nicolas Voigt <https://github.com/octo-sniffle>, Nikita Galkin <https://github.com/galkin>, 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>, Samuel Ainsworth <https://github.com/samuela>, Kyle Uehlein <https://github.com/kuehlein>, Jordi Oliveras Rovira <https://github.com/j-oliveras>, Thanik Bhongbhibhat <https://github.com/bhongy>, Marcin Kopacz <https://github.com/chyzwar>, Trivikram Kamat <https://github.com/trivikr>, and Minh Son Nguyen <https://github.com/nguymin4>.
node/constants.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
1
2
  declare module "constants" {
2
3
  const E2BIG: number;
3
4
  const EACCES: number;
@@ -133,15 +134,25 @@ declare module "constants" {
133
134
  const WSA_E_NO_MORE: number;
134
135
  const WSA_E_CANCELLED: number;
135
136
  const WSAEREFUSED: number;
137
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGHUP` instead. */
136
138
  const SIGHUP: number;
139
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGINT` instead. */
137
140
  const SIGINT: number;
141
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGILL` instead. */
138
142
  const SIGILL: number;
143
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGABRT` instead. */
139
144
  const SIGABRT: number;
145
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGFPE` instead. */
140
146
  const SIGFPE: number;
147
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGKILL` instead. */
141
148
  const SIGKILL: number;
149
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGSEGV` instead. */
142
150
  const SIGSEGV: number;
151
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGTERM` instead. */
143
152
  const SIGTERM: number;
153
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGBREAK` instead. */
144
154
  const SIGBREAK: number;
155
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGWINCH` instead. */
145
156
  const SIGWINCH: number;
146
157
  const SSL_OP_ALL: number;
147
158
  const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
@@ -246,30 +257,55 @@ declare module "constants" {
246
257
  const COPYFILE_FICLONE: number;
247
258
  const COPYFILE_FICLONE_FORCE: number;
248
259
  const UV_UDP_REUSEADDR: number;
260
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGQUIT` instead. */
249
261
  const SIGQUIT: number;
262
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGTRAP` instead. */
250
263
  const SIGTRAP: number;
264
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGIOT` instead. */
251
265
  const SIGIOT: number;
266
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGBUS` instead. */
252
267
  const SIGBUS: number;
268
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGUSR1` instead. */
253
269
  const SIGUSR1: number;
270
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGUSR2` instead. */
254
271
  const SIGUSR2: number;
272
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGPIPE` instead. */
255
273
  const SIGPIPE: number;
274
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGALRM` instead. */
256
275
  const SIGALRM: number;
276
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGCHLD` instead. */
257
277
  const SIGCHLD: number;
278
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGSTKFLT` instead. */
258
279
  const SIGSTKFLT: number;
280
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGCONT` instead. */
259
281
  const SIGCONT: number;
282
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGSTOP` instead. */
260
283
  const SIGSTOP: number;
284
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGTSTP` instead. */
261
285
  const SIGTSTP: number;
286
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGTTIN` instead. */
262
287
  const SIGTTIN: number;
288
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGTTOU` instead. */
263
289
  const SIGTTOU: number;
290
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGURG` instead. */
264
291
  const SIGURG: number;
292
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGXCPU` instead. */
265
293
  const SIGXCPU: number;
294
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGXFSZ` instead. */
266
295
  const SIGXFSZ: number;
296
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGVTALRM` instead. */
267
297
  const SIGVTALRM: number;
298
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGPROF` instead. */
268
299
  const SIGPROF: number;
300
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGIO` instead. */
269
301
  const SIGIO: number;
302
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGPOLL` instead. */
270
303
  const SIGPOLL: number;
304
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGPWR` instead. */
271
305
  const SIGPWR: number;
306
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGSYS` instead. */
272
307
  const SIGSYS: number;
308
+ /** @deprecated since v6.3.0 - use `os.constants.signals.SIGUNUSED` instead. */
273
309
  const SIGUNUSED: number;
274
310
  const defaultCoreCipherList: string;
275
311
  const defaultCipherList: string;
node/crypto.d.ts CHANGED
@@ -141,7 +141,7 @@ declare module "crypto" {
141
141
  digest(encoding: HexBase64Latin1Encoding): string;
142
142
  }
143
143
 
144
- export type KeyObjectType = 'secret' | 'public' | 'private';
144
+ type KeyObjectType = 'secret' | 'public' | 'private';
145
145
 
146
146
  interface KeyExportOptions<T extends KeyFormat> {
147
147
  type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1';
@@ -430,8 +430,8 @@ declare module "crypto" {
430
430
  /** @deprecated since v10.0.0 */
431
431
  const DEFAULT_ENCODING: string;
432
432
 
433
- export type KeyType = 'rsa' | 'dsa' | 'ec';
434
- export type KeyFormat = 'pem' | 'der';
433
+ type KeyType = 'rsa' | 'dsa' | 'ec';
434
+ type KeyFormat = 'pem' | 'der';
435
435
 
436
436
  interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
437
437
  format: T;
node/fs.d.ts CHANGED
@@ -56,6 +56,46 @@ declare module "fs" {
56
56
  name: string;
57
57
  }
58
58
 
59
+ /**
60
+ * A class representing a directory stream.
61
+ */
62
+ class Dir {
63
+ readonly path: string;
64
+
65
+ /**
66
+ * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read.
67
+ */
68
+ [Symbol.asyncIterator](): AsyncIterableIterator<Dirent>;
69
+
70
+ /**
71
+ * Asynchronously close the directory's underlying resource handle.
72
+ * Subsequent reads will result in errors.
73
+ */
74
+ close(): Promise<void>;
75
+ close(cb: NoParamCallback): void;
76
+
77
+ /**
78
+ * Synchronously close the directory's underlying resource handle.
79
+ * Subsequent reads will result in errors.
80
+ */
81
+ closeSync(): void;
82
+
83
+ /**
84
+ * Asynchronously read the next directory entry via `readdir(3)` as an `Dirent`.
85
+ * After the read is completed, a value is returned that will be resolved with an `Dirent`, or `null` if there are no more directory entries to read.
86
+ * Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms.
87
+ */
88
+ read(): Promise<Dirent | null>;
89
+ read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void;
90
+
91
+ /**
92
+ * Synchronously read the next directory entry via `readdir(3)` as a `Dirent`.
93
+ * If there are no more directory entries to read, null will be returned.
94
+ * Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms.
95
+ */
96
+ readSync(): Dirent;
97
+ }
98
+
59
99
  interface FSWatcher extends events.EventEmitter {
60
100
  close(): void;
61
101
 
@@ -450,7 +490,7 @@ declare module "fs" {
450
490
  * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
451
491
  * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
452
492
  */
453
- function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
493
+ function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
454
494
  }
455
495
 
456
496
  /**
@@ -739,7 +779,7 @@ declare module "fs" {
739
779
  */
740
780
  function rmdirSync(path: PathLike, options?: RmDirOptions): void;
741
781
 
742
- export interface MakeDirectoryOptions {
782
+ interface MakeDirectoryOptions {
743
783
  /**
744
784
  * Indicates whether parent folders should be created.
745
785
  * @default false
@@ -1888,6 +1928,19 @@ declare module "fs" {
1888
1928
  */
1889
1929
  function writevSync(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): number;
1890
1930
 
1931
+ interface OpenDirOptions {
1932
+ encoding?: BufferEncoding;
1933
+ }
1934
+
1935
+ function opendirSync(path: string, options?: OpenDirOptions): Dirent;
1936
+
1937
+ function opendir(path: string, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
1938
+ function opendir(path: string, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
1939
+
1940
+ namespace opendir {
1941
+ function __promisify__(path: string, options?: OpenDirOptions): Promise<Dir>;
1942
+ }
1943
+
1891
1944
  namespace promises {
1892
1945
  interface FileHandle {
1893
1946
  /**
@@ -2387,5 +2440,7 @@ declare module "fs" {
2387
2440
  * If a flag is not provided, it defaults to `'r'`.
2388
2441
  */
2389
2442
  function readFile(path: PathLike | FileHandle, options?: { encoding?: string | null, flag?: string | number } | string | null): Promise<string | Buffer>;
2443
+
2444
+ function opendir(path: string, options?: OpenDirOptions): Promise<Dirent>;
2390
2445
  }
2391
2446
  }
node/http2.d.ts CHANGED
@@ -49,19 +49,17 @@ declare module "http2" {
49
49
  }
50
50
 
51
51
  export interface ServerStreamFileResponseOptions {
52
- statCheck?: (stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void | boolean;
52
+ statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean;
53
53
  waitForTrailers?: boolean;
54
54
  offset?: number;
55
55
  length?: number;
56
56
  }
57
57
 
58
58
  export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
59
- onError?: (err: NodeJS.ErrnoException) => void;
59
+ onError?(err: NodeJS.ErrnoException): void;
60
60
  }
61
61
 
62
- export class Http2Stream extends stream.Duplex {
63
- protected constructor();
64
-
62
+ export interface Http2Stream extends stream.Duplex {
65
63
  readonly aborted: boolean;
66
64
  readonly bufferSize: number;
67
65
  readonly closed: boolean;
@@ -182,9 +180,7 @@ declare module "http2" {
182
180
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
183
181
  }
184
182
 
185
- export class ClientHttp2Stream extends Http2Stream {
186
- private constructor();
187
-
183
+ export interface ClientHttp2Stream extends Http2Stream {
188
184
  addListener(event: "continue", listener: () => {}): this;
189
185
  addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
190
186
  addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
@@ -222,16 +218,14 @@ declare module "http2" {
222
218
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
223
219
  }
224
220
 
225
- export class ServerHttp2Stream extends Http2Stream {
226
- private constructor();
227
-
228
- additionalHeaders(headers: OutgoingHttpHeaders): void;
221
+ export interface ServerHttp2Stream extends Http2Stream {
229
222
  readonly headersSent: boolean;
230
223
  readonly pushAllowed: boolean;
224
+ additionalHeaders(headers: OutgoingHttpHeaders): void;
231
225
  pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
232
226
  pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
233
227
  respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void;
234
- respondWithFD(fd: number, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void;
228
+ respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void;
235
229
  respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void;
236
230
  }
237
231
 
@@ -267,29 +261,28 @@ declare module "http2" {
267
261
  inflateDynamicTableSize?: number;
268
262
  }
269
263
 
270
- export class Http2Session extends events.EventEmitter {
271
- protected constructor();
272
-
264
+ export interface Http2Session extends events.EventEmitter {
273
265
  readonly alpnProtocol?: string;
274
- close(callback?: () => void): void;
275
266
  readonly closed: boolean;
276
267
  readonly connecting: boolean;
277
- destroy(error?: Error, code?: number): void;
278
268
  readonly destroyed: boolean;
279
269
  readonly encrypted?: boolean;
280
- goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void;
281
270
  readonly localSettings: Settings;
282
271
  readonly originSet?: string[];
283
272
  readonly pendingSettingsAck: boolean;
273
+ readonly remoteSettings: Settings;
274
+ readonly socket: net.Socket | tls.TLSSocket;
275
+ readonly state: SessionState;
276
+ readonly type: number;
277
+
278
+ close(callback?: () => void): void;
279
+ destroy(error?: Error, code?: number): void;
280
+ goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void;
284
281
  ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
285
282
  ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
286
283
  ref(): void;
287
- readonly remoteSettings: Settings;
288
284
  setTimeout(msecs: number, callback?: () => void): void;
289
- readonly socket: net.Socket | tls.TLSSocket;
290
- readonly state: SessionState;
291
285
  settings(settings: Settings): void;
292
- readonly type: number;
293
286
  unref(): void;
294
287
 
295
288
  addListener(event: "close", listener: () => void): this;
@@ -353,9 +346,7 @@ declare module "http2" {
353
346
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
354
347
  }
355
348
 
356
- export class ClientHttp2Session extends Http2Session {
357
- private constructor();
358
-
349
+ export interface ClientHttp2Session extends Http2Session {
359
350
  request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
360
351
 
361
352
  addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
@@ -399,12 +390,11 @@ declare module "http2" {
399
390
  origin: number | string | url.URL;
400
391
  }
401
392
 
402
- export class ServerHttp2Session extends Http2Session {
403
- private constructor();
393
+ export interface ServerHttp2Session extends Http2Session {
394
+ readonly server: Http2Server | Http2SecureServer;
404
395
 
405
396
  altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void;
406
397
  origin(...args: Array<string | url.URL | { origin: string }>): void;
407
- readonly server: Http2Server | Http2SecureServer;
408
398
 
409
399
  addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
410
400
  addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
@@ -441,9 +431,10 @@ declare module "http2" {
441
431
  maxSendHeaderBlockLength?: number;
442
432
  paddingStrategy?: number;
443
433
  peerMaxConcurrentStreams?: number;
444
- selectPadding?: (frameLen: number, maxFrameLen: number) => number;
445
434
  settings?: Settings;
446
- createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex;
435
+
436
+ selectPadding?(frameLen: number, maxFrameLen: number): number;
437
+ createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex;
447
438
  }
448
439
 
449
440
  export interface ClientSessionOptions extends SessionOptions {
@@ -468,9 +459,7 @@ declare module "http2" {
468
459
  origins?: string[];
469
460
  }
470
461
 
471
- export class Http2Server extends net.Server {
472
- private constructor();
473
-
462
+ export interface Http2Server extends net.Server {
474
463
  addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
475
464
  addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
476
465
  addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
@@ -522,9 +511,7 @@ declare module "http2" {
522
511
  setTimeout(msec?: number, callback?: () => void): this;
523
512
  }
524
513
 
525
- export class Http2SecureServer extends tls.Server {
526
- private constructor();
527
-
514
+ export interface Http2SecureServer extends tls.Server {
528
515
  addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
529
516
  addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
530
517
  addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
@@ -593,12 +580,12 @@ declare module "http2" {
593
580
  readonly rawHeaders: string[];
594
581
  readonly rawTrailers: string[];
595
582
  readonly scheme: string;
596
- setTimeout(msecs: number, callback?: () => void): void;
597
583
  readonly socket: net.Socket | tls.TLSSocket;
598
584
  readonly stream: ServerHttp2Stream;
599
585
  readonly trailers: IncomingHttpHeaders;
600
586
  readonly url: string;
601
587
 
588
+ setTimeout(msecs: number, callback?: () => void): void;
602
589
  read(size?: number): Buffer | string | null;
603
590
 
604
591
  addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
@@ -653,25 +640,25 @@ declare module "http2" {
653
640
  export class Http2ServerResponse extends stream.Stream {
654
641
  constructor(stream: ServerHttp2Stream);
655
642
 
656
- addTrailers(trailers: OutgoingHttpHeaders): void;
657
643
  readonly connection: net.Socket | tls.TLSSocket;
644
+ readonly finished: boolean;
645
+ readonly headersSent: boolean;
646
+ readonly socket: net.Socket | tls.TLSSocket;
647
+ readonly stream: ServerHttp2Stream;
648
+ sendDate: boolean;
649
+ statusCode: number;
650
+ statusMessage: '';
651
+ addTrailers(trailers: OutgoingHttpHeaders): void;
658
652
  end(callback?: () => void): void;
659
653
  end(data: string | Uint8Array, callback?: () => void): void;
660
654
  end(data: string | Uint8Array, encoding: string, callback?: () => void): void;
661
- readonly finished: boolean;
662
655
  getHeader(name: string): string;
663
656
  getHeaderNames(): string[];
664
657
  getHeaders(): OutgoingHttpHeaders;
665
658
  hasHeader(name: string): boolean;
666
- readonly headersSent: boolean;
667
659
  removeHeader(name: string): void;
668
- sendDate: boolean;
669
660
  setHeader(name: string, value: number | string | string[]): void;
670
661
  setTimeout(msecs: number, callback?: () => void): void;
671
- readonly socket: net.Socket | tls.TLSSocket;
672
- statusCode: number;
673
- statusMessage: '';
674
- readonly stream: ServerHttp2Stream;
675
662
  write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean;
676
663
  write(chunk: string | Uint8Array, encoding: string, callback?: (err: Error) => void): boolean;
677
664
  writeContinue(): void;
@@ -951,10 +938,10 @@ declare module "http2" {
951
938
  export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
952
939
  export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
953
940
 
954
- export function connect(authority: string | url.URL, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session;
941
+ export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session;
955
942
  export function connect(
956
943
  authority: string | url.URL,
957
944
  options?: ClientSessionOptions | SecureClientSessionOptions,
958
- listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
945
+ listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void
959
946
  ): ClientHttp2Session;
960
947
  }
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 12.11
1
+ // Type definitions for non-npm package Node.js 12.12
2
2
  // Project: http://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
@@ -24,6 +24,7 @@
24
24
  // Mohsen Azimi <https://github.com/mohsen1>
25
25
  // Nicolas Even <https://github.com/n-e>
26
26
  // Nicolas Voigt <https://github.com/octo-sniffle>
27
+ // Nikita Galkin <https://github.com/galkin>
27
28
  // Parambir Singh <https://github.com/parambirs>
28
29
  // Sebastian Silbermann <https://github.com/eps1lon>
29
30
  // Simon Schick <https://github.com/SimonSchick>
node/os.d.ts CHANGED
@@ -52,6 +52,7 @@ declare module "os" {
52
52
  function userInfo(options?: { encoding: string }): UserInfo<string>;
53
53
  const constants: {
54
54
  UV_UDP_REUSEADDR: number;
55
+ // signals: { [key in NodeJS.Signals]: number; }; @todo: change after migration to typescript 2.1
55
56
  signals: {
56
57
  SIGHUP: number;
57
58
  SIGINT: number;
@@ -74,6 +75,7 @@ declare module "os" {
74
75
  SIGCONT: number;
75
76
  SIGSTOP: number;
76
77
  SIGTSTP: number;
78
+ SIGBREAK: number;
77
79
  SIGTTIN: number;
78
80
  SIGTTOU: number;
79
81
  SIGURG: number;
@@ -84,7 +86,9 @@ declare module "os" {
84
86
  SIGWINCH: number;
85
87
  SIGIO: number;
86
88
  SIGPOLL: number;
89
+ SIGLOST: number;
87
90
  SIGPWR: number;
91
+ SIGINFO: number;
88
92
  SIGSYS: number;
89
93
  SIGUNUSED: number;
90
94
  };
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "12.11.7",
3
+ "version": "12.12.3",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -124,6 +124,11 @@
124
124
  "url": "https://github.com/octo-sniffle",
125
125
  "githubUsername": "octo-sniffle"
126
126
  },
127
+ {
128
+ "name": "Nikita Galkin",
129
+ "url": "https://github.com/galkin",
130
+ "githubUsername": "galkin"
131
+ },
127
132
  {
128
133
  "name": "Parambir Singh",
129
134
  "url": "https://github.com/parambirs",
@@ -211,6 +216,6 @@
211
216
  },
212
217
  "scripts": {},
213
218
  "dependencies": {},
214
- "typesPublisherContentHash": "5350651f60ae87ecc962833dc4081a45275968603a64cdacfb1cc9efaebb2e36",
219
+ "typesPublisherContentHash": "817766d74d68d0a134a9edf5adefc2459451a8c287d4d1e2d310ad88a19871d8",
215
220
  "typeScriptVersion": "2.0"
216
221
  }
node/repl.d.ts CHANGED
@@ -353,13 +353,13 @@ declare module "repl" {
353
353
  /**
354
354
  * A flag passed in the REPL options. Evaluates expressions in sloppy mode.
355
355
  */
356
- export const REPL_MODE_SLOPPY: symbol; // TODO: unique symbol
356
+ const REPL_MODE_SLOPPY: symbol; // TODO: unique symbol
357
357
 
358
358
  /**
359
359
  * A flag passed in the REPL options. Evaluates expressions in strict mode.
360
360
  * This is equivalent to prefacing every repl statement with `'use strict'`.
361
361
  */
362
- export const REPL_MODE_STRICT: symbol; // TODO: unique symbol
362
+ const REPL_MODE_STRICT: symbol; // TODO: unique symbol
363
363
 
364
364
  /**
365
365
  * Creates and starts a `repl.REPLServer` instance.
node/stream.d.ts CHANGED
@@ -118,6 +118,7 @@ declare module "stream" {
118
118
 
119
119
  class Writable extends Stream implements NodeJS.WritableStream {
120
120
  readonly writable: boolean;
121
+ readonly writableEnded: boolean;
121
122
  readonly writableFinished: boolean;
122
123
  readonly writableHighWaterMark: number;
123
124
  readonly writableLength: number;
@@ -219,6 +220,7 @@ declare module "stream" {
219
220
  // Note: Duplex extends both Readable and Writable.
220
221
  class Duplex extends Readable implements Writable {
221
222
  readonly writable: boolean;
223
+ readonly writableEnded: boolean;
222
224
  readonly writableFinished: boolean;
223
225
  readonly writableHighWaterMark: number;
224
226
  readonly writableLength: number;
node/tls.d.ts CHANGED
@@ -64,7 +64,7 @@ declare module "tls" {
64
64
  version: string;
65
65
  }
66
66
 
67
- export interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
67
+ interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
68
68
  /**
69
69
  * If true the TLS socket will be instantiated in server-mode.
70
70
  * Defaults to false.
node/trace_events.d.ts CHANGED
@@ -9,7 +9,7 @@ declare module "trace_events" {
9
9
  * event categories. Calling `tracing.disable()` will remove the categories
10
10
  * from the set of enabled trace event categories.
11
11
  */
12
- export interface Tracing {
12
+ interface Tracing {
13
13
  /**
14
14
  * A comma-separated list of the trace event categories covered by this
15
15
  * `Tracing` object.
@@ -49,7 +49,7 @@ declare module "trace_events" {
49
49
  /**
50
50
  * Creates and returns a Tracing object for the given set of categories.
51
51
  */
52
- export function createTracing(options: CreateTracingOptions): Tracing;
52
+ function createTracing(options: CreateTracingOptions): Tracing;
53
53
 
54
54
  /**
55
55
  * Returns a comma-separated list of all currently-enabled trace event
@@ -57,5 +57,5 @@ declare module "trace_events" {
57
57
  * determined by the union of all currently-enabled `Tracing` objects and
58
58
  * any categories enabled using the `--trace-event-categories` flag.
59
59
  */
60
- export function getEnabledCategories(): string;
60
+ function getEnabledCategories(): string | undefined;
61
61
  }