@types/node 9.4.5 → 9.6.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 (3) hide show
  1. node/README.md +2 -2
  2. node/index.d.ts +112 -59
  3. node/package.json +7 -2
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://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
9
9
 
10
10
  Additional Details
11
- * Last updated: Sat, 10 Feb 2018 21:44:46 GMT
11
+ * Last updated: Wed, 28 Mar 2018 20:38:28 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 <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>, Parambir Singh <https://github.com/parambirs>, Christian Vaagland Tellnes <https://github.com/tellnes>, Wilco Bakker <https://github.com/WilcoBakker>, Nicolas Voigt <https://github.com/octo-sniffle>, Chigozirim C. <https://github.com/smac89>, Flarna <https://github.com/Flarna>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, wwwy3y3 <https://github.com/wwwy3y3>, Deividas Bakanas <https://github.com/DeividasBakanas>, Kelvin Jin <https://github.com/kjin>, Alvis HT Tang <https://github.com/alvis>, Oliver Joseph Ash <https://github.com/OliverJAsh>, Sebastian Silbermann <https://github.com/eps1lon>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Alberto Schiabel <https://github.com/jkomyno>, Klaus Meinhardt <https://github.com/ajafff>, Huw <https://github.com/hoo29>.
16
+ These definitions were written by Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>, Parambir Singh <https://github.com/parambirs>, Christian Vaagland Tellnes <https://github.com/tellnes>, Wilco Bakker <https://github.com/WilcoBakker>, Nicolas Voigt <https://github.com/octo-sniffle>, Chigozirim C. <https://github.com/smac89>, Flarna <https://github.com/Flarna>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, wwwy3y3 <https://github.com/wwwy3y3>, Deividas Bakanas <https://github.com/DeividasBakanas>, Kelvin Jin <https://github.com/kjin>, Alvis HT Tang <https://github.com/alvis>, Oliver Joseph Ash <https://github.com/OliverJAsh>, Sebastian Silbermann <https://github.com/eps1lon>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Alberto Schiabel <https://github.com/jkomyno>, Klaus Meinhardt <https://github.com/ajafff>, Huw <https://github.com/hoo29>, Nicolas Even <https://github.com/n-e>.
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for Node.js 9.4.x
1
+ // Type definitions for Node.js 9.6.x
2
2
  // Project: http://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <http://typescriptlang.org>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
@@ -19,6 +19,7 @@
19
19
  // Alberto Schiabel <https://github.com/jkomyno>
20
20
  // Klaus Meinhardt <https://github.com/ajafff>
21
21
  // Huw <https://github.com/hoo29>
22
+ // Nicolas Even <https://github.com/n-e>
22
23
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
23
24
 
24
25
  /** inspector module types */
@@ -1746,7 +1747,7 @@ declare module "https" {
1746
1747
  import * as http from "http";
1747
1748
  import { URL } from "url";
1748
1749
 
1749
- export type ServerOptions = tls.SecureContextOptions & tls.TlsServerOptions;
1750
+ export type ServerOptions = tls.SecureContextOptions & tls.TlsOptions;
1750
1751
 
1751
1752
  export type RequestOptions = http.RequestOptions & {
1752
1753
  rejectUnauthorized?: boolean; // Defaults to true
@@ -1768,6 +1769,7 @@ declare module "https" {
1768
1769
 
1769
1770
  export class Agent extends http.Agent {
1770
1771
  constructor(options?: AgentOptions);
1772
+ options: AgentOptions;
1771
1773
  }
1772
1774
 
1773
1775
  export class Server extends tls.Server {
@@ -2104,6 +2106,7 @@ declare module "child_process" {
2104
2106
  killSignal?: string;
2105
2107
  uid?: number;
2106
2108
  gid?: number;
2109
+ windowsHide?: boolean;
2107
2110
  }
2108
2111
 
2109
2112
  export interface ExecOptionsWithStringEncoding extends ExecOptions {
@@ -2150,6 +2153,7 @@ declare module "child_process" {
2150
2153
  killSignal?: string;
2151
2154
  uid?: number;
2152
2155
  gid?: number;
2156
+ windowsHide?: boolean;
2153
2157
  windowsVerbatimArguments?: boolean;
2154
2158
  }
2155
2159
  export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
@@ -2233,6 +2237,7 @@ declare module "child_process" {
2233
2237
  maxBuffer?: number;
2234
2238
  encoding?: string;
2235
2239
  shell?: boolean | string;
2240
+ windowsHide?: boolean;
2236
2241
  windowsVerbatimArguments?: boolean;
2237
2242
  }
2238
2243
  export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
@@ -2270,6 +2275,7 @@ declare module "child_process" {
2270
2275
  killSignal?: string;
2271
2276
  maxBuffer?: number;
2272
2277
  encoding?: string;
2278
+ windowsHide?: boolean;
2273
2279
  }
2274
2280
  export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
2275
2281
  encoding: BufferEncoding;
@@ -2293,6 +2299,7 @@ declare module "child_process" {
2293
2299
  killSignal?: string;
2294
2300
  maxBuffer?: number;
2295
2301
  encoding?: string;
2302
+ windowsHide?: boolean;
2296
2303
  }
2297
2304
  export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
2298
2305
  encoding: BufferEncoding;
@@ -2354,6 +2361,9 @@ declare module "url" {
2354
2361
  export function format(urlObject: UrlObject | string): string;
2355
2362
  export function resolve(from: string, to: string): string;
2356
2363
 
2364
+ export function domainToASCII(domain: string): string;
2365
+ export function domainToUnicode(domain: string): string;
2366
+
2357
2367
  export interface URLFormatOptions {
2358
2368
  auth?: boolean;
2359
2369
  fragment?: boolean;
@@ -4895,6 +4905,14 @@ declare module "tls" {
4895
4905
  getPeerCertificate(detailed: true): DetailedPeerCertificate;
4896
4906
  getPeerCertificate(detailed?: false): PeerCertificate;
4897
4907
  getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate;
4908
+ /**
4909
+ * Returns a string containing the negotiated SSL/TLS protocol version of the current connection.
4910
+ * The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process.
4911
+ * The value `null` will be returned for server sockets or disconnected client sockets.
4912
+ * See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information.
4913
+ * @returns negotiated SSL/TLS protocol version of the current connection
4914
+ */
4915
+ getProtocol(): string | null;
4898
4916
  /**
4899
4917
  * Could be used to speed up handshake establishment when reconnecting to the server.
4900
4918
  * @returns ASN.1 encoded TLS session or undefined if none was negotiated.
@@ -4959,7 +4977,7 @@ declare module "tls" {
4959
4977
  prependOnceListener(event: "secureConnect", listener: () => void): this;
4960
4978
  }
4961
4979
 
4962
- export interface TlsServerOptions extends SecureContextOptions {
4980
+ export interface TlsOptions extends SecureContextOptions {
4963
4981
  clientCertEngine?: string;
4964
4982
  handshakeTimeout?: number;
4965
4983
  requestCert?: boolean;
@@ -5096,7 +5114,7 @@ declare module "tls" {
5096
5114
  * Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined.
5097
5115
  */
5098
5116
  export function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined;
5099
- export function createServer(options: TlsServerOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
5117
+ export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
5100
5118
  export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket;
5101
5119
  export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
5102
5120
  export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
@@ -5562,18 +5580,18 @@ declare module "util" {
5562
5580
  export function callbackify<T1, T2, T3, T4, T5, T6, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
5563
5581
 
5564
5582
  export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
5565
- export function promisify<TResult>(fn: (callback: (err: Error, result: TResult) => void) => void): () => Promise<TResult>;
5566
- export function promisify(fn: (callback: (err: Error) => void) => void): () => Promise<void>;
5567
- export function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: Error, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
5568
- export function promisify<T1>(fn: (arg1: T1, callback: (err: Error) => void) => void): (arg1: T1) => Promise<void>;
5569
- export function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: Error, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
5570
- export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err: Error) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
5571
- export function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
5572
- export function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
5573
- export function promisify<T1, T2, T3, T4, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
5574
- export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
5575
- export function promisify<T1, T2, T3, T4, T5, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
5576
- export function promisify<T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
5583
+ export function promisify<TResult>(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise<TResult>;
5584
+ export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise<void>;
5585
+ export function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
5586
+ export function promisify<T1>(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise<void>;
5587
+ export function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
5588
+ export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
5589
+ export function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
5590
+ export function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
5591
+ export function promisify<T1, T2, T3, T4, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
5592
+ export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
5593
+ export function promisify<T1, T2, T3, T4, T5, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
5594
+ export function promisify<T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
5577
5595
  export function promisify(fn: Function): Function;
5578
5596
  export namespace promisify {
5579
5597
  const custom: symbol;
@@ -5629,12 +5647,12 @@ declare module "tty" {
5629
5647
  import * as net from "net";
5630
5648
 
5631
5649
  export function isatty(fd: number): boolean;
5632
- export interface ReadStream extends net.Socket {
5650
+ export class ReadStream extends net.Socket {
5633
5651
  isRaw: boolean;
5634
5652
  setRawMode(mode: boolean): void;
5635
5653
  isTTY: boolean;
5636
5654
  }
5637
- export interface WriteStream extends net.Socket {
5655
+ export class WriteStream extends net.Socket {
5638
5656
  columns: number;
5639
5657
  rows: number;
5640
5658
  isTTY: boolean;
@@ -6067,6 +6085,23 @@ declare module "async_hooks" {
6067
6085
  */
6068
6086
  export function createHook(options: HookCallbacks): AsyncHook;
6069
6087
 
6088
+ export interface AsyncResourceOptions {
6089
+ /**
6090
+ * The ID of the execution context that created this async event.
6091
+ * Default: `executionAsyncId()`
6092
+ */
6093
+ triggerAsyncId?: number;
6094
+
6095
+ /**
6096
+ * Disables automatic `emitDestroy` when the object is garbage collected.
6097
+ * This usually does not need to be set (even if `emitDestroy` is called
6098
+ * manually), unless the resource's `asyncId` is retrieved and the
6099
+ * sensitive API's `emitDestroy` is called with it.
6100
+ * Default: `false`
6101
+ */
6102
+ requireManualDestroy?: boolean;
6103
+ }
6104
+
6070
6105
  /**
6071
6106
  * The class AsyncResource was designed to be extended by the embedder's async resources.
6072
6107
  * Using this users can easily trigger the lifetime events of their own resources.
@@ -6076,21 +6111,38 @@ declare module "async_hooks" {
6076
6111
  * AsyncResource() is meant to be extended. Instantiating a
6077
6112
  * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
6078
6113
  * async_hook.executionAsyncId() is used.
6079
- * @param type the name of this async resource type
6080
- * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
6114
+ * @param type The type of async event.
6115
+ * @param triggerAsyncId The ID of the execution context that created
6116
+ * this async event (default: `executionAsyncId()`), or an
6117
+ * AsyncResourceOptions object (since 9.3)
6081
6118
  */
6082
- constructor(type: string, triggerAsyncId?: number)
6119
+ constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
6083
6120
 
6084
6121
  /**
6085
6122
  * Call AsyncHooks before callbacks.
6123
+ * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead.
6086
6124
  */
6087
6125
  emitBefore(): void;
6088
6126
 
6089
6127
  /**
6090
- * Call AsyncHooks after callbacks
6128
+ * Call AsyncHooks after callbacks.
6129
+ * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead.
6091
6130
  */
6092
6131
  emitAfter(): void;
6093
6132
 
6133
+ /**
6134
+ * Call the provided function with the provided arguments in the
6135
+ * execution context of the async resource. This will establish the
6136
+ * context, trigger the AsyncHooks before callbacks, call the function,
6137
+ * trigger the AsyncHooks after callbacks, and then restore the original
6138
+ * execution context.
6139
+ * @param fn The function to call in the execution context of this
6140
+ * async resource.
6141
+ * @param thisArg The receiver to be used for the function call.
6142
+ * @param args Optional arguments to pass to the function.
6143
+ */
6144
+ runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
6145
+
6094
6146
  /**
6095
6147
  * Call AsyncHooks destroy callbacks.
6096
6148
  */
@@ -6160,15 +6212,12 @@ declare module "http2" {
6160
6212
 
6161
6213
  export interface Http2Stream extends stream.Duplex {
6162
6214
  readonly aborted: boolean;
6215
+ close(code: number, callback?: () => void): void;
6216
+ readonly closed: boolean;
6163
6217
  readonly destroyed: boolean;
6218
+ readonly pending: boolean;
6164
6219
  priority(options: StreamPriorityOptions): void;
6165
6220
  readonly rstCode: number;
6166
- rstStream(code: number): void;
6167
- rstWithNoError(): void;
6168
- rstWithProtocolError(): void;
6169
- rstWithCancel(): void;
6170
- rstWithRefuse(): void;
6171
- rstWithInternalError(): void;
6172
6221
  readonly session: Http2Session;
6173
6222
  setTimeout(msecs: number, callback?: () => void): void;
6174
6223
  readonly state: StreamState;
@@ -6300,8 +6349,8 @@ declare module "http2" {
6300
6349
  additionalHeaders(headers: OutgoingHttpHeaders): void;
6301
6350
  readonly headersSent: boolean;
6302
6351
  readonly pushAllowed: boolean;
6303
- pushStream(headers: OutgoingHttpHeaders, callback?: (pushStream: ServerHttp2Stream) => void): void;
6304
- pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (pushStream: ServerHttp2Stream) => void): void;
6352
+ pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
6353
+ pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
6305
6354
  respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void;
6306
6355
  respondWithFD(fd: number, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void;
6307
6356
  respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void;
@@ -6326,13 +6375,6 @@ declare module "http2" {
6326
6375
  getTrailers?: (trailers: OutgoingHttpHeaders, flags: number) => void;
6327
6376
  }
6328
6377
 
6329
- export interface SessionShutdownOptions {
6330
- graceful?: boolean;
6331
- errorCode?: number;
6332
- lastStreamID?: number;
6333
- opaqueData?: Buffer | Uint8Array;
6334
- }
6335
-
6336
6378
  export interface SessionState {
6337
6379
  effectiveLocalWindowSize?: number;
6338
6380
  effectiveRecvDataLength?: number;
@@ -6346,20 +6388,26 @@ declare module "http2" {
6346
6388
  }
6347
6389
 
6348
6390
  export interface Http2Session extends events.EventEmitter {
6349
- destroy(): void;
6391
+ readonly alpnProtocol?: string;
6392
+ close(callback?: () => void): void;
6393
+ readonly closed: boolean;
6394
+ destroy(error?: Error, code?: number): void;
6350
6395
  readonly destroyed: boolean;
6396
+ readonly encrypted?: boolean;
6397
+ goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView /*| TypedArray*/): void;
6351
6398
  readonly localSettings: Settings;
6399
+ readonly originSet?: string[];
6352
6400
  readonly pendingSettingsAck: boolean;
6401
+ ref(): void;
6353
6402
  readonly remoteSettings: Settings;
6354
6403
  rstStream(stream: Http2Stream, code?: number): void;
6355
6404
  setTimeout(msecs: number, callback?: () => void): void;
6356
- shutdown(callback?: () => void): void;
6357
- shutdown(options: SessionShutdownOptions, callback?: () => void): void;
6358
6405
  readonly socket: net.Socket | tls.TLSSocket;
6359
6406
  readonly state: SessionState;
6360
6407
  priority(stream: Http2Stream, options: StreamPriorityOptions): void;
6361
6408
  settings(settings: Settings): void;
6362
6409
  readonly type: number;
6410
+ unref(): void;
6363
6411
 
6364
6412
  addListener(event: string, listener: (...args: any[]) => void): this;
6365
6413
  addListener(event: "close", listener: () => void): this;
@@ -6368,7 +6416,6 @@ declare module "http2" {
6368
6416
  addListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
6369
6417
  addListener(event: "localSettings", listener: (settings: Settings) => void): this;
6370
6418
  addListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
6371
- addListener(event: "socketError", listener: (err: Error) => void): this;
6372
6419
  addListener(event: "timeout", listener: () => void): this;
6373
6420
 
6374
6421
  emit(event: string | symbol, ...args: any[]): boolean;
@@ -6378,7 +6425,6 @@ declare module "http2" {
6378
6425
  emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean;
6379
6426
  emit(event: "localSettings", settings: Settings): boolean;
6380
6427
  emit(event: "remoteSettings", settings: Settings): boolean;
6381
- emit(event: "socketError", err: Error): boolean;
6382
6428
  emit(event: "timeout"): boolean;
6383
6429
 
6384
6430
  on(event: string, listener: (...args: any[]) => void): this;
@@ -6388,7 +6434,6 @@ declare module "http2" {
6388
6434
  on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
6389
6435
  on(event: "localSettings", listener: (settings: Settings) => void): this;
6390
6436
  on(event: "remoteSettings", listener: (settings: Settings) => void): this;
6391
- on(event: "socketError", listener: (err: Error) => void): this;
6392
6437
  on(event: "timeout", listener: () => void): this;
6393
6438
 
6394
6439
  once(event: string, listener: (...args: any[]) => void): this;
@@ -6398,7 +6443,6 @@ declare module "http2" {
6398
6443
  once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
6399
6444
  once(event: "localSettings", listener: (settings: Settings) => void): this;
6400
6445
  once(event: "remoteSettings", listener: (settings: Settings) => void): this;
6401
- once(event: "socketError", listener: (err: Error) => void): this;
6402
6446
  once(event: "timeout", listener: () => void): this;
6403
6447
 
6404
6448
  prependListener(event: string, listener: (...args: any[]) => void): this;
@@ -6408,7 +6452,6 @@ declare module "http2" {
6408
6452
  prependListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
6409
6453
  prependListener(event: "localSettings", listener: (settings: Settings) => void): this;
6410
6454
  prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
6411
- prependListener(event: "socketError", listener: (err: Error) => void): this;
6412
6455
  prependListener(event: "timeout", listener: () => void): this;
6413
6456
 
6414
6457
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
@@ -6418,7 +6461,6 @@ declare module "http2" {
6418
6461
  prependOnceListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
6419
6462
  prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this;
6420
6463
  prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
6421
- prependOnceListener(event: "socketError", listener: (err: Error) => void): this;
6422
6464
  prependOnceListener(event: "timeout", listener: () => void): this;
6423
6465
  }
6424
6466
 
@@ -6426,31 +6468,42 @@ declare module "http2" {
6426
6468
  request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
6427
6469
 
6428
6470
  addListener(event: string, listener: (...args: any[]) => void): this;
6471
+ addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
6429
6472
  addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
6430
6473
  addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6431
6474
 
6432
6475
  emit(event: string | symbol, ...args: any[]): boolean;
6476
+ emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
6433
6477
  emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
6434
6478
  emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
6435
6479
 
6436
6480
  on(event: string, listener: (...args: any[]) => void): this;
6481
+ on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
6437
6482
  on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
6438
6483
  on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6439
6484
 
6440
6485
  once(event: string, listener: (...args: any[]) => void): this;
6486
+ once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
6441
6487
  once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
6442
6488
  once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6443
6489
 
6444
6490
  prependListener(event: string, listener: (...args: any[]) => void): this;
6491
+ prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
6445
6492
  prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
6446
6493
  prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6447
6494
 
6448
6495
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
6496
+ prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
6449
6497
  prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
6450
6498
  prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6451
6499
  }
6452
6500
 
6501
+ export interface AlternativeServiceOptions {
6502
+ origin: number | string | url.URL;
6503
+ }
6504
+
6453
6505
  export interface ServerHttp2Session extends Http2Session {
6506
+ altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void;
6454
6507
  readonly server: Http2Server | Http2SecureServer;
6455
6508
 
6456
6509
  addListener(event: string, listener: (...args: any[]) => void): this;
@@ -6494,7 +6547,7 @@ declare module "http2" {
6494
6547
  export type ServerSessionOptions = SessionOptions;
6495
6548
 
6496
6549
  export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { }
6497
- export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsServerOptions { }
6550
+ export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { }
6498
6551
 
6499
6552
  export interface ServerOptions extends ServerSessionOptions {
6500
6553
  allowHTTP1?: boolean;
@@ -6506,93 +6559,93 @@ declare module "http2" {
6506
6559
 
6507
6560
  export interface Http2Server extends net.Server {
6508
6561
  addListener(event: string, listener: (...args: any[]) => void): this;
6562
+ addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6509
6563
  addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6510
6564
  addListener(event: "sessionError", listener: (err: Error) => void): this;
6511
- addListener(event: "socketError", listener: (err: Error) => void): this;
6512
6565
  addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6513
6566
  addListener(event: "timeout", listener: () => void): this;
6514
6567
 
6515
6568
  emit(event: string | symbol, ...args: any[]): boolean;
6569
+ emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
6516
6570
  emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
6517
6571
  emit(event: "sessionError", err: Error): boolean;
6518
- emit(event: "socketError", err: Error): boolean;
6519
6572
  emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
6520
6573
  emit(event: "timeout"): boolean;
6521
6574
 
6522
6575
  on(event: string, listener: (...args: any[]) => void): this;
6576
+ on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6523
6577
  on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6524
6578
  on(event: "sessionError", listener: (err: Error) => void): this;
6525
- on(event: "socketError", listener: (err: Error) => void): this;
6526
6579
  on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6527
6580
  on(event: "timeout", listener: () => void): this;
6528
6581
 
6529
6582
  once(event: string, listener: (...args: any[]) => void): this;
6583
+ once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6530
6584
  once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6531
6585
  once(event: "sessionError", listener: (err: Error) => void): this;
6532
- once(event: "socketError", listener: (err: Error) => void): this;
6533
6586
  once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6534
6587
  once(event: "timeout", listener: () => void): this;
6535
6588
 
6536
6589
  prependListener(event: string, listener: (...args: any[]) => void): this;
6590
+ prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6537
6591
  prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6538
6592
  prependListener(event: "sessionError", listener: (err: Error) => void): this;
6539
- prependListener(event: "socketError", listener: (err: Error) => void): this;
6540
6593
  prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6541
6594
  prependListener(event: "timeout", listener: () => void): this;
6542
6595
 
6543
6596
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
6597
+ prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6544
6598
  prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6545
6599
  prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
6546
- prependOnceListener(event: "socketError", listener: (err: Error) => void): this;
6547
6600
  prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6548
6601
  prependOnceListener(event: "timeout", listener: () => void): this;
6549
6602
  }
6550
6603
 
6551
6604
  export interface Http2SecureServer extends tls.Server {
6552
6605
  addListener(event: string, listener: (...args: any[]) => void): this;
6606
+ addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6553
6607
  addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6554
6608
  addListener(event: "sessionError", listener: (err: Error) => void): this;
6555
- addListener(event: "socketError", listener: (err: Error) => void): this;
6556
6609
  addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6557
6610
  addListener(event: "timeout", listener: () => void): this;
6558
6611
  addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
6559
6612
 
6560
6613
  emit(event: string | symbol, ...args: any[]): boolean;
6614
+ emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
6561
6615
  emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
6562
6616
  emit(event: "sessionError", err: Error): boolean;
6563
- emit(event: "socketError", err: Error): boolean;
6564
6617
  emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
6565
6618
  emit(event: "timeout"): boolean;
6566
6619
  emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean;
6567
6620
 
6568
6621
  on(event: string, listener: (...args: any[]) => void): this;
6622
+ on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6569
6623
  on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6570
6624
  on(event: "sessionError", listener: (err: Error) => void): this;
6571
- on(event: "socketError", listener: (err: Error) => void): this;
6572
6625
  on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6573
6626
  on(event: "timeout", listener: () => void): this;
6574
6627
  on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
6575
6628
 
6576
6629
  once(event: string, listener: (...args: any[]) => void): this;
6630
+ once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6577
6631
  once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6578
6632
  once(event: "sessionError", listener: (err: Error) => void): this;
6579
- once(event: "socketError", listener: (err: Error) => void): this;
6580
6633
  once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6581
6634
  once(event: "timeout", listener: () => void): this;
6582
6635
  once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
6583
6636
 
6584
6637
  prependListener(event: string, listener: (...args: any[]) => void): this;
6638
+ prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6585
6639
  prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6586
6640
  prependListener(event: "sessionError", listener: (err: Error) => void): this;
6587
- prependListener(event: "socketError", listener: (err: Error) => void): this;
6588
6641
  prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6589
6642
  prependListener(event: "timeout", listener: () => void): this;
6590
6643
  prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
6591
6644
 
6592
6645
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
6646
+ prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6593
6647
  prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
6594
6648
  prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
6595
- prependOnceListener(event: "socketError", listener: (err: Error) => void): this;
6596
6649
  prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
6597
6650
  prependOnceListener(event: "timeout", listener: () => void): this;
6598
6651
  prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "9.4.5",
3
+ "version": "9.6.1",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -96,6 +96,11 @@
96
96
  "name": "Huw",
97
97
  "url": "https://github.com/hoo29",
98
98
  "githubUsername": "hoo29"
99
+ },
100
+ {
101
+ "name": "Nicolas Even",
102
+ "url": "https://github.com/n-e",
103
+ "githubUsername": "n-e"
99
104
  }
100
105
  ],
101
106
  "main": "",
@@ -105,6 +110,6 @@
105
110
  },
106
111
  "scripts": {},
107
112
  "dependencies": {},
108
- "typesPublisherContentHash": "62600213f5ba60ebf6f681a679b70ca252a3e40651839aa235ef09abe4d006e5",
113
+ "typesPublisherContentHash": "1718eacebf8528bb3cebadd70721467663f7619d7a8764c47667728788e322f0",
109
114
  "typeScriptVersion": "2.0"
110
115
  }