@types/node 13.13.52 → 14.0.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.
Files changed (61) hide show
  1. {node v13.13 → node}/LICENSE +0 -0
  2. node/README.md +16 -0
  3. node v13.13/ts3.6/assert.d.ts → node/assert.d.ts +8 -27
  4. node v13.13/async_hooks.d.ts → node/async_hooks.d.ts +3 -31
  5. node/base.d.ts +41 -0
  6. {node v13.13 → node}/buffer.d.ts +0 -0
  7. node v13.13/child_process.d.ts → node/child_process.d.ts +28 -32
  8. {node v13.13 → node}/cluster.d.ts +0 -0
  9. {node v13.13 → node}/console.d.ts +0 -0
  10. {node v13.13 → node}/constants.d.ts +0 -0
  11. node v13.13/crypto.d.ts → node/crypto.d.ts +83 -287
  12. node v13.13/dgram.d.ts → node/dgram.d.ts +3 -3
  13. {node v13.13 → node}/dns.d.ts +0 -0
  14. node v13.13/domain.d.ts → node/domain.d.ts +2 -2
  15. node v13.13/events.d.ts → node/events.d.ts +17 -22
  16. node/fs/promises.d.ts +539 -0
  17. node v13.13/fs.d.ts → node/fs.d.ts +272 -820
  18. node v13.13/globals.d.ts → node/globals.d.ts +15 -94
  19. node v13.13/http.d.ts → node/http.d.ts +4 -11
  20. node v13.13/http2.d.ts → node/http2.d.ts +6 -6
  21. {node v13.13 → node}/https.d.ts +0 -0
  22. node v13.13/index.d.ts → node/index.d.ts +45 -5
  23. node v13.13/inspector.d.ts → node/inspector.d.ts +7 -0
  24. node v13.13/module.d.ts → node/module.d.ts +0 -6
  25. node v13.13/net.d.ts → node/net.d.ts +3 -3
  26. node v13.13/os.d.ts → node/os.d.ts +1 -1
  27. node v13.13/package.json → node/package.json +40 -10
  28. {node v13.13 → node}/path.d.ts +0 -0
  29. node v13.13/perf_hooks.d.ts → node/perf_hooks.d.ts +74 -8
  30. {node v13.13 → node}/process.d.ts +0 -0
  31. node/punycode.d.ts +12 -0
  32. {node v13.13 → node}/querystring.d.ts +0 -0
  33. {node v13.13 → node}/readline.d.ts +0 -0
  34. node v13.13/repl.d.ts → node/repl.d.ts +5 -13
  35. node v13.13/stream.d.ts → node/stream.d.ts +27 -33
  36. node v13.13/string_decoder.d.ts → node/string_decoder.d.ts +1 -1
  37. {node v13.13 → node}/timers.d.ts +0 -0
  38. node v13.13/tls.d.ts → node/tls.d.ts +2 -2
  39. {node v13.13 → node}/trace_events.d.ts +0 -0
  40. node/ts3.2/base.d.ts +22 -0
  41. node/ts3.2/fs.d.ts +33 -0
  42. node/ts3.2/globals.d.ts +19 -0
  43. node/ts3.2/index.d.ts +8 -0
  44. node/ts3.2/util.d.ts +9 -0
  45. node/ts3.5/base.d.ts +20 -0
  46. node v13.13/ts3.6/index.d.ts → node/ts3.5/index.d.ts +4 -2
  47. node v13.13/wasi.d.ts → node/ts3.5/wasi.d.ts +1 -4
  48. node v13.13/assert.d.ts → node/ts3.7/assert.d.ts +9 -54
  49. node v13.13/base.d.ts → node/ts3.7/base.d.ts +2 -1
  50. node/ts3.7/index.d.ts +5 -0
  51. {node v13.13 → node}/tty.d.ts +0 -0
  52. node v13.13/url.d.ts → node/url.d.ts +1 -7
  53. node v13.13/util.d.ts → node/util.d.ts +14 -30
  54. {node v13.13 → node}/v8.d.ts +0 -0
  55. node v13.13/vm.d.ts → node/vm.d.ts +2 -4
  56. node v13.13/worker_threads.d.ts → node/worker_threads.d.ts +3 -21
  57. node v13.13/zlib.d.ts → node/zlib.d.ts +0 -1
  58. node v13.13/README.md +0 -16
  59. node v13.13/globals.global.d.ts +0 -1
  60. node v13.13/punycode.d.ts +0 -68
  61. node v13.13/ts3.6/base.d.ts +0 -60
@@ -62,7 +62,7 @@ interface Console {
62
62
  * This method does not display anything unless used in the inspector.
63
63
  * Prints to `stdout` the array `array` formatted as a table.
64
64
  */
65
- table(tabularData: any, properties?: ReadonlyArray<string>): void;
65
+ table(tabularData: any, properties?: string[]): void;
66
66
  /**
67
67
  * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
68
68
  */
@@ -123,11 +123,6 @@ interface String {
123
123
  trimLeft(): string;
124
124
  /** Removes whitespace from the right end of a string. */
125
125
  trimRight(): string;
126
-
127
- /** Returns a copy with leading whitespace removed. */
128
- trimStart(): string;
129
- /** Returns a copy with trailing whitespace removed. */
130
- trimEnd(): string;
131
126
  }
132
127
 
133
128
  interface ImportMeta {
@@ -146,6 +141,7 @@ interface RequireResolve extends NodeJS.RequireResolve {}
146
141
  interface NodeModule extends NodeJS.Module {}
147
142
 
148
143
  declare var process: NodeJS.Process;
144
+ declare var global: NodeJS.Global;
149
145
  declare var console: Console;
150
146
 
151
147
  declare var __filename: string;
@@ -220,7 +216,7 @@ declare class Buffer extends Uint8Array {
220
216
  * @param array The octets to store.
221
217
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
222
218
  */
223
- constructor(array: ReadonlyArray<any>);
219
+ constructor(array: any[]);
224
220
  /**
225
221
  * Copies the passed {buffer} data onto a new {Buffer} instance.
226
222
  *
@@ -241,7 +237,7 @@ declare class Buffer extends Uint8Array {
241
237
  * Creates a new Buffer using the passed {data}
242
238
  * @param data data to create a new Buffer
243
239
  */
244
- static from(data: ReadonlyArray<number>): Buffer;
240
+ static from(data: number[]): Buffer;
245
241
  static from(data: Uint8Array): Buffer;
246
242
  /**
247
243
  * Creates a new buffer containing the coerced value of an object
@@ -295,7 +291,7 @@ declare class Buffer extends Uint8Array {
295
291
  * @param totalLength Total length of the buffers when concatenated.
296
292
  * 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.
297
293
  */
298
- static concat(list: ReadonlyArray<Uint8Array>, totalLength?: number): Buffer;
294
+ static concat(list: Uint8Array[], totalLength?: number): Buffer;
299
295
  /**
300
296
  * The same as buf1.compare(buf2).
301
297
  */
@@ -331,7 +327,7 @@ declare class Buffer extends Uint8Array {
331
327
  write(string: string, encoding?: BufferEncoding): number;
332
328
  write(string: string, offset: number, encoding?: BufferEncoding): number;
333
329
  write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
334
- toString(encoding?: string, start?: number, end?: number): string;
330
+ toString(encoding?: BufferEncoding, start?: number, end?: number): string;
335
331
  toJSON(): { type: 'Buffer'; data: number[] };
336
332
  equals(otherBuffer: Uint8Array): boolean;
337
333
  compare(
@@ -411,17 +407,6 @@ declare class Buffer extends Uint8Array {
411
407
  values(): IterableIterator<number>;
412
408
  }
413
409
 
414
- interface Buffer extends Uint8Array {
415
- readBigUInt64BE(offset?: number): bigint;
416
- readBigUInt64LE(offset?: number): bigint;
417
- readBigInt64BE(offset?: number): bigint;
418
- readBigInt64LE(offset?: number): bigint;
419
- writeBigInt64BE(value: bigint, offset?: number): number;
420
- writeBigInt64LE(value: bigint, offset?: number): number;
421
- writeBigUInt64BE(value: bigint, offset?: number): number;
422
- writeBigUInt64LE(value: bigint, offset?: number): number;
423
- }
424
-
425
410
  /*----------------------------------------------*
426
411
  * *
427
412
  * GLOBAL INTERFACES *
@@ -587,7 +572,7 @@ declare namespace NodeJS {
587
572
  interface ReadableStream extends EventEmitter {
588
573
  readable: boolean;
589
574
  read(size?: number): string | Buffer;
590
- setEncoding(encoding: string): this;
575
+ setEncoding(encoding: BufferEncoding): this;
591
576
  pause(): this;
592
577
  resume(): this;
593
578
  isPaused(): boolean;
@@ -601,10 +586,10 @@ declare namespace NodeJS {
601
586
  interface WritableStream extends EventEmitter {
602
587
  writable: boolean;
603
588
  write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
604
- write(str: string, encoding?: string, cb?: (err?: Error | null) => void): boolean;
589
+ write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
605
590
  end(cb?: () => void): void;
606
591
  end(data: string | Uint8Array, cb?: () => void): void;
607
- end(str: string, encoding?: string, cb?: () => void): void;
592
+ end(str: string, encoding?: BufferEncoding, cb?: () => void): void;
608
593
  }
609
594
 
610
595
  interface ReadWriteStream extends ReadableStream, WritableStream { }
@@ -696,7 +681,6 @@ declare namespace NodeJS {
696
681
 
697
682
  interface HRTime {
698
683
  (time?: [number, number]): [number, number];
699
- bigint(): bigint;
700
684
  }
701
685
 
702
686
  interface ProcessReport {
@@ -783,32 +767,6 @@ declare namespace NodeJS {
783
767
  voluntaryContextSwitches: number;
784
768
  }
785
769
 
786
- interface EmitWarningOptions {
787
- /**
788
- * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted.
789
- *
790
- * @default 'Warning'
791
- */
792
- type?: string;
793
-
794
- /**
795
- * A unique identifier for the warning instance being emitted.
796
- */
797
- code?: string;
798
-
799
- /**
800
- * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
801
- *
802
- * @default process.emitWarning
803
- */
804
- ctor?: Function;
805
-
806
- /**
807
- * Additional text to include with the error.
808
- */
809
- detail?: string;
810
- }
811
-
812
770
  interface Process extends EventEmitter {
813
771
  /**
814
772
  * Can also be a tty.WriteStream, not typed due to limitation.s
@@ -824,26 +782,11 @@ declare namespace NodeJS {
824
782
  argv0: string;
825
783
  execArgv: string[];
826
784
  execPath: string;
827
- abort(): never;
785
+ abort(): void;
828
786
  chdir(directory: string): void;
829
787
  cwd(): string;
830
788
  debugPort: number;
831
-
832
- /**
833
- * The `process.emitWarning()` method can be used to emit custom or application specific process warnings.
834
- *
835
- * These can be listened for by adding a handler to the `'warning'` event.
836
- *
837
- * @param warning The warning to emit.
838
- * @param type When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. Default: `'Warning'`.
839
- * @param code A unique identifier for the warning instance being emitted.
840
- * @param ctor When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. Default: `process.emitWarning`.
841
- */
842
- emitWarning(warning: string | Error, ctor?: Function): void;
843
- emitWarning(warning: string | Error, type?: string, ctor?: Function): void;
844
- emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void;
845
- emitWarning(warning: string | Error, options?: EmitWarningOptions): void;
846
-
789
+ emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
847
790
  env: ProcessEnv;
848
791
  exit(code?: number): never;
849
792
  exitCode?: number;
@@ -856,7 +799,7 @@ declare namespace NodeJS {
856
799
  getegid(): number;
857
800
  setegid(id: number | string): void;
858
801
  getgroups(): number[];
859
- setgroups(groups: ReadonlyArray<string | number>): void;
802
+ setgroups(groups: Array<string | number>): void;
860
803
  setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
861
804
  hasUncaughtExceptionCaptureCallback(): boolean;
862
805
  version: string;
@@ -893,7 +836,6 @@ declare namespace NodeJS {
893
836
  title: string;
894
837
  arch: string;
895
838
  platform: Platform;
896
- mainModule?: Module;
897
839
  memoryUsage(): MemoryUsage;
898
840
  cpuUsage(previousValue?: CpuUsage): CpuUsage;
899
841
  nextTick(callback: Function, ...args: any[]): void;
@@ -911,7 +853,7 @@ declare namespace NodeJS {
911
853
  /**
912
854
  * Can only be set if not in worker thread.
913
855
  */
914
- umask(mask?: string | number): number;
856
+ umask(mask: number): number;
915
857
  uptime(): number;
916
858
  hrtime: HRTime;
917
859
  domain: Domain;
@@ -1047,7 +989,6 @@ declare namespace NodeJS {
1047
989
  Float32Array: typeof Float32Array;
1048
990
  Float64Array: typeof Float64Array;
1049
991
  Function: typeof Function;
1050
- GLOBAL: Global;
1051
992
  Infinity: typeof Infinity;
1052
993
  Int16Array: typeof Int16Array;
1053
994
  Int32Array: typeof Int32Array;
@@ -1091,10 +1032,6 @@ declare namespace NodeJS {
1091
1032
  parseFloat: typeof parseFloat;
1092
1033
  parseInt: typeof parseInt;
1093
1034
  process: Process;
1094
- /**
1095
- * @deprecated Use `global`.
1096
- */
1097
- root: Global;
1098
1035
  setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => Immediate;
1099
1036
  setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
1100
1037
  setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
@@ -1126,21 +1063,11 @@ declare namespace NodeJS {
1126
1063
  refresh(): this;
1127
1064
  }
1128
1065
 
1129
- type TypedArray =
1130
- | Uint8Array
1131
- | Uint8ClampedArray
1132
- | Uint16Array
1133
- | Uint32Array
1134
- | Int8Array
1135
- | Int16Array
1136
- | Int32Array
1137
- | BigUint64Array
1138
- | BigInt64Array
1139
- | Float32Array
1140
- | Float64Array;
1066
+ type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
1141
1067
  type ArrayBufferView = TypedArray | DataView;
1142
1068
 
1143
1069
  interface Require {
1070
+ /* tslint:disable-next-line:callable-types */
1144
1071
  (id: string): any;
1145
1072
  resolve: RequireResolve;
1146
1073
  cache: Dict<NodeModule>;
@@ -1167,12 +1094,6 @@ declare namespace NodeJS {
1167
1094
  id: string;
1168
1095
  filename: string;
1169
1096
  loaded: boolean;
1170
- /**
1171
- * @since 11.14.0
1172
- *
1173
- * The directory name of the module. This is usually the same as the path.dirname() of the module.id.
1174
- */
1175
- path: string;
1176
1097
  parent: Module | null;
1177
1098
  children: Module[];
1178
1099
  paths: string[];
@@ -16,8 +16,6 @@ declare module "http" {
16
16
  'access-control-allow-origin'?: string;
17
17
  'access-control-expose-headers'?: string;
18
18
  'access-control-max-age'?: string;
19
- 'access-control-request-headers'?: string;
20
- 'access-control-request-method'?: string;
21
19
  'age'?: string;
22
20
  'allow'?: string;
23
21
  'alt-svc'?: string;
@@ -33,7 +31,6 @@ declare module "http" {
33
31
  'content-type'?: string;
34
32
  'cookie'?: string;
35
33
  'date'?: string;
36
- 'etag'?: string;
37
34
  'expect'?: string;
38
35
  'expires'?: string;
39
36
  'forwarded'?: string;
@@ -45,7 +42,6 @@ declare module "http" {
45
42
  'if-unmodified-since'?: string;
46
43
  'last-modified'?: string;
47
44
  'location'?: string;
48
- 'origin'?: string;
49
45
  'pragma'?: string;
50
46
  'proxy-authenticate'?: string;
51
47
  'proxy-authorization'?: string;
@@ -162,13 +158,13 @@ declare module "http" {
162
158
  constructor();
163
159
 
164
160
  setTimeout(msecs: number, callback?: () => void): this;
165
- setHeader(name: string, value: number | string | ReadonlyArray<string>): void;
161
+ setHeader(name: string, value: number | string | string[]): void;
166
162
  getHeader(name: string): number | string | string[] | undefined;
167
163
  getHeaders(): OutgoingHttpHeaders;
168
164
  getHeaderNames(): string[];
169
165
  hasHeader(name: string): boolean;
170
166
  removeHeader(name: string): void;
171
- addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
167
+ addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void;
172
168
  flushHeaders(): void;
173
169
  }
174
170
 
@@ -199,14 +195,11 @@ declare module "http" {
199
195
  rawHeaders: string[];
200
196
  }
201
197
 
202
- // https://github.com/nodejs/node/blob/v13.14.0/lib/_http_client.js#L86
198
+ // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77
203
199
  class ClientRequest extends OutgoingMessage {
204
- /**
205
- * @deprecate Use `socket` instead.
206
- */
207
200
  connection: Socket;
208
201
  socket: Socket;
209
- aborted: boolean;
202
+ aborted: number;
210
203
 
211
204
  constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
212
205
 
@@ -356,7 +356,7 @@ declare module "http2" {
356
356
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
357
357
 
358
358
  emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
359
- emit(event: "origin", origins: ReadonlyArray<string>): boolean;
359
+ emit(event: "origin", origins: string[]): boolean;
360
360
  emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
361
361
  emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
362
362
  emit(event: string | symbol, ...args: any[]): boolean;
@@ -571,7 +571,7 @@ declare module "http2" {
571
571
  }
572
572
 
573
573
  export class Http2ServerRequest extends stream.Readable {
574
- constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray<string>);
574
+ constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: string[]);
575
575
 
576
576
  readonly aborted: boolean;
577
577
  readonly authority: string;
@@ -638,7 +638,7 @@ declare module "http2" {
638
638
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
639
639
  }
640
640
 
641
- export class Http2ServerResponse extends stream.Writable {
641
+ export class Http2ServerResponse extends stream.Stream {
642
642
  constructor(stream: ServerHttp2Stream);
643
643
 
644
644
  readonly connection: net.Socket | tls.TLSSocket;
@@ -652,16 +652,16 @@ declare module "http2" {
652
652
  addTrailers(trailers: OutgoingHttpHeaders): void;
653
653
  end(callback?: () => void): void;
654
654
  end(data: string | Uint8Array, callback?: () => void): void;
655
- end(data: string | Uint8Array, encoding: string, callback?: () => void): void;
655
+ end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): void;
656
656
  getHeader(name: string): string;
657
657
  getHeaderNames(): string[];
658
658
  getHeaders(): OutgoingHttpHeaders;
659
659
  hasHeader(name: string): boolean;
660
660
  removeHeader(name: string): void;
661
- setHeader(name: string, value: number | string | ReadonlyArray<string>): void;
661
+ setHeader(name: string, value: number | string | string[]): void;
662
662
  setTimeout(msecs: number, callback?: () => void): void;
663
663
  write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean;
664
- write(chunk: string | Uint8Array, encoding: string, callback?: (err: Error) => void): boolean;
664
+ write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean;
665
665
  writeContinue(): void;
666
666
  writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
667
667
  writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this;
File without changes
@@ -1,16 +1,19 @@
1
- // Type definitions for non-npm package Node.js 13.13
1
+ // Type definitions for non-npm package Node.js 14.0
2
2
  // Project: http://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
5
5
  // Alberto Schiabel <https://github.com/jkomyno>
6
+ // Alexander T. <https://github.com/a-tarasyuk>
6
7
  // Alvis HT Tang <https://github.com/alvis>
7
8
  // Andrew Makarov <https://github.com/r3nya>
8
9
  // Benjamin Toueg <https://github.com/btoueg>
10
+ // Bruno Scheufler <https://github.com/brunoscheufler>
9
11
  // Chigozirim C. <https://github.com/smac89>
10
12
  // Christian Vaagland Tellnes <https://github.com/tellnes>
11
13
  // David Junger <https://github.com/touffy>
12
14
  // Deividas Bakanas <https://github.com/DeividasBakanas>
13
15
  // Eugene Y. Q. Shen <https://github.com/eyqs>
16
+ // Flarna <https://github.com/Flarna>
14
17
  // Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
15
18
  // Hoàng Văn Khải <https://github.com/KSXGitHub>
16
19
  // Huw <https://github.com/hoo29>
@@ -20,6 +23,7 @@
20
23
  // Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
21
24
  // Mohsen Azimi <https://github.com/mohsen1>
22
25
  // Nicolas Even <https://github.com/n-e>
26
+ // Nicolas Voigt <https://github.com/octo-sniffle>
23
27
  // Nikita Galkin <https://github.com/galkin>
24
28
  // Parambir Singh <https://github.com/parambirs>
25
29
  // Sebastian Silbermann <https://github.com/eps1lon>
@@ -29,6 +33,7 @@
29
33
  // wwwy3y3 <https://github.com/wwwy3y3>
30
34
  // Samuel Ainsworth <https://github.com/samuela>
31
35
  // Kyle Uehlein <https://github.com/kuehlein>
36
+ // Jordi Oliveras Rovira <https://github.com/j-oliveras>
32
37
  // Thanik Bhongbhibhat <https://github.com/bhongy>
33
38
  // Marcin Kopacz <https://github.com/chyzwar>
34
39
  // Trivikram Kamat <https://github.com/trivikr>
@@ -38,11 +43,46 @@
38
43
  // ExE Boss <https://github.com/ExE-Boss>
39
44
  // Surasak Chaisurin <https://github.com/Ryan-Willpower>
40
45
  // Piotr Błażejewicz <https://github.com/peterblazejewicz>
41
- // Jason Kwok <https://github.com/JasonHK>
42
46
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
43
47
 
44
- // NOTE: These definitions support NodeJS and TypeScript 3.7.
45
- // This isn't strictly needed since 3.7 has the assert module, but this way we're consistent.
46
- // Typically type modificatons should be made in base.d.ts instead of here
48
+ // NOTE: These definitions support NodeJS and TypeScript 3.5.
47
49
 
50
+ // NOTE: TypeScript version-specific augmentations can be found in the following paths:
51
+ // - ~/base.d.ts - Shared definitions common to all TypeScript versions
52
+ // - ~/index.d.ts - Definitions specific to TypeScript 2.8
53
+ // - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5
54
+
55
+ // NOTE: Augmentations for TypeScript 3.5 and later should use individual files for overrides
56
+ // within the respective ~/ts3.5 (or later) folder. However, this is disallowed for versions
57
+ // prior to TypeScript 3.5, so the older definitions will be found here.
58
+
59
+ // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
48
60
  /// <reference path="base.d.ts" />
61
+
62
+ // We can't include assert.d.ts in base.d.ts, as it'll cause duplication errors in +ts3.7
63
+ /// <reference path="assert.d.ts" />
64
+
65
+ // Forward-declarations for needed types from es2015 and later (in case users are using `--lib es5`)
66
+ // Empty interfaces are used here which merge fine with the real declarations in the lib XXX files
67
+ // just to ensure the names are known and node typings can be used without importing these libs.
68
+ // if someone really needs these types the libs need to be added via --lib or in tsconfig.json
69
+ interface AsyncIterable<T> { }
70
+ interface IterableIterator<T> { }
71
+ interface AsyncIterableIterator<T> {}
72
+ interface SymbolConstructor {
73
+ readonly asyncIterator: symbol;
74
+ }
75
+ declare var Symbol: SymbolConstructor;
76
+ // even this is just a forward declaration some properties are added otherwise
77
+ // it would be allowed to pass anything to e.g. Buffer.from()
78
+ interface SharedArrayBuffer {
79
+ readonly byteLength: number;
80
+ slice(begin?: number, end?: number): SharedArrayBuffer;
81
+ }
82
+
83
+ declare module "util" {
84
+ namespace types {
85
+ function isBigInt64Array(value: any): boolean;
86
+ function isBigUint64Array(value: any): boolean;
87
+ }
88
+ }
@@ -3031,4 +3031,11 @@ declare module "inspector" {
3031
3031
  * Return the URL of the active inspector, or `undefined` if there is none.
3032
3032
  */
3033
3033
  function url(): string | undefined;
3034
+
3035
+ /**
3036
+ * Blocks until a client (existing or connected later) has sent
3037
+ * `Runtime.runIfWaitingForDebugger` command.
3038
+ * An exception will be thrown if there is no active inspector.
3039
+ */
3040
+ function waitForDebugger(): void;
3034
3041
  }
@@ -7,9 +7,6 @@ declare module "module" {
7
7
  */
8
8
  function syncBuiltinESMExports(): void;
9
9
 
10
- /**
11
- * @experimental
12
- */
13
10
  function findSourceMap(path: string, error?: Error): SourceMap;
14
11
  interface SourceMapPayload {
15
12
  file: string;
@@ -29,9 +26,6 @@ declare module "module" {
29
26
  originalColumn: number;
30
27
  }
31
28
 
32
- /**
33
- * @experimental
34
- */
35
29
  class SourceMap {
36
30
  readonly payload: SourceMapPayload;
37
31
  constructor(payload: SourceMapPayload);
@@ -58,14 +58,14 @@ declare module "net" {
58
58
 
59
59
  // Extended base methods
60
60
  write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
61
- write(str: Uint8Array | string, encoding?: string, cb?: (err?: Error) => void): boolean;
61
+ write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
62
62
 
63
63
  connect(options: SocketConnectOpts, connectionListener?: () => void): this;
64
64
  connect(port: number, host: string, connectionListener?: () => void): this;
65
65
  connect(port: number, connectionListener?: () => void): this;
66
66
  connect(path: string, connectionListener?: () => void): this;
67
67
 
68
- setEncoding(encoding?: string): this;
68
+ setEncoding(encoding?: BufferEncoding): this;
69
69
  pause(): this;
70
70
  resume(): this;
71
71
  setTimeout(timeout: number, callback?: () => void): this;
@@ -89,7 +89,7 @@ declare module "net" {
89
89
  // Extended base methods
90
90
  end(cb?: () => void): void;
91
91
  end(buffer: Uint8Array | string, cb?: () => void): void;
92
- end(str: Uint8Array | string, encoding?: string, cb?: () => void): void;
92
+ end(str: Uint8Array | string, encoding?: BufferEncoding, cb?: () => void): void;
93
93
 
94
94
  /**
95
95
  * events.EventEmitter
@@ -49,7 +49,7 @@ declare module "os" {
49
49
  function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
50
50
  function homedir(): string;
51
51
  function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
52
- function userInfo(options?: { encoding: string }): UserInfo<string>;
52
+ function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
53
53
 
54
54
  type SignalConstants = {
55
55
  [key in NodeJS.Signals]: number;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "13.13.52",
3
+ "version": "14.0.0",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -19,6 +19,11 @@
19
19
  "url": "https://github.com/jkomyno",
20
20
  "githubUsername": "jkomyno"
21
21
  },
22
+ {
23
+ "name": "Alexander T.",
24
+ "url": "https://github.com/a-tarasyuk",
25
+ "githubUsername": "a-tarasyuk"
26
+ },
22
27
  {
23
28
  "name": "Alvis HT Tang",
24
29
  "url": "https://github.com/alvis",
@@ -34,6 +39,11 @@
34
39
  "url": "https://github.com/btoueg",
35
40
  "githubUsername": "btoueg"
36
41
  },
42
+ {
43
+ "name": "Bruno Scheufler",
44
+ "url": "https://github.com/brunoscheufler",
45
+ "githubUsername": "brunoscheufler"
46
+ },
37
47
  {
38
48
  "name": "Chigozirim C.",
39
49
  "url": "https://github.com/smac89",
@@ -59,6 +69,11 @@
59
69
  "url": "https://github.com/eyqs",
60
70
  "githubUsername": "eyqs"
61
71
  },
72
+ {
73
+ "name": "Flarna",
74
+ "url": "https://github.com/Flarna",
75
+ "githubUsername": "Flarna"
76
+ },
62
77
  {
63
78
  "name": "Hannes Magnusson",
64
79
  "url": "https://github.com/Hannes-Magnusson-CK",
@@ -104,6 +119,11 @@
104
119
  "url": "https://github.com/n-e",
105
120
  "githubUsername": "n-e"
106
121
  },
122
+ {
123
+ "name": "Nicolas Voigt",
124
+ "url": "https://github.com/octo-sniffle",
125
+ "githubUsername": "octo-sniffle"
126
+ },
107
127
  {
108
128
  "name": "Nikita Galkin",
109
129
  "url": "https://github.com/galkin",
@@ -149,6 +169,11 @@
149
169
  "url": "https://github.com/kuehlein",
150
170
  "githubUsername": "kuehlein"
151
171
  },
172
+ {
173
+ "name": "Jordi Oliveras Rovira",
174
+ "url": "https://github.com/j-oliveras",
175
+ "githubUsername": "j-oliveras"
176
+ },
152
177
  {
153
178
  "name": "Thanik Bhongbhibhat",
154
179
  "url": "https://github.com/bhongy",
@@ -193,19 +218,24 @@
193
218
  "name": "Piotr Błażejewicz",
194
219
  "url": "https://github.com/peterblazejewicz",
195
220
  "githubUsername": "peterblazejewicz"
196
- },
197
- {
198
- "name": "Jason Kwok",
199
- "url": "https://github.com/JasonHK",
200
- "githubUsername": "JasonHK"
201
221
  }
202
222
  ],
203
223
  "main": "",
204
224
  "types": "index.d.ts",
205
225
  "typesVersions": {
206
- "<=3.6": {
226
+ ">=3.7.0-0": {
227
+ "*": [
228
+ "ts3.7/*"
229
+ ]
230
+ },
231
+ ">=3.5.0-0": {
232
+ "*": [
233
+ "ts3.5/*"
234
+ ]
235
+ },
236
+ ">=3.2.0-0": {
207
237
  "*": [
208
- "ts3.6/*"
238
+ "ts3.2/*"
209
239
  ]
210
240
  }
211
241
  },
@@ -216,6 +246,6 @@
216
246
  },
217
247
  "scripts": {},
218
248
  "dependencies": {},
219
- "typesPublisherContentHash": "fc443441fc1011a9c40501d6229a600447809ab63533420929119694647fada1",
220
- "typeScriptVersion": "3.5"
249
+ "typesPublisherContentHash": "9eddaaab80be9d736d89e2dca33824db31699632489767e1df51790e13adb5a5",
250
+ "typeScriptVersion": "2.9"
221
251
  }
File without changes