@types/node 8.10.66 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,25 @@
1
- // base definitions for all NodeJS modules that are not specific to any version of TypeScript
1
+ // Type definitions for Node.js 9.3.x
2
+ // Project: http://nodejs.org/
3
+ // Definitions by: Microsoft TypeScript <http://typescriptlang.org>
4
+ // DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
5
+ // Parambir Singh <https://github.com/parambirs>
6
+ // Christian Vaagland Tellnes <https://github.com/tellnes>
7
+ // Wilco Bakker <https://github.com/WilcoBakker>
8
+ // Nicolas Voigt <https://github.com/octo-sniffle>
9
+ // Chigozirim C. <https://github.com/smac89>
10
+ // Flarna <https://github.com/Flarna>
11
+ // Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
12
+ // wwwy3y3 <https://github.com/wwwy3y3>
13
+ // Deividas Bakanas <https://github.com/DeividasBakanas>
14
+ // Kelvin Jin <https://github.com/kjin>
15
+ // Alvis HT Tang <https://github.com/alvis>
16
+ // Oliver Joseph Ash <https://github.com/OliverJAsh>
17
+ // Sebastian Silbermann <https://github.com/eps1lon>
18
+ // Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
19
+ // Alberto Schiabel <https://github.com/jkomyno>
20
+ // Klaus Meinhardt <https://github.com/ajafff>
21
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
22
+
2
23
  /** inspector module types */
3
24
  /// <reference path="./inspector.d.ts" />
4
25
 
@@ -6,32 +27,15 @@
6
27
  interface Console {
7
28
  Console: NodeJS.ConsoleConstructor;
8
29
  assert(value: any, message?: string, ...optionalParams: any[]): void;
9
- clear(): void;
10
- count(label?: string): void;
11
- countReset(label?: string): void;
12
- debug(message?: any, ...optionalParams: any[]): void;
13
30
  dir(obj: any, options?: NodeJS.InspectOptions): void;
31
+ debug(message?: any, ...optionalParams: any[]): void;
14
32
  error(message?: any, ...optionalParams: any[]): void;
15
- group(...label: any[]): void;
16
- groupCollapsed(): void;
17
- groupEnd(): void;
18
33
  info(message?: any, ...optionalParams: any[]): void;
19
34
  log(message?: any, ...optionalParams: any[]): void;
20
35
  time(label: string): void;
21
36
  timeEnd(label: string): void;
22
37
  trace(message?: any, ...optionalParams: any[]): void;
23
38
  warn(message?: any, ...optionalParams: any[]): void;
24
-
25
- // --- Inspector mode only ---
26
- /** @deprecated Use console.timeStamp() instead. */
27
- markTimeline(label?: string): void;
28
- profile(label?: string): void;
29
- profileEnd(label?: string): void;
30
- timeStamp(label?: string): void;
31
- /** @deprecated Use console.time() instead. */
32
- timeline(label?: string): void;
33
- /** @deprecated Use console.timeEnd() instead. */
34
- timelineEnd(label?: string): void;
35
39
  }
36
40
 
37
41
  interface Error {
@@ -53,6 +57,25 @@ interface ErrorConstructor {
53
57
  stackTraceLimit: number;
54
58
  }
55
59
 
60
+ // compat for TypeScript 1.8
61
+ // if you use with --target es3 or --target es5 and use below definitions,
62
+ // use the lib.es6.d.ts that is bundled with TypeScript 1.8.
63
+ interface MapConstructor { }
64
+ interface WeakMapConstructor { }
65
+ interface SetConstructor { }
66
+ interface WeakSetConstructor { }
67
+
68
+ // Forward-declare needed types from lib.es2015.d.ts (in case users are using `--lib es5`)
69
+ interface Iterable<T> { }
70
+ interface Iterator<T> {
71
+ next(value?: any): IteratorResult<T>;
72
+ }
73
+ interface IteratorResult<T> { }
74
+ interface SymbolConstructor {
75
+ readonly iterator: symbol;
76
+ }
77
+ declare var Symbol: SymbolConstructor;
78
+
56
79
  // Node.js ESNEXT support
57
80
  interface String {
58
81
  /** Removes whitespace from the left end of a string. */
@@ -90,21 +113,17 @@ declare function clearImmediate(immediateId: any): void;
90
113
 
91
114
  // TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version.
92
115
  interface NodeRequireFunction {
116
+ /* tslint:disable-next-line:callable-types */
93
117
  (id: string): any;
94
118
  }
95
119
 
96
120
  interface NodeRequire extends NodeRequireFunction {
97
- resolve: RequireResolve;
121
+ resolve(id: string): string;
98
122
  cache: any;
99
123
  extensions: NodeExtensions;
100
124
  main: NodeModule | undefined;
101
125
  }
102
126
 
103
- interface RequireResolve {
104
- (id: string, options?: { paths?: string[]; }): string;
105
- paths(request: string): string[] | null;
106
- }
107
-
108
127
  interface NodeExtensions {
109
128
  '.js': (m: NodeModule, filename: string) => any;
110
129
  '.json': (m: NodeModule, filename: string) => any;
@@ -133,11 +152,11 @@ declare var SlowBuffer: {
133
152
  new(str: string, encoding?: string): Buffer;
134
153
  new(size: number): Buffer;
135
154
  new(size: Uint8Array): Buffer;
136
- new(array: ReadonlyArray<any>): Buffer;
155
+ new(array: any[]): Buffer;
137
156
  prototype: Buffer;
138
157
  isBuffer(obj: any): boolean;
139
158
  byteLength(string: string, encoding?: string): number;
140
- concat(list: ReadonlyArray<Buffer>, totalLength?: number): Buffer;
159
+ concat(list: Buffer[], totalLength?: number): Buffer;
141
160
  };
142
161
 
143
162
  // Buffer class
@@ -182,7 +201,7 @@ declare var Buffer: {
182
201
  *
183
202
  * @param array The octets to store.
184
203
  */
185
- new(array: ReadonlyArray<any>): Buffer;
204
+ new(array: any[]): Buffer;
186
205
  /**
187
206
  * Copies the passed {buffer} data onto a new {Buffer} instance.
188
207
  *
@@ -190,6 +209,10 @@ declare var Buffer: {
190
209
  */
191
210
  new(buffer: Buffer): Buffer;
192
211
  prototype: Buffer;
212
+ /**
213
+ * Allocates a new Buffer using an {array} of octets.
214
+ */
215
+ from(array: any[]): Buffer;
193
216
  /**
194
217
  * When passed a reference to the .buffer property of a TypedArray instance,
195
218
  * the newly created Buffer will share the same allocated memory as the TypedArray.
@@ -200,10 +223,9 @@ declare var Buffer: {
200
223
  */
201
224
  from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
202
225
  /**
203
- * Creates a new Buffer using the passed {data}
204
- * @param data data to create a new Buffer
226
+ * Copies the passed {buffer} data onto a new Buffer instance.
205
227
  */
206
- from(data: ReadonlyArray<any> | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer;
228
+ from(buffer: Buffer): Buffer;
207
229
  /**
208
230
  * Creates a new Buffer containing the given JavaScript string {str}.
209
231
  * If provided, the {encoding} parameter identifies the character encoding.
@@ -242,7 +264,7 @@ declare var Buffer: {
242
264
  * @param totalLength Total length of the buffers when concatenated.
243
265
  * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
244
266
  */
245
- concat(list: ReadonlyArray<Buffer>, totalLength?: number): Buffer;
267
+ concat(list: Buffer[], totalLength?: number): Buffer;
246
268
  /**
247
269
  * The same as buf1.compare(buf2).
248
270
  */
@@ -430,8 +452,6 @@ declare namespace NodeJS {
430
452
  remove(emitter: Events): void;
431
453
  bind(cb: (err: Error, data: any) => any): any;
432
454
  intercept(cb: (data: any) => any): any;
433
- /** @deprecated since v0.11.7 - recover from failed I/O actions explicitly via error event handlers set on the domain instead. */
434
- dispose(): void;
435
455
 
436
456
  addListener(event: string, listener: (...args: any[]) => void): this;
437
457
  on(event: string, listener: (...args: any[]) => void): this;
@@ -444,7 +464,6 @@ declare namespace NodeJS {
444
464
  rss: number;
445
465
  heapTotal: number;
446
466
  heapUsed: number;
447
- external: number;
448
467
  }
449
468
 
450
469
  export interface CpuUsage {
@@ -452,14 +471,6 @@ declare namespace NodeJS {
452
471
  system: number;
453
472
  }
454
473
 
455
- export interface ProcessRelease {
456
- name: string;
457
- sourceUrl?: string;
458
- headersUrl?: string;
459
- libUrl?: string;
460
- lts?: string;
461
- }
462
-
463
474
  export interface ProcessVersions {
464
475
  http_parser: string;
465
476
  node: string;
@@ -492,10 +503,10 @@ declare namespace NodeJS {
492
503
  type ExitListener = (code: number) => void;
493
504
  type RejectionHandledListener = (promise: Promise<any>) => void;
494
505
  type UncaughtExceptionListener = (error: Error) => void;
495
- type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise<any>) => void;
506
+ type UnhandledRejectionListener = (reason: any, promise: Promise<any>) => void;
496
507
  type WarningListener = (warning: Error) => void;
497
508
  type MessageListener = (message: any, sendHandle: any) => void;
498
- type SignalsListener = () => void;
509
+ type SignalsListener = (signal: Signals) => void;
499
510
  type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
500
511
  type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
501
512
 
@@ -512,7 +523,7 @@ declare namespace NodeJS {
512
523
  columns?: number;
513
524
  rows?: number;
514
525
  _write(chunk: any, encoding: string, callback: Function): void;
515
- _destroy(err: Error | undefined, callback: Function): void;
526
+ _destroy(err: Error, callback: Function): void;
516
527
  _final(callback: Function): void;
517
528
  setDefaultEncoding(encoding: string): this;
518
529
  cork(): void;
@@ -524,7 +535,7 @@ declare namespace NodeJS {
524
535
  isRaw?: boolean;
525
536
  setRawMode?(mode: boolean): void;
526
537
  _read(size: number): void;
527
- _destroy(err: Error | undefined, callback: Function): void;
538
+ _destroy(err: Error, callback: Function): void;
528
539
  push(chunk: any, encoding?: string): boolean;
529
540
  destroy(error?: Error): void;
530
541
  }
@@ -541,7 +552,6 @@ declare namespace NodeJS {
541
552
  abort(): void;
542
553
  chdir(directory: string): void;
543
554
  cwd(): string;
544
- debugPort: number;
545
555
  emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
546
556
  env: ProcessEnv;
547
557
  exit(code?: number): never;
@@ -555,7 +565,9 @@ declare namespace NodeJS {
555
565
  getegid(): number;
556
566
  setegid(id: number | string): void;
557
567
  getgroups(): number[];
558
- setgroups(groups: ReadonlyArray<string | number>): void;
568
+ setgroups(groups: Array<string | number>): void;
569
+ setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
570
+ hasUncaughtExceptionCaptureCallback(): boolean;
559
571
  version: string;
560
572
  versions: ProcessVersions;
561
573
  config: {
@@ -586,6 +598,7 @@ declare namespace NodeJS {
586
598
  };
587
599
  kill(pid: number, signal?: string | number): void;
588
600
  pid: number;
601
+ ppid: number;
589
602
  title: string;
590
603
  arch: string;
591
604
  platform: Platform;
@@ -593,7 +606,6 @@ declare namespace NodeJS {
593
606
  memoryUsage(): MemoryUsage;
594
607
  cpuUsage(previousValue?: CpuUsage): CpuUsage;
595
608
  nextTick(callback: Function, ...args: any[]): void;
596
- release: ProcessRelease;
597
609
  umask(mask?: number): number;
598
610
  uptime(): number;
599
611
  hrtime(time?: [number, number]): [number, number];
@@ -794,6 +806,8 @@ declare namespace NodeJS {
794
806
  }
795
807
  }
796
808
 
809
+ interface IterableIterator<T> { }
810
+
797
811
  /**
798
812
  * @deprecated
799
813
  */
@@ -862,8 +876,6 @@ declare module "buffer" {
862
876
  export var INSPECT_MAX_BYTES: number;
863
877
  var BuffType: typeof Buffer;
864
878
  var SlowBuffType: typeof SlowBuffer;
865
- export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
866
- export function transcode(source: Buffer | Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
867
879
  export { BuffType as Buffer, SlowBuffType as SlowBuffer };
868
880
  }
869
881
 
@@ -877,7 +889,7 @@ declare module "querystring" {
877
889
  decodeURIComponent?: Function;
878
890
  }
879
891
 
880
- interface ParsedUrlQuery { [key: string]: string | string[] | undefined; }
892
+ interface ParsedUrlQuery { [key: string]: string | string[]; }
881
893
 
882
894
  export function stringify<T>(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string;
883
895
  export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
@@ -922,18 +934,17 @@ declare module "http" {
922
934
  // incoming headers will never contain number
923
935
  export interface IncomingHttpHeaders {
924
936
  'accept'?: string;
925
- 'accept-patch'?: string;
926
- 'accept-ranges'?: string;
927
- 'access-control-allow-credentials'?: string;
928
- 'access-control-allow-headers'?: string;
929
- 'access-control-allow-methods'?: string;
930
937
  'access-control-allow-origin'?: string;
938
+ 'access-control-allow-credentials'?: string;
931
939
  'access-control-expose-headers'?: string;
932
940
  'access-control-max-age'?: string;
941
+ 'access-control-allow-methods'?: string;
942
+ 'access-control-allow-headers'?: string;
943
+ 'accept-patch'?: string;
944
+ 'accept-ranges'?: string;
933
945
  'age'?: string;
934
946
  'allow'?: string;
935
947
  'alt-svc'?: string;
936
- 'authorization'?: string;
937
948
  'cache-control'?: string;
938
949
  'connection'?: string;
939
950
  'content-disposition'?: string;
@@ -954,11 +965,10 @@ declare module "http" {
954
965
  'retry-after'?: string;
955
966
  'set-cookie'?: string[];
956
967
  'strict-transport-security'?: string;
957
- 'tk'?: string;
958
968
  'trailer'?: string;
959
969
  'transfer-encoding'?: string;
970
+ 'tk'?: string;
960
971
  'upgrade'?: string;
961
- 'user-agent'?: string;
962
972
  'vary'?: string;
963
973
  'via'?: string;
964
974
  'warning'?: string;
@@ -1022,13 +1032,13 @@ declare module "http" {
1022
1032
 
1023
1033
  setTimeout(msecs: number, callback?: () => void): this;
1024
1034
  destroy(error: Error): void;
1025
- setHeader(name: string, value: number | string | ReadonlyArray<string>): void;
1035
+ setHeader(name: string, value: number | string | string[]): void;
1026
1036
  getHeader(name: string): number | string | string[] | undefined;
1027
1037
  getHeaders(): OutgoingHttpHeaders;
1028
1038
  getHeaderNames(): string[];
1029
1039
  hasHeader(name: string): boolean;
1030
1040
  removeHeader(name: string): void;
1031
- addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
1041
+ addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void;
1032
1042
  flushHeaders(): void;
1033
1043
  }
1034
1044
 
@@ -1056,7 +1066,6 @@ declare module "http" {
1056
1066
 
1057
1067
  constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
1058
1068
 
1059
- readonly path: string;
1060
1069
  abort(): void;
1061
1070
  onSocket(socket: net.Socket): void;
1062
1071
  setTimeout(timeout: number, callback?: () => void): this;
@@ -1122,7 +1131,6 @@ declare module "http" {
1122
1131
  }
1123
1132
 
1124
1133
  export class Agent {
1125
- maxFreeSockets: number;
1126
1134
  maxSockets: number;
1127
1135
  sockets: any;
1128
1136
  requests: any;
@@ -1182,7 +1190,6 @@ declare module "cluster" {
1182
1190
  export class Worker extends events.EventEmitter {
1183
1191
  id: number;
1184
1192
  process: child.ChildProcess;
1185
- /** @deprecated since v6.0.0 - use `worker.exitedAfterDisconnect` instead. */
1186
1193
  suicide: boolean;
1187
1194
  send(message: any, sendHandle?: any, callback?: (error: Error) => void): boolean;
1188
1195
  kill(signal?: string): void;
@@ -1459,28 +1466,27 @@ declare module "zlib" {
1459
1466
  export function createInflateRaw(options?: ZlibOptions): InflateRaw;
1460
1467
  export function createUnzip(options?: ZlibOptions): Unzip;
1461
1468
 
1462
- type InputType = string | Buffer | DataView /* | TypedArray */;
1463
- export function deflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
1464
- export function deflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1465
- export function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
1466
- export function deflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
1467
- export function deflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1468
- export function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
1469
- export function gzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
1470
- export function gzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1471
- export function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
1472
- export function gunzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
1473
- export function gunzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1474
- export function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
1475
- export function inflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
1476
- export function inflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1477
- export function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
1478
- export function inflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
1479
- export function inflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1480
- export function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
1481
- export function unzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
1482
- export function unzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1483
- export function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
1469
+ export function deflate(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void;
1470
+ export function deflate(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1471
+ export function deflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer;
1472
+ export function deflateRaw(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void;
1473
+ export function deflateRaw(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1474
+ export function deflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer;
1475
+ export function gzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void;
1476
+ export function gzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1477
+ export function gzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer;
1478
+ export function gunzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void;
1479
+ export function gunzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1480
+ export function gunzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer;
1481
+ export function inflate(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void;
1482
+ export function inflate(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1483
+ export function inflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer;
1484
+ export function inflateRaw(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void;
1485
+ export function inflateRaw(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1486
+ export function inflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer;
1487
+ export function unzip(buf: Buffer | string, callback: (error: Error | null, result: Buffer) => void): void;
1488
+ export function unzip(buf: Buffer | string, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1489
+ export function unzipSync(buf: Buffer | string, options?: ZlibOptions): Buffer;
1484
1490
 
1485
1491
  export namespace constants {
1486
1492
  // Allowed flush values.
@@ -1572,7 +1578,6 @@ declare module "os" {
1572
1578
  netmask: string;
1573
1579
  mac: string;
1574
1580
  internal: boolean;
1575
- cidr: string | null;
1576
1581
  }
1577
1582
 
1578
1583
  export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
@@ -1599,7 +1604,6 @@ declare module "os" {
1599
1604
  export function userInfo(options?: { encoding: string }): { username: string, uid: number, gid: number, shell: any, homedir: string };
1600
1605
  export var constants: {
1601
1606
  UV_UDP_REUSEADDR: number,
1602
- // signals: { [key in NodeJS.Signals]: number; }; @todo: change after migration to typescript 2.1
1603
1607
  signals: {
1604
1608
  SIGHUP: number;
1605
1609
  SIGINT: number;
@@ -1622,7 +1626,6 @@ declare module "os" {
1622
1626
  SIGCONT: number;
1623
1627
  SIGSTOP: number;
1624
1628
  SIGTSTP: number;
1625
- SIGBREAK: number;
1626
1629
  SIGTTIN: number;
1627
1630
  SIGTTOU: number;
1628
1631
  SIGURG: number;
@@ -1633,9 +1636,7 @@ declare module "os" {
1633
1636
  SIGWINCH: number;
1634
1637
  SIGIO: number;
1635
1638
  SIGPOLL: number;
1636
- SIGLOST: number;
1637
1639
  SIGPWR: number;
1638
- SIGINFO: number;
1639
1640
  SIGSYS: number;
1640
1641
  SIGUNUSED: number;
1641
1642
  },
@@ -1734,20 +1735,33 @@ declare module "https" {
1734
1735
  import * as http from "http";
1735
1736
  import { URL } from "url";
1736
1737
 
1737
- export type ServerOptions = tls.SecureContextOptions & tls.TlsOptions;
1738
-
1739
- // see https://nodejs.org/docs/latest-v8.x/api/https.html#https_https_request_options_callback
1740
- type extendedRequestKeys = "pfx" |
1741
- "key" |
1742
- "passphrase" |
1743
- "cert" |
1744
- "ca" |
1745
- "ciphers" |
1746
- "rejectUnauthorized" |
1747
- "secureProtocol" |
1748
- "servername";
1738
+ export interface ServerOptions {
1739
+ pfx?: any;
1740
+ key?: any;
1741
+ passphrase?: string;
1742
+ cert?: any;
1743
+ ca?: any;
1744
+ crl?: any;
1745
+ ciphers?: string;
1746
+ honorCipherOrder?: boolean;
1747
+ requestCert?: boolean;
1748
+ rejectUnauthorized?: boolean;
1749
+ NPNProtocols?: any;
1750
+ SNICallback?: (servername: string, cb: (err: Error | null, ctx: tls.SecureContext) => void) => void;
1751
+ secureProtocol?: string;
1752
+ }
1749
1753
 
1750
- export type RequestOptions = http.RequestOptions & Pick<tls.ConnectionOptions, extendedRequestKeys>;
1754
+ export interface RequestOptions extends http.RequestOptions {
1755
+ pfx?: any;
1756
+ key?: any;
1757
+ passphrase?: string;
1758
+ cert?: any;
1759
+ ca?: any;
1760
+ ciphers?: string;
1761
+ rejectUnauthorized?: boolean;
1762
+ secureProtocol?: string;
1763
+ servername?: string;
1764
+ }
1751
1765
 
1752
1766
  export interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
1753
1767
  rejectUnauthorized?: boolean;
@@ -1756,7 +1770,6 @@ declare module "https" {
1756
1770
 
1757
1771
  export class Agent extends http.Agent {
1758
1772
  constructor(options?: AgentOptions);
1759
- options: AgentOptions;
1760
1773
  }
1761
1774
 
1762
1775
  export class Server extends tls.Server {
@@ -1780,7 +1793,7 @@ declare module "punycode" {
1780
1793
  export var ucs2: ucs2;
1781
1794
  interface ucs2 {
1782
1795
  decode(string: string): number[];
1783
- encode(codePoints: ReadonlyArray<number>): string;
1796
+ encode(codePoints: number[]): string;
1784
1797
  }
1785
1798
  export var version: any;
1786
1799
  }
@@ -1950,9 +1963,6 @@ declare module "readline" {
1950
1963
  completer?: Completer | AsyncCompleter;
1951
1964
  terminal?: boolean;
1952
1965
  historySize?: number;
1953
- prompt?: string;
1954
- crlfDelay?: number;
1955
- removeHistoryDuplicates?: boolean;
1956
1966
  }
1957
1967
 
1958
1968
  export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): ReadLine;
@@ -1991,26 +2001,24 @@ declare module "vm" {
1991
2001
  }
1992
2002
  export function createContext(sandbox?: Context): Context;
1993
2003
  export function isContext(sandbox: Context): boolean;
1994
- export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
2004
+ export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any;
1995
2005
  export function runInDebugContext(code: string): any;
1996
- export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
1997
- export function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
2006
+ export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any;
2007
+ export function runInThisContext(code: string, options?: RunningScriptOptions): any;
1998
2008
  }
1999
2009
 
2000
2010
  declare module "child_process" {
2001
2011
  import * as events from "events";
2002
2012
  import * as stream from "stream";
2003
2013
  import * as net from "net";
2014
+
2004
2015
  export interface ChildProcess extends events.EventEmitter {
2005
2016
  stdin: stream.Writable;
2006
2017
  stdout: stream.Readable;
2007
2018
  stderr: stream.Readable;
2008
- readonly channel?: stream.Pipe | null;
2009
- stdio: StdioStreams;
2019
+ stdio: [stream.Writable, stream.Readable, stream.Readable];
2010
2020
  killed: boolean;
2011
2021
  pid: number;
2012
- readonly exitCode: number | null;
2013
- readonly signalCode: number | null;
2014
2022
  kill(signal?: string): void;
2015
2023
  send(message: any, callback?: (error: Error) => void): boolean;
2016
2024
  send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error) => void): boolean;
@@ -2072,12 +2080,6 @@ declare module "child_process" {
2072
2080
  prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
2073
2081
  }
2074
2082
 
2075
- export interface StdioStreams extends ReadonlyArray<stream.Readable|stream.Writable> {
2076
- 0: stream.Writable; // stdin
2077
- 1: stream.Readable; // stdout
2078
- 2: stream.Readable; // stderr
2079
- }
2080
-
2081
2083
  export interface MessageOptions {
2082
2084
  keepOpen?: boolean;
2083
2085
  }
@@ -2091,10 +2093,9 @@ declare module "child_process" {
2091
2093
  gid?: number;
2092
2094
  shell?: boolean | string;
2093
2095
  windowsVerbatimArguments?: boolean;
2094
- windowsHide?: boolean;
2095
2096
  }
2096
2097
 
2097
- export function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptions): ChildProcess;
2098
+ export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess;
2098
2099
 
2099
2100
  export interface ExecOptions {
2100
2101
  cwd?: string;
@@ -2105,7 +2106,6 @@ declare module "child_process" {
2105
2106
  killSignal?: string;
2106
2107
  uid?: number;
2107
2108
  gid?: number;
2108
- windowsHide?: boolean;
2109
2109
  }
2110
2110
 
2111
2111
  export interface ExecOptionsWithStringEncoding extends ExecOptions {
@@ -2152,9 +2152,7 @@ declare module "child_process" {
2152
2152
  killSignal?: string;
2153
2153
  uid?: number;
2154
2154
  gid?: number;
2155
- windowsHide?: boolean;
2156
2155
  windowsVerbatimArguments?: boolean;
2157
- shell?: boolean | string;
2158
2156
  }
2159
2157
  export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
2160
2158
  encoding: BufferEncoding;
@@ -2168,48 +2166,48 @@ declare module "child_process" {
2168
2166
 
2169
2167
  export function execFile(file: string): ChildProcess;
2170
2168
  export function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess;
2171
- export function execFile(file: string, args: ReadonlyArray<string> | undefined | null): ChildProcess;
2172
- export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess;
2169
+ export function execFile(file: string, args: string[] | undefined | null): ChildProcess;
2170
+ export function execFile(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess;
2173
2171
 
2174
2172
  // no `options` definitely means stdout/stderr are `string`.
2175
2173
  export function execFile(file: string, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
2176
- export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
2174
+ export function execFile(file: string, args: string[] | undefined | null, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
2177
2175
 
2178
2176
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
2179
2177
  export function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
2180
- export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
2178
+ export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
2181
2179
 
2182
2180
  // `options` with well known `encoding` means stdout/stderr are definitely `string`.
2183
2181
  export function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
2184
- export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
2182
+ export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
2185
2183
 
2186
2184
  // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
2187
2185
  // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
2188
2186
  export function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
2189
- export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
2187
+ export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
2190
2188
 
2191
2189
  // `options` without an `encoding` means stdout/stderr are definitely `string`.
2192
2190
  export function execFile(file: string, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
2193
- export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
2191
+ export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
2194
2192
 
2195
2193
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
2196
2194
  export function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess;
2197
- export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess;
2195
+ export function execFile(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess;
2198
2196
 
2199
2197
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
2200
2198
  export namespace execFile {
2201
2199
  export function __promisify__(file: string): Promise<{ stdout: string, stderr: string }>;
2202
- export function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null): Promise<{ stdout: string, stderr: string }>;
2200
+ export function __promisify__(file: string, args: string[] | undefined | null): Promise<{ stdout: string, stderr: string }>;
2203
2201
  export function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>;
2204
- export function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>;
2202
+ export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>;
2205
2203
  export function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>;
2206
- export function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>;
2204
+ export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>;
2207
2205
  export function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
2208
- export function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
2206
+ export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
2209
2207
  export function __promisify__(file: string, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>;
2210
- export function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>;
2208
+ export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>;
2211
2209
  export function __promisify__(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
2212
- export function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
2210
+ export function __promisify__(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
2213
2211
  }
2214
2212
 
2215
2213
  export interface ForkOptions {
@@ -2219,13 +2217,11 @@ declare module "child_process" {
2219
2217
  execArgv?: string[];
2220
2218
  silent?: boolean;
2221
2219
  stdio?: any[];
2222
- detached?: boolean;
2223
2220
  uid?: number;
2224
2221
  gid?: number;
2225
2222
  windowsVerbatimArguments?: boolean;
2226
2223
  }
2227
- export function fork(modulePath: string, options?: ForkOptions): ChildProcess;
2228
- export function fork(modulePath: string, args?: ReadonlyArray<string>, options?: ForkOptions): ChildProcess;
2224
+ export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess;
2229
2225
 
2230
2226
  export interface SpawnSyncOptions {
2231
2227
  cwd?: string;
@@ -2239,7 +2235,6 @@ declare module "child_process" {
2239
2235
  maxBuffer?: number;
2240
2236
  encoding?: string;
2241
2237
  shell?: boolean | string;
2242
- windowsHide?: boolean;
2243
2238
  windowsVerbatimArguments?: boolean;
2244
2239
  }
2245
2240
  export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
@@ -2255,15 +2250,15 @@ declare module "child_process" {
2255
2250
  stderr: T;
2256
2251
  status: number;
2257
2252
  signal: string;
2258
- error?: Error;
2253
+ error: Error;
2259
2254
  }
2260
2255
  export function spawnSync(command: string): SpawnSyncReturns<Buffer>;
2261
2256
  export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
2262
2257
  export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
2263
2258
  export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
2264
- export function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
2265
- export function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
2266
- export function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
2259
+ export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
2260
+ export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
2261
+ export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
2267
2262
 
2268
2263
  export interface ExecSyncOptions {
2269
2264
  cwd?: string;
@@ -2277,7 +2272,6 @@ declare module "child_process" {
2277
2272
  killSignal?: string;
2278
2273
  maxBuffer?: number;
2279
2274
  encoding?: string;
2280
- windowsHide?: boolean;
2281
2275
  }
2282
2276
  export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
2283
2277
  encoding: BufferEncoding;
@@ -2301,7 +2295,6 @@ declare module "child_process" {
2301
2295
  killSignal?: string;
2302
2296
  maxBuffer?: number;
2303
2297
  encoding?: string;
2304
- windowsHide?: boolean;
2305
2298
  }
2306
2299
  export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
2307
2300
  encoding: BufferEncoding;
@@ -2313,9 +2306,9 @@ declare module "child_process" {
2313
2306
  export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
2314
2307
  export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
2315
2308
  export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;
2316
- export function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithStringEncoding): string;
2317
- export function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
2318
- export function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): Buffer;
2309
+ export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string;
2310
+ export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
2311
+ export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer;
2319
2312
  }
2320
2313
 
2321
2314
  declare module "url" {
@@ -2363,9 +2356,6 @@ declare module "url" {
2363
2356
  export function format(urlObject: UrlObject | string): string;
2364
2357
  export function resolve(from: string, to: string): string;
2365
2358
 
2366
- export function domainToASCII(domain: string): string;
2367
- export function domainToUnicode(domain: string): string;
2368
-
2369
2359
  export interface URLFormatOptions {
2370
2360
  auth?: boolean;
2371
2361
  fragment?: boolean;
@@ -2374,11 +2364,11 @@ declare module "url" {
2374
2364
  }
2375
2365
 
2376
2366
  export class URLSearchParams implements Iterable<[string, string]> {
2377
- constructor(init?: URLSearchParams | string | { [key: string]: string | ReadonlyArray<string> | undefined } | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
2367
+ constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>);
2378
2368
  append(name: string, value: string): void;
2379
2369
  delete(name: string): void;
2380
2370
  entries(): IterableIterator<[string, string]>;
2381
- forEach(callback: (value: string, name: string, searchParams: this) => void): void;
2371
+ forEach(callback: (value: string, name: string) => void): void;
2382
2372
  get(name: string): string | null;
2383
2373
  getAll(name: string): string[];
2384
2374
  has(name: string): boolean;
@@ -2418,7 +2408,6 @@ declare module "dns" {
2418
2408
  family?: number;
2419
2409
  hints?: number;
2420
2410
  all?: boolean;
2421
- verbatim?: boolean;
2422
2411
  }
2423
2412
 
2424
2413
  export interface LookupOneOptions extends LookupOptions {
@@ -2434,11 +2423,11 @@ declare module "dns" {
2434
2423
  family: number;
2435
2424
  }
2436
2425
 
2437
- export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
2438
- export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
2439
- export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
2440
- export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void;
2441
- export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
2426
+ export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
2427
+ export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
2428
+ export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException, addresses: LookupAddress[]) => void): void;
2429
+ export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void;
2430
+ export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
2442
2431
 
2443
2432
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
2444
2433
  export namespace lookup {
@@ -2447,12 +2436,6 @@ declare module "dns" {
2447
2436
  export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
2448
2437
  }
2449
2438
 
2450
- export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
2451
-
2452
- export namespace lookupService {
2453
- export function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
2454
- }
2455
-
2456
2439
  export interface ResolveOptions {
2457
2440
  ttl: boolean;
2458
2441
  }
@@ -2466,23 +2449,11 @@ declare module "dns" {
2466
2449
  ttl: number;
2467
2450
  }
2468
2451
 
2469
- export interface AnyARecord extends RecordWithTtl {
2470
- type: "A";
2471
- }
2472
-
2473
- export interface AnyAaaaRecord extends RecordWithTtl {
2474
- type: "AAAA";
2475
- }
2476
-
2477
2452
  export interface MxRecord {
2478
2453
  priority: number;
2479
2454
  exchange: string;
2480
2455
  }
2481
2456
 
2482
- export interface AnyMxRecord extends MxRecord {
2483
- type: "MX";
2484
- }
2485
-
2486
2457
  export interface NaptrRecord {
2487
2458
  flags: string;
2488
2459
  service: string;
@@ -2492,10 +2463,6 @@ declare module "dns" {
2492
2463
  preference: number;
2493
2464
  }
2494
2465
 
2495
- export interface AnyNaptrRecord extends NaptrRecord {
2496
- type: "NAPTR";
2497
- }
2498
-
2499
2466
  export interface SoaRecord {
2500
2467
  nsname: string;
2501
2468
  hostmaster: string;
@@ -2506,10 +2473,6 @@ declare module "dns" {
2506
2473
  minttl: number;
2507
2474
  }
2508
2475
 
2509
- export interface AnySoaRecord extends SoaRecord {
2510
- type: "SOA";
2511
- }
2512
-
2513
2476
  export interface SrvRecord {
2514
2477
  priority: number;
2515
2478
  weight: number;
@@ -2517,70 +2480,33 @@ declare module "dns" {
2517
2480
  name: string;
2518
2481
  }
2519
2482
 
2520
- export interface AnySrvRecord extends SrvRecord {
2521
- type: "SRV";
2522
- }
2523
-
2524
- export interface AnyTxtRecord {
2525
- type: "TXT";
2526
- entries: string[];
2527
- }
2528
-
2529
- export interface AnyNsRecord {
2530
- type: "NS";
2531
- value: string;
2532
- }
2533
-
2534
- export interface AnyPtrRecord {
2535
- type: "PTR";
2536
- value: string;
2537
- }
2538
-
2539
- export interface AnyCnameRecord {
2540
- type: "CNAME";
2541
- value: string;
2542
- }
2543
-
2544
- export type AnyRecord = AnyARecord |
2545
- AnyAaaaRecord |
2546
- AnyCnameRecord |
2547
- AnyMxRecord |
2548
- AnyNaptrRecord |
2549
- AnyNsRecord |
2550
- AnyPtrRecord |
2551
- AnySoaRecord |
2552
- AnySrvRecord |
2553
- AnyTxtRecord;
2554
-
2555
- export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2556
- export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2557
- export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2558
- export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
2559
- export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2560
- export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
2561
- export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
2562
- export function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2563
- export function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2564
- export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void;
2565
- export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
2566
- export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
2567
- export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void): void;
2483
+ export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2484
+ export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2485
+ export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2486
+ export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2487
+ export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
2488
+ export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
2489
+ export function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2490
+ export function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2491
+ export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException, addresses: SoaRecord) => void): void;
2492
+ export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void;
2493
+ export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void;
2494
+ export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]) => void): void;
2568
2495
 
2569
2496
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
2570
2497
  export namespace resolve {
2571
2498
  export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
2572
- export function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
2573
2499
  export function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
2574
2500
  export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
2575
2501
  export function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
2576
2502
  export function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
2577
2503
  export function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
2578
- export function __promisify__(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
2504
+ export function __promisify__(hostname: string, rrtype?: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]>;
2579
2505
  }
2580
2506
 
2581
- export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2582
- export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
2583
- export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
2507
+ export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2508
+ export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void;
2509
+ export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void;
2584
2510
 
2585
2511
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
2586
2512
  export namespace resolve4 {
@@ -2589,9 +2515,9 @@ declare module "dns" {
2589
2515
  export function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
2590
2516
  }
2591
2517
 
2592
- export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2593
- export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
2594
- export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
2518
+ export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2519
+ export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void;
2520
+ export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void;
2595
2521
 
2596
2522
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
2597
2523
  export namespace resolve6 {
@@ -2600,54 +2526,17 @@ declare module "dns" {
2600
2526
  export function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
2601
2527
  }
2602
2528
 
2603
- export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2604
- export namespace resolveCname {
2605
- export function __promisify__(hostname: string): Promise<string[]>;
2606
- }
2607
-
2608
- export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
2609
- export namespace resolveMx {
2610
- export function __promisify__(hostname: string): Promise<MxRecord[]>;
2611
- }
2612
-
2613
- export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
2614
- export namespace resolveNaptr {
2615
- export function __promisify__(hostname: string): Promise<NaptrRecord[]>;
2616
- }
2617
-
2618
- export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2619
- export namespace resolveNs {
2620
- export function __promisify__(hostname: string): Promise<string[]>;
2621
- }
2622
-
2623
- export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
2624
- export namespace resolvePtr {
2625
- export function __promisify__(hostname: string): Promise<string[]>;
2626
- }
2627
-
2628
- export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
2629
- export namespace resolveSoa {
2630
- export function __promisify__(hostname: string): Promise<SoaRecord>;
2631
- }
2632
-
2633
- export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
2634
- export namespace resolveSrv {
2635
- export function __promisify__(hostname: string): Promise<SrvRecord[]>;
2636
- }
2637
-
2638
- export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
2639
- export namespace resolveTxt {
2640
- export function __promisify__(hostname: string): Promise<string[][]>;
2641
- }
2642
-
2643
- export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
2644
- export namespace resolveAny {
2645
- export function __promisify__(hostname: string): Promise<AnyRecord[]>;
2646
- }
2529
+ export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2530
+ export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
2531
+ export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
2532
+ export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2533
+ export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2534
+ export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException, address: SoaRecord) => void): void;
2535
+ export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void;
2536
+ export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void;
2647
2537
 
2648
- export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
2649
- export function setServers(servers: ReadonlyArray<string>): void;
2650
- export function getServers(): string[];
2538
+ export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void;
2539
+ export function setServers(servers: string[]): void;
2651
2540
 
2652
2541
  // Error codes
2653
2542
  export var NODATA: string;
@@ -2674,25 +2563,6 @@ declare module "dns" {
2674
2563
  export var LOADIPHLPAPI: string;
2675
2564
  export var ADDRGETNETWORKPARAMS: string;
2676
2565
  export var CANCELLED: string;
2677
-
2678
- export class Resolver {
2679
- getServers: typeof getServers;
2680
- setServers: typeof setServers;
2681
- resolve: typeof resolve;
2682
- resolve4: typeof resolve4;
2683
- resolve6: typeof resolve6;
2684
- resolveAny: typeof resolveAny;
2685
- resolveCname: typeof resolveCname;
2686
- resolveMx: typeof resolveMx;
2687
- resolveNaptr: typeof resolveNaptr;
2688
- resolveNs: typeof resolveNs;
2689
- resolvePtr: typeof resolvePtr;
2690
- resolveSoa: typeof resolveSoa;
2691
- resolveSrv: typeof resolveSrv;
2692
- resolveTxt: typeof resolveTxt;
2693
- reverse: typeof reverse;
2694
- cancel(): void;
2695
- }
2696
2566
  }
2697
2567
 
2698
2568
  declare module "net" {
@@ -2746,9 +2616,9 @@ declare module "net" {
2746
2616
  destroy(err?: any): void;
2747
2617
  pause(): this;
2748
2618
  resume(): this;
2749
- setTimeout(timeout: number, callback?: Function): this;
2750
- setNoDelay(noDelay?: boolean): this;
2751
- setKeepAlive(enable?: boolean, initialDelay?: number): this;
2619
+ setTimeout(timeout: number, callback?: Function): void;
2620
+ setNoDelay(noDelay?: boolean): void;
2621
+ setKeepAlive(enable?: boolean, initialDelay?: number): void;
2752
2622
  address(): { port: number; family: string; address: string; };
2753
2623
  unref(): void;
2754
2624
  ref(): void;
@@ -2864,7 +2734,7 @@ declare module "net" {
2864
2734
  listen(options: ListenOptions, listeningListener?: Function): this;
2865
2735
  listen(handle: any, backlog?: number, listeningListener?: Function): this;
2866
2736
  listen(handle: any, listeningListener?: Function): this;
2867
- close(callback?: (err?: Error) => void): this;
2737
+ close(callback?: Function): this;
2868
2738
  address(): { port: number; family: string; address: string; };
2869
2739
  getConnections(cb: (error: Error | null, count: number) => void): void;
2870
2740
  ref(): this;
@@ -2969,15 +2839,15 @@ declare module "dgram" {
2969
2839
  reuseAddr?: boolean;
2970
2840
  recvBufferSize?: number;
2971
2841
  sendBufferSize?: number;
2972
- lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
2842
+ lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void;
2973
2843
  }
2974
2844
 
2975
2845
  export function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
2976
2846
  export function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
2977
2847
 
2978
2848
  export class Socket extends events.EventEmitter {
2979
- send(msg: Buffer | string | Uint8Array | ReadonlyArray<any>, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
2980
- send(msg: Buffer | string | Uint8Array, offset: number, length: number, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
2849
+ send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void;
2850
+ send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void;
2981
2851
  bind(port?: number, address?: string, callback?: () => void): void;
2982
2852
  bind(port?: number, callback?: () => void): void;
2983
2853
  bind(callback?: () => void): void;
@@ -3180,7 +3050,7 @@ declare module "fs" {
3180
3050
  * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
3181
3051
  * URL support is _experimental_.
3182
3052
  */
3183
- export function rename(oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
3053
+ export function rename(oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
3184
3054
 
3185
3055
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3186
3056
  export namespace rename {
@@ -3208,14 +3078,14 @@ declare module "fs" {
3208
3078
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3209
3079
  * @param len If not specified, defaults to `0`.
3210
3080
  */
3211
- export function truncate(path: PathLike, len: number | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void;
3081
+ export function truncate(path: PathLike, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
3212
3082
 
3213
3083
  /**
3214
3084
  * Asynchronous truncate(2) - Truncate a file to a specified length.
3215
3085
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3216
3086
  * URL support is _experimental_.
3217
3087
  */
3218
- export function truncate(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
3088
+ export function truncate(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
3219
3089
 
3220
3090
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3221
3091
  export namespace truncate {
@@ -3239,13 +3109,13 @@ declare module "fs" {
3239
3109
  * @param fd A file descriptor.
3240
3110
  * @param len If not specified, defaults to `0`.
3241
3111
  */
3242
- export function ftruncate(fd: number, len: number | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void;
3112
+ export function ftruncate(fd: number, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
3243
3113
 
3244
3114
  /**
3245
3115
  * Asynchronous ftruncate(2) - Truncate a file to a specified length.
3246
3116
  * @param fd A file descriptor.
3247
3117
  */
3248
- export function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
3118
+ export function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
3249
3119
 
3250
3120
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3251
3121
  export namespace ftruncate {
@@ -3268,7 +3138,7 @@ declare module "fs" {
3268
3138
  * Asynchronous chown(2) - Change ownership of a file.
3269
3139
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3270
3140
  */
3271
- export function chown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
3141
+ export function chown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
3272
3142
 
3273
3143
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3274
3144
  export namespace chown {
@@ -3289,7 +3159,7 @@ declare module "fs" {
3289
3159
  * Asynchronous fchown(2) - Change ownership of a file.
3290
3160
  * @param fd A file descriptor.
3291
3161
  */
3292
- export function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
3162
+ export function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
3293
3163
 
3294
3164
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3295
3165
  export namespace fchown {
@@ -3310,7 +3180,7 @@ declare module "fs" {
3310
3180
  * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
3311
3181
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3312
3182
  */
3313
- export function lchown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
3183
+ export function lchown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
3314
3184
 
3315
3185
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3316
3186
  export namespace lchown {
@@ -3332,7 +3202,7 @@ declare module "fs" {
3332
3202
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3333
3203
  * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
3334
3204
  */
3335
- export function chmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException | null) => void): void;
3205
+ export function chmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void;
3336
3206
 
3337
3207
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3338
3208
  export namespace chmod {
@@ -3356,7 +3226,7 @@ declare module "fs" {
3356
3226
  * @param fd A file descriptor.
3357
3227
  * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
3358
3228
  */
3359
- export function fchmod(fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException | null) => void): void;
3229
+ export function fchmod(fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void;
3360
3230
 
3361
3231
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3362
3232
  export namespace fchmod {
@@ -3380,7 +3250,7 @@ declare module "fs" {
3380
3250
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3381
3251
  * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
3382
3252
  */
3383
- export function lchmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException | null) => void): void;
3253
+ export function lchmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void;
3384
3254
 
3385
3255
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3386
3256
  export namespace lchmod {
@@ -3403,7 +3273,7 @@ declare module "fs" {
3403
3273
  * Asynchronous stat(2) - Get file status.
3404
3274
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3405
3275
  */
3406
- export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
3276
+ export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void;
3407
3277
 
3408
3278
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3409
3279
  export namespace stat {
@@ -3424,7 +3294,7 @@ declare module "fs" {
3424
3294
  * Asynchronous fstat(2) - Get file status.
3425
3295
  * @param fd A file descriptor.
3426
3296
  */
3427
- export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
3297
+ export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void;
3428
3298
 
3429
3299
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3430
3300
  export namespace fstat {
@@ -3445,7 +3315,7 @@ declare module "fs" {
3445
3315
  * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
3446
3316
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3447
3317
  */
3448
- export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
3318
+ export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void;
3449
3319
 
3450
3320
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3451
3321
  export namespace lstat {
@@ -3467,7 +3337,7 @@ declare module "fs" {
3467
3337
  * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
3468
3338
  * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
3469
3339
  */
3470
- export function link(existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
3340
+ export function link(existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
3471
3341
 
3472
3342
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3473
3343
  export namespace link {
@@ -3476,7 +3346,7 @@ declare module "fs" {
3476
3346
  * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
3477
3347
  * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
3478
3348
  */
3479
- export function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
3349
+ export function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
3480
3350
  }
3481
3351
 
3482
3352
  /**
@@ -3493,14 +3363,14 @@ declare module "fs" {
3493
3363
  * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
3494
3364
  * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
3495
3365
  */
3496
- export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void;
3366
+ export function symlink(target: PathLike, path: PathLike, type: string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
3497
3367
 
3498
3368
  /**
3499
3369
  * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
3500
3370
  * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
3501
3371
  * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
3502
3372
  */
3503
- export function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
3373
+ export function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
3504
3374
 
3505
3375
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3506
3376
  export namespace symlink {
@@ -3512,8 +3382,6 @@ declare module "fs" {
3512
3382
  * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
3513
3383
  */
3514
3384
  export function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
3515
-
3516
- export type Type = "dir" | "file" | "junction";
3517
3385
  }
3518
3386
 
3519
3387
  /**
@@ -3523,34 +3391,34 @@ declare module "fs" {
3523
3391
  * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
3524
3392
  * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
3525
3393
  */
3526
- export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void;
3394
+ export function symlinkSync(target: PathLike, path: PathLike, type?: string | null): void;
3527
3395
 
3528
3396
  /**
3529
3397
  * Asynchronous readlink(2) - read value of a symbolic link.
3530
3398
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3531
3399
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3532
3400
  */
3533
- export function readlink(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void;
3401
+ export function readlink(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void;
3534
3402
 
3535
3403
  /**
3536
3404
  * Asynchronous readlink(2) - read value of a symbolic link.
3537
3405
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3538
3406
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3539
3407
  */
3540
- export function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void;
3408
+ export function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, linkString: Buffer) => void): void;
3541
3409
 
3542
3410
  /**
3543
3411
  * Asynchronous readlink(2) - read value of a symbolic link.
3544
3412
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3545
3413
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3546
3414
  */
3547
- export function readlink(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void;
3415
+ export function readlink(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string | Buffer) => void): void;
3548
3416
 
3549
3417
  /**
3550
3418
  * Asynchronous readlink(2) - read value of a symbolic link.
3551
3419
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3552
3420
  */
3553
- export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void;
3421
+ export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void;
3554
3422
 
3555
3423
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3556
3424
  export namespace readlink {
@@ -3602,27 +3470,27 @@ declare module "fs" {
3602
3470
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3603
3471
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3604
3472
  */
3605
- export function realpath(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
3473
+ export function realpath(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void;
3606
3474
 
3607
3475
  /**
3608
3476
  * Asynchronous realpath(3) - return the canonicalized absolute pathname.
3609
3477
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3610
3478
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3611
3479
  */
3612
- export function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void;
3480
+ export function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, resolvedPath: Buffer) => void): void;
3613
3481
 
3614
3482
  /**
3615
3483
  * Asynchronous realpath(3) - return the canonicalized absolute pathname.
3616
3484
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3617
3485
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3618
3486
  */
3619
- export function realpath(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void;
3487
+ export function realpath(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void;
3620
3488
 
3621
3489
  /**
3622
3490
  * Asynchronous realpath(3) - return the canonicalized absolute pathname.
3623
3491
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3624
3492
  */
3625
- export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
3493
+ export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void;
3626
3494
 
3627
3495
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3628
3496
  export namespace realpath {
@@ -3646,6 +3514,11 @@ declare module "fs" {
3646
3514
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3647
3515
  */
3648
3516
  export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
3517
+
3518
+ export function native(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void;
3519
+ export function native(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, resolvedPath: Buffer) => void): void;
3520
+ export function native(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void;
3521
+ export function native(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void;
3649
3522
  }
3650
3523
 
3651
3524
  /**
@@ -3669,11 +3542,17 @@ declare module "fs" {
3669
3542
  */
3670
3543
  export function realpathSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer;
3671
3544
 
3545
+ export namespace realpathSync {
3546
+ export function native(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string;
3547
+ export function native(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer;
3548
+ export function native(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer;
3549
+ }
3550
+
3672
3551
  /**
3673
3552
  * Asynchronous unlink(2) - delete a name and possibly the file it refers to.
3674
3553
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3675
3554
  */
3676
- export function unlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
3555
+ export function unlink(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
3677
3556
 
3678
3557
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3679
3558
  export namespace unlink {
@@ -3694,7 +3573,7 @@ declare module "fs" {
3694
3573
  * Asynchronous rmdir(2) - delete a directory.
3695
3574
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3696
3575
  */
3697
- export function rmdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
3576
+ export function rmdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
3698
3577
 
3699
3578
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3700
3579
  export namespace rmdir {
@@ -3716,13 +3595,13 @@ declare module "fs" {
3716
3595
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3717
3596
  * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
3718
3597
  */
3719
- export function mkdir(path: PathLike, mode: number | string | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void;
3598
+ export function mkdir(path: PathLike, mode: number | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
3720
3599
 
3721
3600
  /**
3722
3601
  * Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
3723
3602
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3724
3603
  */
3725
- export function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
3604
+ export function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
3726
3605
 
3727
3606
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3728
3607
  export namespace mkdir {
@@ -3746,27 +3625,27 @@ declare module "fs" {
3746
3625
  * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
3747
3626
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3748
3627
  */
3749
- export function mkdtemp(prefix: string, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void;
3628
+ export function mkdtemp(prefix: string, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string) => void): void;
3750
3629
 
3751
3630
  /**
3752
3631
  * Asynchronously creates a unique temporary directory.
3753
3632
  * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
3754
3633
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3755
3634
  */
3756
- export function mkdtemp(prefix: string, options: "buffer" | { encoding: "buffer" }, callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void): void;
3635
+ export function mkdtemp(prefix: string, options: "buffer" | { encoding: "buffer" }, callback: (err: NodeJS.ErrnoException, folder: Buffer) => void): void;
3757
3636
 
3758
3637
  /**
3759
3638
  * Asynchronously creates a unique temporary directory.
3760
3639
  * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
3761
3640
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3762
3641
  */
3763
- export function mkdtemp(prefix: string, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void;
3642
+ export function mkdtemp(prefix: string, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string | Buffer) => void): void;
3764
3643
 
3765
3644
  /**
3766
3645
  * Asynchronously creates a unique temporary directory.
3767
3646
  * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
3768
3647
  */
3769
- export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void;
3648
+ export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void;
3770
3649
 
3771
3650
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3772
3651
  export namespace mkdtemp {
@@ -3818,27 +3697,27 @@ declare module "fs" {
3818
3697
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3819
3698
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3820
3699
  */
3821
- export function readdir(path: PathLike, options: { encoding: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void;
3700
+ export function readdir(path: PathLike, options: { encoding: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void;
3822
3701
 
3823
3702
  /**
3824
3703
  * Asynchronous readdir(3) - read a directory.
3825
3704
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3826
3705
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3827
3706
  */
3828
- export function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void): void;
3707
+ export function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, files: Buffer[]) => void): void;
3829
3708
 
3830
3709
  /**
3831
3710
  * Asynchronous readdir(3) - read a directory.
3832
3711
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3833
3712
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3834
3713
  */
3835
- export function readdir(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void): void;
3714
+ export function readdir(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: Array<string | Buffer>) => void): void;
3836
3715
 
3837
3716
  /**
3838
3717
  * Asynchronous readdir(3) - read a directory.
3839
3718
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3840
3719
  */
3841
- export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void;
3720
+ export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void;
3842
3721
 
3843
3722
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3844
3723
  export namespace readdir {
@@ -3861,7 +3740,7 @@ declare module "fs" {
3861
3740
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3862
3741
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3863
3742
  */
3864
- export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string[] | Buffer[]>;
3743
+ export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<Array<string | Buffer>>;
3865
3744
  }
3866
3745
 
3867
3746
  /**
@@ -3883,13 +3762,13 @@ declare module "fs" {
3883
3762
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3884
3763
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
3885
3764
  */
3886
- export function readdirSync(path: PathLike, options?: { encoding?: string | null } | string | null): string[] | Buffer[];
3765
+ export function readdirSync(path: PathLike, options?: { encoding?: string | null } | string | null): Array<string | Buffer>;
3887
3766
 
3888
3767
  /**
3889
3768
  * Asynchronous close(2) - close a file descriptor.
3890
3769
  * @param fd A file descriptor.
3891
3770
  */
3892
- export function close(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
3771
+ export function close(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
3893
3772
 
3894
3773
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3895
3774
  export namespace close {
@@ -3911,13 +3790,13 @@ declare module "fs" {
3911
3790
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3912
3791
  * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`.
3913
3792
  */
3914
- export function open(path: PathLike, flags: string | number, mode: string | number | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
3793
+ export function open(path: PathLike, flags: string | number, mode: string | number | undefined | null, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
3915
3794
 
3916
3795
  /**
3917
3796
  * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
3918
3797
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
3919
3798
  */
3920
- export function open(path: PathLike, flags: string | number, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
3799
+ export function open(path: PathLike, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
3921
3800
 
3922
3801
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3923
3802
  export namespace open {
@@ -3942,7 +3821,7 @@ declare module "fs" {
3942
3821
  * @param atime The last access time. If a string is provided, it will be coerced to number.
3943
3822
  * @param mtime The last modified time. If a string is provided, it will be coerced to number.
3944
3823
  */
3945
- export function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException | null) => void): void;
3824
+ export function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void;
3946
3825
 
3947
3826
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3948
3827
  export namespace utimes {
@@ -3969,7 +3848,7 @@ declare module "fs" {
3969
3848
  * @param atime The last access time. If a string is provided, it will be coerced to number.
3970
3849
  * @param mtime The last modified time. If a string is provided, it will be coerced to number.
3971
3850
  */
3972
- export function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException | null) => void): void;
3851
+ export function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void;
3973
3852
 
3974
3853
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
3975
3854
  export namespace futimes {
@@ -3994,7 +3873,7 @@ declare module "fs" {
3994
3873
  * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
3995
3874
  * @param fd A file descriptor.
3996
3875
  */
3997
- export function fsync(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
3876
+ export function fsync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
3998
3877
 
3999
3878
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
4000
3879
  export namespace fsync {
@@ -4018,7 +3897,7 @@ declare module "fs" {
4018
3897
  * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
4019
3898
  * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
4020
3899
  */
4021
- export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void;
3900
+ export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, position: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void;
4022
3901
 
4023
3902
  /**
4024
3903
  * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
@@ -4026,20 +3905,20 @@ declare module "fs" {
4026
3905
  * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
4027
3906
  * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
4028
3907
  */
4029
- export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void;
3908
+ export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void;
4030
3909
 
4031
3910
  /**
4032
3911
  * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
4033
3912
  * @param fd A file descriptor.
4034
3913
  * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
4035
3914
  */
4036
- export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void;
3915
+ export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void;
4037
3916
 
4038
3917
  /**
4039
3918
  * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
4040
3919
  * @param fd A file descriptor.
4041
3920
  */
4042
- export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void;
3921
+ export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void;
4043
3922
 
4044
3923
  /**
4045
3924
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
@@ -4048,7 +3927,7 @@ declare module "fs" {
4048
3927
  * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
4049
3928
  * @param encoding The expected string encoding.
4050
3929
  */
4051
- export function write(fd: number, string: any, position: number | undefined | null, encoding: string | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
3930
+ export function write(fd: number, string: any, position: number | undefined | null, encoding: string | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
4052
3931
 
4053
3932
  /**
4054
3933
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
@@ -4056,14 +3935,14 @@ declare module "fs" {
4056
3935
  * @param string A string to write. If something other than a string is supplied it will be coerced to a string.
4057
3936
  * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
4058
3937
  */
4059
- export function write(fd: number, string: any, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
3938
+ export function write(fd: number, string: any, position: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
4060
3939
 
4061
3940
  /**
4062
3941
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
4063
3942
  * @param fd A file descriptor.
4064
3943
  * @param string A string to write. If something other than a string is supplied it will be coerced to a string.
4065
3944
  */
4066
- export function write(fd: number, string: any, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
3945
+ export function write(fd: number, string: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
4067
3946
 
4068
3947
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
4069
3948
  export namespace write {
@@ -4112,7 +3991,7 @@ declare module "fs" {
4112
3991
  * @param length The number of bytes to read.
4113
3992
  * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
4114
3993
  */
4115
- export function read<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback?: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void;
3994
+ export function read<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void): void;
4116
3995
 
4117
3996
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
4118
3997
  export namespace read {
@@ -4143,7 +4022,7 @@ declare module "fs" {
4143
4022
  * @param options An object that may contain an optional flag.
4144
4023
  * If a flag is not provided, it defaults to `'r'`.
4145
4024
  */
4146
- export function readFile(path: PathLike | number, options: { encoding?: null; flag?: string; } | undefined | null, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void;
4025
+ export function readFile(path: PathLike | number, options: { encoding?: null; flag?: string; } | undefined | null, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
4147
4026
 
4148
4027
  /**
4149
4028
  * Asynchronously reads the entire contents of a file.
@@ -4153,7 +4032,7 @@ declare module "fs" {
4153
4032
  * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
4154
4033
  * If a flag is not provided, it defaults to `'r'`.
4155
4034
  */
4156
- export function readFile(path: PathLike | number, options: { encoding: string; flag?: string; } | string, callback: (err: NodeJS.ErrnoException | null, data: string) => void): void;
4035
+ export function readFile(path: PathLike | number, options: { encoding: string; flag?: string; } | string, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
4157
4036
 
4158
4037
  /**
4159
4038
  * Asynchronously reads the entire contents of a file.
@@ -4163,14 +4042,14 @@ declare module "fs" {
4163
4042
  * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
4164
4043
  * If a flag is not provided, it defaults to `'r'`.
4165
4044
  */
4166
- export function readFile(path: PathLike | number, options: { encoding?: string | null; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void): void;
4045
+ export function readFile(path: PathLike | number, options: { encoding?: string | null; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException, data: string | Buffer) => void): void;
4167
4046
 
4168
4047
  /**
4169
4048
  * Asynchronously reads the entire contents of a file.
4170
4049
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
4171
4050
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
4172
4051
  */
4173
- export function readFile(path: PathLike | number, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void;
4052
+ export function readFile(path: PathLike | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
4174
4053
 
4175
4054
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
4176
4055
  export namespace readFile {
@@ -4245,7 +4124,7 @@ declare module "fs" {
4245
4124
  * If `mode` is a string, it is parsed as an octal integer.
4246
4125
  * If `flag` is not supplied, the default of `'w'` is used.
4247
4126
  */
4248
- export function writeFile(path: PathLike | number, data: any, options: { encoding?: string | null; mode?: number | string; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void;
4127
+ export function writeFile(path: PathLike | number, data: any, options: { encoding?: string | null; mode?: number | string; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
4249
4128
 
4250
4129
  /**
4251
4130
  * Asynchronously writes data to a file, replacing the file if it already exists.
@@ -4254,7 +4133,7 @@ declare module "fs" {
4254
4133
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
4255
4134
  * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
4256
4135
  */
4257
- export function writeFile(path: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void;
4136
+ export function writeFile(path: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
4258
4137
 
4259
4138
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
4260
4139
  export namespace writeFile {
@@ -4299,7 +4178,7 @@ declare module "fs" {
4299
4178
  * If `mode` is a string, it is parsed as an octal integer.
4300
4179
  * If `flag` is not supplied, the default of `'a'` is used.
4301
4180
  */
4302
- export function appendFile(file: PathLike | number, data: any, options: { encoding?: string | null, mode?: string | number, flag?: string } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void;
4181
+ export function appendFile(file: PathLike | number, data: any, options: { encoding?: string | null, mode?: string | number, flag?: string } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
4303
4182
 
4304
4183
  /**
4305
4184
  * Asynchronously append data to a file, creating the file if it does not exist.
@@ -4308,7 +4187,7 @@ declare module "fs" {
4308
4187
  * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
4309
4188
  * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
4310
4189
  */
4311
- export function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void;
4190
+ export function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
4312
4191
 
4313
4192
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
4314
4193
  export namespace appendFile {
@@ -4562,14 +4441,14 @@ declare module "fs" {
4562
4441
  * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
4563
4442
  * URL support is _experimental_.
4564
4443
  */
4565
- export function access(path: PathLike, mode: number | undefined, callback: (err: NodeJS.ErrnoException | null) => void): void;
4444
+ export function access(path: PathLike, mode: number | undefined, callback: (err: NodeJS.ErrnoException) => void): void;
4566
4445
 
4567
4446
  /**
4568
4447
  * Asynchronously tests a user's permissions for the file specified by path.
4569
4448
  * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
4570
4449
  * URL support is _experimental_.
4571
4450
  */
4572
- export function access(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
4451
+ export function access(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
4573
4452
 
4574
4453
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
4575
4454
  export namespace access {
@@ -4616,14 +4495,13 @@ declare module "fs" {
4616
4495
  mode?: number;
4617
4496
  autoClose?: boolean;
4618
4497
  start?: number;
4619
- highWaterMark?: number;
4620
4498
  }): WriteStream;
4621
4499
 
4622
4500
  /**
4623
4501
  * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
4624
4502
  * @param fd A file descriptor.
4625
4503
  */
4626
- export function fdatasync(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
4504
+ export function fdatasync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
4627
4505
 
4628
4506
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
4629
4507
  export namespace fdatasync {
@@ -4649,7 +4527,7 @@ declare module "fs" {
4649
4527
  * @param src A path to the source file.
4650
4528
  * @param dest A path to the destination file.
4651
4529
  */
4652
- export function copyFile(src: PathLike, dest: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
4530
+ export function copyFile(src: PathLike, dest: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
4653
4531
  /**
4654
4532
  * Asynchronously copies src to dest. By default, dest is overwritten if it already exists.
4655
4533
  * No arguments other than a possible exception are given to the callback function.
@@ -4660,7 +4538,7 @@ declare module "fs" {
4660
4538
  * @param dest A path to the destination file.
4661
4539
  * @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists.
4662
4540
  */
4663
- export function copyFile(src: PathLike, dest: PathLike, flags: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
4541
+ export function copyFile(src: PathLike, dest: PathLike, flags: number, callback: (err: NodeJS.ErrnoException) => void): void;
4664
4542
 
4665
4543
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
4666
4544
  export namespace copyFile {
@@ -4755,7 +4633,7 @@ declare module "path" {
4755
4633
  /**
4756
4634
  * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
4757
4635
  *
4758
- * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
4636
+ * Starting from leftmost {from} paramter, resolves {to} to an absolute path.
4759
4637
  *
4760
4638
  * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.
4761
4639
  *
@@ -4797,11 +4675,11 @@ declare module "path" {
4797
4675
  /**
4798
4676
  * The platform-specific file separator. '\\' or '/'.
4799
4677
  */
4800
- export var sep: '\\' | '/';
4678
+ export var sep: string;
4801
4679
  /**
4802
4680
  * The platform-specific file delimiter. ';' or ':'.
4803
4681
  */
4804
- export var delimiter: ';' | ':';
4682
+ export var delimiter: string;
4805
4683
  /**
4806
4684
  * Returns an object from a path string - the opposite of format().
4807
4685
  *
@@ -4956,7 +4834,7 @@ declare module "tls" {
4956
4834
  * An array of strings or a Buffer naming possible NPN protocols.
4957
4835
  * (Protocols should be ordered by their priority.)
4958
4836
  */
4959
- NPNProtocols?: ReadonlyArray<string> | ReadonlyArray<Buffer> | ReadonlyArray<Uint8Array> | Buffer | Uint8Array,
4837
+ NPNProtocols?: string[] | Buffer,
4960
4838
  /**
4961
4839
  * An array of strings or a Buffer naming possible ALPN protocols.
4962
4840
  * (Protocols should be ordered by their priority.) When the server
@@ -4964,7 +4842,7 @@ declare module "tls" {
4964
4842
  * precedence over NPN and the server does not send an NPN extension
4965
4843
  * to the client.
4966
4844
  */
4967
- ALPNProtocols?: ReadonlyArray<string> | ReadonlyArray<Buffer> | ReadonlyArray<Uint8Array> | Buffer | Uint8Array,
4845
+ ALPNProtocols?: string[] | Buffer,
4968
4846
  /**
4969
4847
  * SNICallback(servername, cb) <Function> A function that will be
4970
4848
  * called if the client supports SNI TLS extension. Two arguments
@@ -5019,14 +4897,6 @@ declare module "tls" {
5019
4897
  getPeerCertificate(detailed: true): DetailedPeerCertificate;
5020
4898
  getPeerCertificate(detailed?: false): PeerCertificate;
5021
4899
  getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate;
5022
- /**
5023
- * Returns a string containing the negotiated SSL/TLS protocol version of the current connection.
5024
- * The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process.
5025
- * The value `null` will be returned for server sockets or disconnected client sockets.
5026
- * See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information.
5027
- * @returns negotiated SSL/TLS protocol version of the current connection
5028
- */
5029
- getProtocol(): string | null;
5030
4900
  /**
5031
4901
  * Could be used to speed up handshake establishment when reconnecting to the server.
5032
4902
  * @returns ASN.1 encoded TLS session or undefined if none was negotiated.
@@ -5048,7 +4918,7 @@ declare module "tls" {
5048
4918
  * @param callback - callback(err) will be executed with null as err, once the renegotiation
5049
4919
  * is successfully completed.
5050
4920
  */
5051
- renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): any;
4921
+ renegotiate(options: TlsOptions, callback: (err: Error | null) => void): any;
5052
4922
  /**
5053
4923
  * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).
5054
4924
  * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by
@@ -5091,15 +4961,30 @@ declare module "tls" {
5091
4961
  prependOnceListener(event: "secureConnect", listener: () => void): this;
5092
4962
  }
5093
4963
 
5094
- export interface TlsOptions extends SecureContextOptions {
5095
- handshakeTimeout?: number;
4964
+ export interface TlsOptions {
4965
+ host?: string;
4966
+ port?: number;
4967
+ pfx?: string | Buffer[];
4968
+ key?: string | string[] | Buffer | any[];
4969
+ passphrase?: string;
4970
+ cert?: string | string[] | Buffer | Buffer[];
4971
+ ca?: string | string[] | Buffer | Buffer[];
4972
+ crl?: string | string[];
4973
+ ciphers?: string;
4974
+ honorCipherOrder?: boolean;
5096
4975
  requestCert?: boolean;
5097
4976
  rejectUnauthorized?: boolean;
5098
- NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array;
5099
- ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array;
4977
+ NPNProtocols?: string[] | Buffer;
5100
4978
  SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void;
4979
+ ecdhCurve?: string;
4980
+ dhparam?: string | Buffer;
4981
+ handshakeTimeout?: number;
4982
+ ALPNProtocols?: string[] | Buffer;
5101
4983
  sessionTimeout?: number;
5102
4984
  ticketKeys?: Buffer;
4985
+ sessionIdContext?: string;
4986
+ secureProtocol?: string;
4987
+ secureOptions?: number;
5103
4988
  }
5104
4989
 
5105
4990
  export interface ConnectionOptions extends SecureContextOptions {
@@ -5108,8 +4993,8 @@ declare module "tls" {
5108
4993
  path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
5109
4994
  socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket
5110
4995
  rejectUnauthorized?: boolean; // Defaults to true
5111
- NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array;
5112
- ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array;
4996
+ NPNProtocols?: Array<string | Buffer>;
4997
+ ALPNProtocols?: Array<string | Buffer>;
5113
4998
  checkServerIdentity?: typeof checkServerIdentity;
5114
4999
  servername?: string; // SNI TLS Extension
5115
5000
  session?: Buffer;
@@ -5238,7 +5123,6 @@ declare module "tls" {
5238
5123
  }
5239
5124
 
5240
5125
  declare module "crypto" {
5241
- import * as stream from "stream";
5242
5126
  export interface Certificate {
5243
5127
  exportChallenge(spkac: string | Buffer): Buffer;
5244
5128
  exportPublicKey(spkac: string | Buffer): Buffer;
@@ -5260,9 +5144,7 @@ declare module "crypto" {
5260
5144
  crl: string | string[];
5261
5145
  ciphers: string;
5262
5146
  }
5263
- /** @deprecated since v0.11.13 - use tls.SecureContext instead. */
5264
5147
  export interface Credentials { context?: any; }
5265
- /** @deprecated since v0.11.13 - use tls.createSecureContext instead. */
5266
5148
  export function createCredentials(details: CredentialDetails): Credentials;
5267
5149
  export function createHash(algorithm: string): Hash;
5268
5150
  export function createHmac(algorithm: string, key: string | Buffer): Hmac;
@@ -5273,13 +5155,13 @@ declare module "crypto" {
5273
5155
  type HexBase64BinaryEncoding = "binary" | "base64" | "hex";
5274
5156
  type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
5275
5157
 
5276
- export interface Hash extends stream.Transform {
5158
+ export interface Hash extends NodeJS.ReadWriteStream {
5277
5159
  update(data: string | Buffer | DataView): Hash;
5278
5160
  update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Hash;
5279
5161
  digest(): Buffer;
5280
5162
  digest(encoding: HexBase64Latin1Encoding): string;
5281
5163
  }
5282
- export interface Hmac extends stream.Transform {
5164
+ export interface Hmac extends NodeJS.ReadWriteStream {
5283
5165
  update(data: string | Buffer | DataView): Hmac;
5284
5166
  update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
5285
5167
  digest(): Buffer;
@@ -5287,36 +5169,36 @@ declare module "crypto" {
5287
5169
  }
5288
5170
  export function createCipher(algorithm: string, password: any): Cipher;
5289
5171
  export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
5290
- export interface Cipher extends stream.Transform {
5172
+ export interface Cipher extends NodeJS.ReadWriteStream {
5291
5173
  update(data: Buffer | DataView): Buffer;
5292
5174
  update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
5293
5175
  update(data: Buffer | DataView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
5294
5176
  update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string;
5295
5177
  final(): Buffer;
5296
5178
  final(output_encoding: string): string;
5297
- setAutoPadding(auto_padding?: boolean): this;
5179
+ setAutoPadding(auto_padding?: boolean): void;
5298
5180
  getAuthTag(): Buffer;
5299
- setAAD(buffer: Buffer): this;
5181
+ setAAD(buffer: Buffer): void;
5300
5182
  }
5301
5183
  export function createDecipher(algorithm: string, password: any): Decipher;
5302
5184
  export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
5303
- export interface Decipher extends stream.Transform {
5185
+ export interface Decipher extends NodeJS.ReadWriteStream {
5304
5186
  update(data: Buffer | DataView): Buffer;
5305
5187
  update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
5306
5188
  update(data: Buffer | DataView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;
5307
5189
  update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string;
5308
5190
  final(): Buffer;
5309
5191
  final(output_encoding: string): string;
5310
- setAutoPadding(auto_padding?: boolean): this;
5311
- setAuthTag(tag: Buffer): this;
5312
- setAAD(buffer: Buffer): this;
5192
+ setAutoPadding(auto_padding?: boolean): void;
5193
+ setAuthTag(tag: Buffer): void;
5194
+ setAAD(buffer: Buffer): void;
5313
5195
  }
5314
5196
  export function createSign(algorithm: string): Signer;
5315
5197
  export interface Signer extends NodeJS.WritableStream {
5316
5198
  update(data: string | Buffer | DataView): Signer;
5317
5199
  update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Signer;
5318
- sign(private_key: string | { key: string; passphrase?: string }): Buffer;
5319
- sign(private_key: string | { key: string; passphrase?: string }, output_format: HexBase64Latin1Encoding): string;
5200
+ sign(private_key: string | { key: string; passphrase: string }): Buffer;
5201
+ sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string;
5320
5202
  }
5321
5203
  export function createVerify(algorith: string): Verify;
5322
5204
  export interface Verify extends NodeJS.WritableStream {
@@ -5417,12 +5299,12 @@ declare module "stream" {
5417
5299
  encoding?: string;
5418
5300
  objectMode?: boolean;
5419
5301
  read?: (this: Readable, size?: number) => any;
5420
- destroy?: (error: Error | null, callback: (error?: Error) => void) => void;
5302
+ destroy?: (error?: Error) => any;
5421
5303
  }
5422
5304
 
5423
5305
  export class Readable extends Stream implements NodeJS.ReadableStream {
5424
5306
  readable: boolean;
5425
- readonly readableHighWaterMark: number;
5307
+ readableHighWaterMark: number;
5426
5308
  constructor(opts?: ReadableOptions);
5427
5309
  _read(size: number): void;
5428
5310
  read(size?: number): any;
@@ -5434,7 +5316,7 @@ declare module "stream" {
5434
5316
  unshift(chunk: any): void;
5435
5317
  wrap(oldStream: NodeJS.ReadableStream): this;
5436
5318
  push(chunk: any, encoding?: string): boolean;
5437
- _destroy(error: Error | null, callback: (error?: Error) => void): void;
5319
+ _destroy(err: Error, callback: Function): void;
5438
5320
  destroy(error?: Error): void;
5439
5321
 
5440
5322
  /**
@@ -5447,6 +5329,7 @@ declare module "stream" {
5447
5329
  * 5. error
5448
5330
  */
5449
5331
  addListener(event: string, listener: (...args: any[]) => void): this;
5332
+ addListener(event: string, listener: (...args: any[]) => void): this;
5450
5333
  addListener(event: "close", listener: () => void): this;
5451
5334
  addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
5452
5335
  addListener(event: "end", listener: () => void): this;
@@ -5500,9 +5383,9 @@ declare module "stream" {
5500
5383
  highWaterMark?: number;
5501
5384
  decodeStrings?: boolean;
5502
5385
  objectMode?: boolean;
5503
- write?: (chunk: any, encoding: string, callback: Function) => any;
5504
- writev?: (chunks: Array<{ chunk: any, encoding: string }>, callback: Function) => any;
5505
- destroy?: (error: Error | null, callback: (error?: Error) => void) => void;
5386
+ write?: (chunk: string | Buffer, encoding: string, callback: Function) => any;
5387
+ writev?: (chunks: Array<{ chunk: string | Buffer, encoding: string }>, callback: Function) => any;
5388
+ destroy?: (error?: Error) => any;
5506
5389
  final?: (callback: (error?: Error) => void) => void;
5507
5390
  }
5508
5391
 
@@ -5511,8 +5394,8 @@ declare module "stream" {
5511
5394
  readonly writableHighWaterMark: number;
5512
5395
  constructor(opts?: WritableOptions);
5513
5396
  _write(chunk: any, encoding: string, callback: (err?: Error) => void): void;
5514
- _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void;
5515
- _destroy(error: Error | null, callback: (error?: Error) => void): void;
5397
+ _writev?(chunks: Array<{chunk: any, encoding: string}>, callback: (err?: Error) => void): void;
5398
+ _destroy(err: Error, callback: Function): void;
5516
5399
  _final(callback: Function): void;
5517
5400
  write(chunk: any, cb?: Function): boolean;
5518
5401
  write(chunk: any, encoding?: string, cb?: Function): boolean;
@@ -5603,8 +5486,8 @@ declare module "stream" {
5603
5486
  readonly writableHighWaterMark: number;
5604
5487
  constructor(opts?: DuplexOptions);
5605
5488
  _write(chunk: any, encoding: string, callback: (err?: Error) => void): void;
5606
- _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void;
5607
- _destroy(error: Error | null, callback: (error?: Error) => void): void;
5489
+ _writev?(chunks: Array<{chunk: any, encoding: string}>, callback: (err?: Error) => void): void;
5490
+ _destroy(err: Error, callback: Function): void;
5608
5491
  _final(callback: Function): void;
5609
5492
  write(chunk: any, cb?: Function): boolean;
5610
5493
  write(chunk: any, encoding?: string, cb?: Function): boolean;
@@ -5617,7 +5500,7 @@ declare module "stream" {
5617
5500
  }
5618
5501
 
5619
5502
  export interface TransformOptions extends DuplexOptions {
5620
- transform?: (chunk: any, encoding: string, callback: Function) => any;
5503
+ transform?: (chunk: string | Buffer, encoding: string, callback: Function) => any;
5621
5504
  flush?: (callback: Function) => any;
5622
5505
  }
5623
5506
 
@@ -5628,13 +5511,6 @@ declare module "stream" {
5628
5511
  }
5629
5512
 
5630
5513
  export class PassThrough extends Transform { }
5631
-
5632
- interface Pipe {
5633
- close(): void;
5634
- hasRef(): boolean;
5635
- ref(): void;
5636
- unref(): void;
5637
- }
5638
5514
  }
5639
5515
 
5640
5516
  export = internal;
@@ -5648,17 +5524,18 @@ declare module "util" {
5648
5524
  export function puts(...param: any[]): void;
5649
5525
  export function print(...param: any[]): void;
5650
5526
  export function log(string: string): void;
5651
- function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
5652
- function inspect(object: any, options: InspectOptions): string;
5653
- namespace inspect {
5654
- let colors: {
5527
+ export var inspect: {
5528
+ (object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
5529
+ (object: any, options: InspectOptions): string;
5530
+ colors: {
5655
5531
  [color: string]: [number, number] | undefined
5656
- };
5657
- let styles: {
5532
+ }
5533
+ styles: {
5658
5534
  [style: string]: string | undefined
5659
- };
5660
- let defaultOptions: InspectOptions;
5661
- }
5535
+ }
5536
+ defaultOptions: InspectOptions;
5537
+ custom: symbol;
5538
+ };
5662
5539
  export function isArray(object: any): object is any[];
5663
5540
  export function isRegExp(object: any): object is RegExp;
5664
5541
  export function isDate(object: any): object is Date;
@@ -5676,72 +5553,43 @@ declare module "util" {
5676
5553
  export function isString(object: any): object is string;
5677
5554
  export function isSymbol(object: any): object is symbol;
5678
5555
  export function isUndefined(object: any): object is undefined;
5679
- export function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
5556
+ export function deprecate<T extends Function>(fn: T, message: string): T;
5680
5557
 
5681
5558
  export interface CustomPromisify<TCustom extends Function> extends Function {
5682
5559
  __promisify__: TCustom;
5683
5560
  }
5684
5561
 
5685
5562
  export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
5686
- export function callbackify<TResult>(fn: () => Promise<TResult>): (callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
5563
+ export function callbackify<TResult>(fn: () => Promise<TResult>): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
5687
5564
  export function callbackify<T1>(fn: (arg1: T1) => Promise<void>): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
5688
- export function callbackify<T1, TResult>(fn: (arg1: T1) => Promise<TResult>): (arg1: T1, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
5565
+ export function callbackify<T1, TResult>(fn: (arg1: T1) => Promise<TResult>): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
5689
5566
  export function callbackify<T1, T2>(fn: (arg1: T1, arg2: T2) => Promise<void>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
5690
- export function callbackify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2) => Promise<TResult>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
5567
+ export function callbackify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2) => Promise<TResult>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
5691
5568
  export function callbackify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void;
5692
- export function callbackify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
5569
+ export function callbackify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
5693
5570
  export function callbackify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
5694
- export function callbackify<T1, T2, T3, T4, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
5571
+ export function callbackify<T1, T2, T3, T4, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
5695
5572
  export function callbackify<T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
5696
- export function callbackify<T1, T2, T3, T4, T5, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
5573
+ export function callbackify<T1, T2, T3, T4, T5, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
5697
5574
  export function callbackify<T1, T2, T3, T4, T5, T6>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void;
5698
- 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 | null, result: TResult) => void) => void;
5575
+ 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;
5699
5576
 
5700
5577
  export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
5701
- export function promisify<TResult>(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise<TResult>;
5702
- export function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise<void>;
5703
- export function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
5704
- export function promisify<T1>(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise<void>;
5705
- 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>;
5706
- export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
5707
- 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>;
5708
- 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>;
5709
- 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>;
5710
- 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>;
5711
- 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>;
5712
- 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>;
5578
+ export function promisify<TResult>(fn: (callback: (err: Error, result: TResult) => void) => void): () => Promise<TResult>;
5579
+ export function promisify(fn: (callback: (err: Error) => void) => void): () => Promise<void>;
5580
+ export function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: Error, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
5581
+ export function promisify<T1>(fn: (arg1: T1, callback: (err: Error) => void) => void): (arg1: T1) => Promise<void>;
5582
+ export function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: Error, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
5583
+ export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err: Error) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
5584
+ 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>;
5585
+ 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>;
5586
+ 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>;
5587
+ 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>;
5588
+ 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>;
5589
+ 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>;
5713
5590
  export function promisify(fn: Function): Function;
5714
-
5715
- export class TextDecoder {
5716
- readonly encoding: string;
5717
- readonly fatal: boolean;
5718
- readonly ignoreBOM: boolean;
5719
- constructor(
5720
- encoding?: string,
5721
- options?: { fatal?: boolean; ignoreBOM?: boolean }
5722
- );
5723
- decode(
5724
- input?:
5725
- Int8Array
5726
- | Int16Array
5727
- | Int32Array
5728
- | Uint8Array
5729
- | Uint16Array
5730
- | Uint32Array
5731
- | Uint8ClampedArray
5732
- | Float32Array
5733
- | Float64Array
5734
- | DataView
5735
- | ArrayBuffer
5736
- | null,
5737
- options?: { stream?: boolean }
5738
- ): string;
5739
- }
5740
-
5741
- export class TextEncoder {
5742
- readonly encoding: string;
5743
- constructor();
5744
- encode(input?: string): Uint8Array;
5591
+ export namespace promisify {
5592
+ const custom: symbol;
5745
5593
  }
5746
5594
  }
5747
5595
 
@@ -5755,30 +5603,34 @@ declare module "assert" {
5755
5603
  expected: any;
5756
5604
  operator: string;
5757
5605
  generatedMessage: boolean;
5758
- code: 'ERR_ASSERTION';
5759
5606
 
5760
5607
  constructor(options?: {
5761
5608
  message?: string; actual?: any; expected?: any;
5762
- operator?: string; stackStartFn?: Function
5609
+ operator?: string; stackStartFunction?: Function
5763
5610
  });
5764
5611
  }
5765
5612
 
5766
- export function fail(message?: string): never;
5767
- export function fail(actual: any, expected: any, message?: string, operator?: string, stackStartFn?: Function): never;
5613
+ export function fail(message: string): void;
5614
+ export function fail(actual: any, expected: any, message?: string, operator?: string): void;
5768
5615
  export function ok(value: any, message?: string): void;
5769
5616
  export function equal(actual: any, expected: any, message?: string): void;
5770
5617
  export function notEqual(actual: any, expected: any, message?: string): void;
5771
5618
  export function deepEqual(actual: any, expected: any, message?: string): void;
5772
- export function notDeepEqual(actual: any, expected: any, message?: string): void;
5619
+ export function notDeepEqual(acutal: any, expected: any, message?: string): void;
5773
5620
  export function strictEqual(actual: any, expected: any, message?: string): void;
5774
5621
  export function notStrictEqual(actual: any, expected: any, message?: string): void;
5775
5622
  export function deepStrictEqual(actual: any, expected: any, message?: string): void;
5776
5623
  export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
5777
5624
 
5778
5625
  export function throws(block: Function, message?: string): void;
5779
- export function throws(block: Function, error: RegExp | Function, message?: string): void;
5626
+ export function throws(block: Function, error: Function, message?: string): void;
5627
+ export function throws(block: Function, error: RegExp, message?: string): void;
5628
+ export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
5629
+
5780
5630
  export function doesNotThrow(block: Function, message?: string): void;
5781
- export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
5631
+ export function doesNotThrow(block: Function, error: Function, message?: string): void;
5632
+ export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
5633
+ export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
5782
5634
 
5783
5635
  export function ifError(value: any): void;
5784
5636
  }
@@ -5790,12 +5642,12 @@ declare module "tty" {
5790
5642
  import * as net from "net";
5791
5643
 
5792
5644
  export function isatty(fd: number): boolean;
5793
- export class ReadStream extends net.Socket {
5645
+ export interface ReadStream extends net.Socket {
5794
5646
  isRaw: boolean;
5795
5647
  setRawMode(mode: boolean): void;
5796
5648
  isTTY: boolean;
5797
5649
  }
5798
- export class WriteStream extends net.Socket {
5650
+ export interface WriteStream extends net.Socket {
5799
5651
  columns: number;
5800
5652
  rows: number;
5801
5653
  isTTY: boolean;
@@ -5811,8 +5663,6 @@ declare module "domain" {
5811
5663
  remove(emitter: events.EventEmitter): void;
5812
5664
  bind(cb: (err: Error, data: any) => any): any;
5813
5665
  intercept(cb: (data: any) => any): any;
5814
- /** @deprecated since v0.11.7 - recover from failed I/O actions explicitly via error event handlers set on the domain instead. */
5815
- dispose(): void;
5816
5666
  members: any[];
5817
5667
  enter(): void;
5818
5668
  exit(): void;
@@ -5821,7 +5671,6 @@ declare module "domain" {
5821
5671
  export function create(): Domain;
5822
5672
  }
5823
5673
 
5824
- /** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
5825
5674
  declare module "constants" {
5826
5675
  export var E2BIG: number;
5827
5676
  export var EACCES: number;
@@ -5957,25 +5806,15 @@ declare module "constants" {
5957
5806
  export var WSA_E_NO_MORE: number;
5958
5807
  export var WSA_E_CANCELLED: number;
5959
5808
  export var WSAEREFUSED: number;
5960
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGHUP` instead. */
5961
5809
  export var SIGHUP: number;
5962
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGINT` instead. */
5963
5810
  export var SIGINT: number;
5964
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGILL` instead. */
5965
5811
  export var SIGILL: number;
5966
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGABRT` instead. */
5967
5812
  export var SIGABRT: number;
5968
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGFPE` instead. */
5969
5813
  export var SIGFPE: number;
5970
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGKILL` instead. */
5971
5814
  export var SIGKILL: number;
5972
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGSEGV` instead. */
5973
5815
  export var SIGSEGV: number;
5974
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGTERM` instead. */
5975
5816
  export var SIGTERM: number;
5976
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGBREAK` instead. */
5977
5817
  export var SIGBREAK: number;
5978
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGWINCH` instead. */
5979
5818
  export var SIGWINCH: number;
5980
5819
  export var SSL_OP_ALL: number;
5981
5820
  export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
@@ -6078,55 +5917,30 @@ declare module "constants" {
6078
5917
  export var W_OK: number;
6079
5918
  export var X_OK: number;
6080
5919
  export var UV_UDP_REUSEADDR: number;
6081
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGQUIT` instead. */
6082
5920
  export var SIGQUIT: number;
6083
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGTRAP` instead. */
6084
5921
  export var SIGTRAP: number;
6085
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGIOT` instead. */
6086
5922
  export var SIGIOT: number;
6087
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGBUS` instead. */
6088
5923
  export var SIGBUS: number;
6089
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGUSR1` instead. */
6090
5924
  export var SIGUSR1: number;
6091
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGUSR2` instead. */
6092
5925
  export var SIGUSR2: number;
6093
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGPIPE` instead. */
6094
5926
  export var SIGPIPE: number;
6095
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGALRM` instead. */
6096
5927
  export var SIGALRM: number;
6097
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGCHLD` instead. */
6098
5928
  export var SIGCHLD: number;
6099
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGSTKFLT` instead. */
6100
5929
  export var SIGSTKFLT: number;
6101
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGCONT` instead. */
6102
5930
  export var SIGCONT: number;
6103
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGSTOP` instead. */
6104
5931
  export var SIGSTOP: number;
6105
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGTSTP` instead. */
6106
5932
  export var SIGTSTP: number;
6107
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGTTIN` instead. */
6108
5933
  export var SIGTTIN: number;
6109
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGTTOU` instead. */
6110
5934
  export var SIGTTOU: number;
6111
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGURG` instead. */
6112
5935
  export var SIGURG: number;
6113
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGXCPU` instead. */
6114
5936
  export var SIGXCPU: number;
6115
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGXFSZ` instead. */
6116
5937
  export var SIGXFSZ: number;
6117
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGVTALRM` instead. */
6118
5938
  export var SIGVTALRM: number;
6119
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGPROF` instead. */
6120
5939
  export var SIGPROF: number;
6121
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGIO` instead. */
6122
5940
  export var SIGIO: number;
6123
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGPOLL` instead. */
6124
5941
  export var SIGPOLL: number;
6125
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGPWR` instead. */
6126
5942
  export var SIGPWR: number;
6127
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGSYS` instead. */
6128
5943
  export var SIGSYS: number;
6129
- /** @deprecated since v6.3.0 - use `os.constants.signals.SIGUNUSED` instead. */
6130
5944
  export var SIGUNUSED: number;
6131
5945
  export var defaultCoreCipherList: string;
6132
5946
  export var defaultCipherList: string;
@@ -6142,7 +5956,6 @@ declare module "process" {
6142
5956
  export = process;
6143
5957
  }
6144
5958
 
6145
- // tslint:disable-next-line:no-declare-current-package
6146
5959
  declare module "v8" {
6147
5960
  interface HeapSpaceInfo {
6148
5961
  space_name: string;
@@ -6267,23 +6080,6 @@ declare module "async_hooks" {
6267
6080
  */
6268
6081
  export function createHook(options: HookCallbacks): AsyncHook;
6269
6082
 
6270
- export interface AsyncResourceOptions {
6271
- /**
6272
- * The ID of the execution context that created this async event.
6273
- * Default: `executionAsyncId()`
6274
- */
6275
- triggerAsyncId?: number;
6276
-
6277
- /**
6278
- * Disables automatic `emitDestroy` when the object is garbage collected.
6279
- * This usually does not need to be set (even if `emitDestroy` is called
6280
- * manually), unless the resource's `asyncId` is retrieved and the
6281
- * sensitive API's `emitDestroy` is called with it.
6282
- * Default: `false`
6283
- */
6284
- requireManualDestroy?: boolean;
6285
- }
6286
-
6287
6083
  /**
6288
6084
  * The class AsyncResource was designed to be extended by the embedder's async resources.
6289
6085
  * Using this users can easily trigger the lifetime events of their own resources.
@@ -6293,12 +6089,10 @@ declare module "async_hooks" {
6293
6089
  * AsyncResource() is meant to be extended. Instantiating a
6294
6090
  * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
6295
6091
  * async_hook.executionAsyncId() is used.
6296
- * @param type The type of async event.
6297
- * @param triggerAsyncId The ID of the execution context that created
6298
- * this async event (default: `executionAsyncId()`), or an
6299
- * AsyncResourceOptions object (since 8.10)
6092
+ * @param type the name of this async resource type
6093
+ * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
6300
6094
  */
6301
- constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
6095
+ constructor(type: string, triggerAsyncId?: number)
6302
6096
 
6303
6097
  /**
6304
6098
  * Call AsyncHooks before callbacks.
@@ -6367,14 +6161,14 @@ declare module "http2" {
6367
6161
  }
6368
6162
 
6369
6163
  export interface ServerStreamFileResponseOptions {
6370
- statCheck?: (stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void | boolean;
6164
+ statCheck?: (stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void|boolean;
6371
6165
  getTrailers?: (trailers: OutgoingHttpHeaders) => void;
6372
6166
  offset?: number;
6373
6167
  length?: number;
6374
6168
  }
6375
6169
 
6376
6170
  export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
6377
- onError?: (err: NodeJS.ErrnoException | null) => void;
6171
+ onError?: (err: NodeJS.ErrnoException) => void;
6378
6172
  }
6379
6173
 
6380
6174
  export interface Http2Stream extends stream.Duplex {
@@ -6715,7 +6509,9 @@ declare module "http2" {
6715
6509
  export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { }
6716
6510
  export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { }
6717
6511
 
6718
- export interface ServerOptions extends ServerSessionOptions { }
6512
+ export interface ServerOptions extends ServerSessionOptions {
6513
+ allowHTTP1?: boolean;
6514
+ }
6719
6515
 
6720
6516
  export interface SecureServerOptions extends SecureServerSessionOptions {
6721
6517
  allowHTTP1?: boolean;
@@ -6815,8 +6611,7 @@ declare module "http2" {
6815
6611
  prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
6816
6612
  }
6817
6613
 
6818
- export class Http2ServerRequest extends stream.Readable {
6819
- private constructor();
6614
+ export interface Http2ServerRequest extends stream.Readable {
6820
6615
  headers: IncomingHttpHeaders;
6821
6616
  httpVersion: string;
6822
6617
  method: string;
@@ -6847,8 +6642,7 @@ declare module "http2" {
6847
6642
  prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
6848
6643
  }
6849
6644
 
6850
- export class Http2ServerResponse extends stream.Stream {
6851
- private constructor();
6645
+ export interface Http2ServerResponse extends events.EventEmitter {
6852
6646
  addTrailers(trailers: OutgoingHttpHeaders): void;
6853
6647
  connection: net.Socket | tls.TLSSocket;
6854
6648
  end(callback?: () => void): void;
@@ -6862,7 +6656,7 @@ declare module "http2" {
6862
6656
  readonly headersSent: boolean;
6863
6657
  removeHeader(name: string): void;
6864
6658
  sendDate: boolean;
6865
- setHeader(name: string, value: number | string | ReadonlyArray<string>): void;
6659
+ setHeader(name: string, value: number | string | string[]): void;
6866
6660
  setTimeout(msecs: number, callback?: () => void): void;
6867
6661
  socket: net.Socket | tls.TLSSocket;
6868
6662
  statusCode: number;
@@ -7372,7 +7166,7 @@ declare module "perf_hooks" {
7372
7166
  * Property buffered defaults to false.
7373
7167
  * @param options
7374
7168
  */
7375
- observe(options: { entryTypes: ReadonlyArray<string>, buffered?: boolean }): void;
7169
+ observe(options: { entryTypes: string[], buffered?: boolean }): void;
7376
7170
  }
7377
7171
 
7378
7172
  export namespace constants {