@types/node 13.13.49 → 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 +1 -29
  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 -10
  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 +44 -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 +35 -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 +2 -10
  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 +1 -3
  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
@@ -44,34 +44,64 @@ declare module 'perf_hooks' {
44
44
  interface PerformanceNodeTiming extends PerformanceEntry {
45
45
  /**
46
46
  * The high resolution millisecond timestamp at which the Node.js process completed bootstrap.
47
- * If bootstrapping has not yet finished, the property has the value of -1.
48
47
  */
49
48
  readonly bootstrapComplete: number;
50
49
 
51
50
  /**
52
- * The high resolution millisecond timestamp at which the Node.js process completed bootstrapping.
53
- * If bootstrapping has not yet finished, the property has the value of -1.
51
+ * The high resolution millisecond timestamp at which cluster processing ended.
54
52
  */
55
- readonly environment: number;
53
+ readonly clusterSetupEnd: number;
54
+
55
+ /**
56
+ * The high resolution millisecond timestamp at which cluster processing started.
57
+ */
58
+ readonly clusterSetupStart: number;
56
59
 
57
60
  /**
58
61
  * The high resolution millisecond timestamp at which the Node.js event loop exited.
59
- * If the event loop has not yet exited, the property has the value of -1.
60
- * It can only have a value of not -1 in a handler of the 'exit' event.
61
62
  */
62
63
  readonly loopExit: number;
63
64
 
64
65
  /**
65
66
  * The high resolution millisecond timestamp at which the Node.js event loop started.
66
- * If the event loop has not yet started (e.g., in the first tick of the main script), the property has the value of -1.
67
67
  */
68
68
  readonly loopStart: number;
69
69
 
70
+ /**
71
+ * The high resolution millisecond timestamp at which main module load ended.
72
+ */
73
+ readonly moduleLoadEnd: number;
74
+
75
+ /**
76
+ * The high resolution millisecond timestamp at which main module load started.
77
+ */
78
+ readonly moduleLoadStart: number;
79
+
70
80
  /**
71
81
  * The high resolution millisecond timestamp at which the Node.js process was initialized.
72
82
  */
73
83
  readonly nodeStart: number;
74
84
 
85
+ /**
86
+ * The high resolution millisecond timestamp at which preload module load ended.
87
+ */
88
+ readonly preloadModuleLoadEnd: number;
89
+
90
+ /**
91
+ * The high resolution millisecond timestamp at which preload module load started.
92
+ */
93
+ readonly preloadModuleLoadStart: number;
94
+
95
+ /**
96
+ * The high resolution millisecond timestamp at which third_party_main processing ended.
97
+ */
98
+ readonly thirdPartyMainEnd: number;
99
+
100
+ /**
101
+ * The high resolution millisecond timestamp at which third_party_main processing started.
102
+ */
103
+ readonly thirdPartyMainStart: number;
104
+
75
105
  /**
76
106
  * The high resolution millisecond timestamp at which the V8 platform was initialized.
77
107
  */
@@ -79,6 +109,13 @@ declare module 'perf_hooks' {
79
109
  }
80
110
 
81
111
  interface Performance {
112
+ /**
113
+ * If name is not provided, removes all PerformanceFunction objects from the Performance Timeline.
114
+ * If name is provided, removes entries with name.
115
+ * @param name
116
+ */
117
+ clearFunctions(name?: string): void;
118
+
82
119
  /**
83
120
  * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
84
121
  * If name is provided, removes only the named mark.
@@ -86,6 +123,35 @@ declare module 'perf_hooks' {
86
123
  */
87
124
  clearMarks(name?: string): void;
88
125
 
126
+ /**
127
+ * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline.
128
+ * If name is provided, removes only objects whose performanceEntry.name matches name.
129
+ */
130
+ clearMeasures(name?: string): void;
131
+
132
+ /**
133
+ * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime.
134
+ * @return list of all PerformanceEntry objects
135
+ */
136
+ getEntries(): PerformanceEntry[];
137
+
138
+ /**
139
+ * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
140
+ * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type.
141
+ * @param name
142
+ * @param type
143
+ * @return list of all PerformanceEntry objects
144
+ */
145
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
146
+
147
+ /**
148
+ * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
149
+ * whose performanceEntry.entryType is equal to type.
150
+ * @param type
151
+ * @return list of all PerformanceEntry objects
152
+ */
153
+ getEntriesByType(type: EntryType): PerformanceEntry[];
154
+
89
155
  /**
90
156
  * Creates a new PerformanceMark entry in the Performance Timeline.
91
157
  * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
@@ -170,7 +236,7 @@ declare module 'perf_hooks' {
170
236
  * Property buffered defaults to false.
171
237
  * @param options
172
238
  */
173
- observe(options: { entryTypes: ReadonlyArray<EntryType>; buffered?: boolean }): void;
239
+ observe(options: { entryTypes: EntryType[]; buffered?: boolean }): void;
174
240
  }
175
241
 
176
242
  namespace constants {
File without changes
node/punycode.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ declare module "punycode" {
2
+ function decode(string: string): string;
3
+ function encode(string: string): string;
4
+ function toUnicode(domain: string): string;
5
+ function toASCII(domain: string): string;
6
+ const ucs2: ucs2;
7
+ interface ucs2 {
8
+ decode(string: string): number[];
9
+ encode(codePoints: number[]): string;
10
+ }
11
+ const version: string;
12
+ }
File without changes
File without changes
@@ -135,22 +135,14 @@ declare module "repl" {
135
135
  * evaluation.
136
136
  */
137
137
  readonly context: Context;
138
- /**
139
- * Outdated alias for `input`.
140
- */
141
- readonly inputStream: NodeJS.ReadableStream;
142
- /**
143
- * Outdated alias for `output`.
144
- */
145
- readonly outputStream: NodeJS.WritableStream;
146
138
  /**
147
139
  * The `Readable` stream from which REPL input will be read.
148
140
  */
149
- readonly input: NodeJS.ReadableStream;
141
+ readonly inputStream: NodeJS.ReadableStream;
150
142
  /**
151
143
  * The `Writable` stream to which REPL output will be written.
152
144
  */
153
- readonly output: NodeJS.WritableStream;
145
+ readonly outputStream: NodeJS.WritableStream;
154
146
  /**
155
147
  * The commands registered via `replServer.defineCommand()`.
156
148
  */
@@ -1,7 +1,7 @@
1
- declare module 'stream' {
2
- import EventEmitter = require('events');
1
+ declare module "stream" {
2
+ import * as events from "events";
3
3
 
4
- class internal extends EventEmitter {
4
+ class internal extends events.EventEmitter {
5
5
  pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
6
6
  }
7
7
 
@@ -12,7 +12,7 @@ declare module 'stream' {
12
12
 
13
13
  interface ReadableOptions {
14
14
  highWaterMark?: number;
15
- encoding?: string;
15
+ encoding?: BufferEncoding;
16
16
  objectMode?: boolean;
17
17
  read?(this: Readable, size: number): void;
18
18
  destroy?(this: Readable, error: Error | null, callback: (error: Error | null) => void): void;
@@ -26,9 +26,6 @@ declare module 'stream' {
26
26
  static from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable;
27
27
 
28
28
  readable: boolean;
29
- readonly readableEncoding: BufferEncoding | null;
30
- readonly readableEnded: boolean;
31
- readonly readableFlowing: boolean | null;
32
29
  readonly readableHighWaterMark: number;
33
30
  readonly readableLength: number;
34
31
  readonly readableObjectMode: boolean;
@@ -36,14 +33,14 @@ declare module 'stream' {
36
33
  constructor(opts?: ReadableOptions);
37
34
  _read(size: number): void;
38
35
  read(size?: number): any;
39
- setEncoding(encoding: string): this;
36
+ setEncoding(encoding: BufferEncoding): this;
40
37
  pause(): this;
41
38
  resume(): this;
42
39
  isPaused(): boolean;
43
40
  unpipe(destination?: NodeJS.WritableStream): this;
44
41
  unshift(chunk: any, encoding?: BufferEncoding): void;
45
42
  wrap(oldStream: NodeJS.ReadableStream): this;
46
- push(chunk: any, encoding?: string): boolean;
43
+ push(chunk: any, encoding?: BufferEncoding): boolean;
47
44
  _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
48
45
  destroy(error?: Error): void;
49
46
 
@@ -127,11 +124,11 @@ declare module 'stream' {
127
124
  interface WritableOptions {
128
125
  highWaterMark?: number;
129
126
  decodeStrings?: boolean;
130
- defaultEncoding?: string;
127
+ defaultencoding?: BufferEncoding;
131
128
  objectMode?: boolean;
132
129
  emitClose?: boolean;
133
- write?(this: Writable, chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
134
- writev?(this: Writable, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
130
+ write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
131
+ writev?(this: Writable, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void;
135
132
  destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void;
136
133
  final?(this: Writable, callback: (error?: Error | null) => void): void;
137
134
  autoDestroy?: boolean;
@@ -147,16 +144,16 @@ declare module 'stream' {
147
144
  readonly writableCorked: number;
148
145
  destroyed: boolean;
149
146
  constructor(opts?: WritableOptions);
150
- _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
151
- _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
147
+ _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
148
+ _writev?(chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void;
152
149
  _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
153
150
  _final(callback: (error?: Error | null) => void): void;
154
151
  write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
155
- write(chunk: any, encoding: string, cb?: (error: Error | null | undefined) => void): boolean;
156
- setDefaultEncoding(encoding: string): this;
152
+ write(chunk: any, encoding: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean;
153
+ setDefaultEncoding(encoding: BufferEncoding): this;
157
154
  end(cb?: () => void): void;
158
155
  end(chunk: any, cb?: () => void): void;
159
- end(chunk: any, encoding: string, cb?: () => void): void;
156
+ end(chunk: any, encoding: BufferEncoding, cb?: () => void): void;
160
157
  cork(): void;
161
158
  uncork(): void;
162
159
  destroy(error?: Error): void;
@@ -236,8 +233,8 @@ declare module 'stream' {
236
233
  writableHighWaterMark?: number;
237
234
  writableCorked?: number;
238
235
  read?(this: Duplex, size: number): void;
239
- write?(this: Duplex, chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
240
- writev?(this: Duplex, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
236
+ write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
237
+ writev?(this: Duplex, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void;
241
238
  final?(this: Duplex, callback: (error?: Error | null) => void): void;
242
239
  destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void;
243
240
  }
@@ -252,16 +249,16 @@ declare module 'stream' {
252
249
  readonly writableObjectMode: boolean;
253
250
  readonly writableCorked: number;
254
251
  constructor(opts?: DuplexOptions);
255
- _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
256
- _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
252
+ _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
253
+ _writev?(chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void;
257
254
  _destroy(error: Error | null, callback: (error: Error | null) => void): void;
258
255
  _final(callback: (error?: Error | null) => void): void;
259
- write(chunk: any, encoding?: string, cb?: (error: Error | null | undefined) => void): boolean;
256
+ write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean;
260
257
  write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
261
- setDefaultEncoding(encoding: string): this;
258
+ setDefaultEncoding(encoding: BufferEncoding): this;
262
259
  end(cb?: () => void): void;
263
260
  end(chunk: any, cb?: () => void): void;
264
- end(chunk: any, encoding?: string, cb?: () => void): void;
261
+ end(chunk: any, encoding?: BufferEncoding, cb?: () => void): void;
265
262
  cork(): void;
266
263
  uncork(): void;
267
264
  }
@@ -270,17 +267,17 @@ declare module 'stream' {
270
267
 
271
268
  interface TransformOptions extends DuplexOptions {
272
269
  read?(this: Transform, size: number): void;
273
- write?(this: Transform, chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
274
- writev?(this: Transform, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
270
+ write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
271
+ writev?(this: Transform, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void;
275
272
  final?(this: Transform, callback: (error?: Error | null) => void): void;
276
273
  destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void;
277
- transform?(this: Transform, chunk: any, encoding: string, callback: TransformCallback): void;
274
+ transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
278
275
  flush?(this: Transform, callback: TransformCallback): void;
279
276
  }
280
277
 
281
278
  class Transform extends Duplex {
282
279
  constructor(opts?: TransformOptions);
283
- _transform(chunk: any, encoding: string, callback: TransformCallback): void;
280
+ _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
284
281
  _flush(callback: TransformCallback): void;
285
282
  }
286
283
 
@@ -314,10 +311,7 @@ declare module 'stream' {
314
311
  stream5: T,
315
312
  callback?: (err: NodeJS.ErrnoException | null) => void,
316
313
  ): T;
317
- function pipeline(
318
- streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
319
- callback?: (err: NodeJS.ErrnoException | null) => void,
320
- ): NodeJS.WritableStream;
314
+ function pipeline(streams: Array<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>, callback?: (err: NodeJS.ErrnoException | null) => void): NodeJS.WritableStream;
321
315
  function pipeline(
322
316
  stream1: NodeJS.ReadableStream,
323
317
  stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
@@ -334,7 +328,7 @@ declare module 'stream' {
334
328
  stream4: NodeJS.ReadWriteStream,
335
329
  stream5: NodeJS.WritableStream,
336
330
  ): Promise<void>;
337
- function __promisify__(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>): Promise<void>;
331
+ function __promisify__(streams: Array<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>): Promise<void>;
338
332
  function __promisify__(
339
333
  stream1: NodeJS.ReadableStream,
340
334
  stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
@@ -1,6 +1,6 @@
1
1
  declare module "string_decoder" {
2
2
  class StringDecoder {
3
- constructor(encoding?: string);
3
+ constructor(encoding?: BufferEncoding);
4
4
  write(buffer: Buffer): string;
5
5
  end(buffer?: Buffer): string;
6
6
  }
File without changes
@@ -436,7 +436,7 @@ declare module "tls" {
436
436
 
437
437
  interface PSKCallbackNegotation {
438
438
  psk: DataView | NodeJS.TypedArray;
439
- identity: string;
439
+ identitty: string;
440
440
  }
441
441
 
442
442
  interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
@@ -729,7 +729,7 @@ declare module "tls" {
729
729
  * @deprecated
730
730
  */
731
731
  function createSecurePair(credentials?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
732
- function createSecureContext(options?: SecureContextOptions): SecureContext;
732
+ function createSecureContext(details: SecureContextOptions): SecureContext;
733
733
  function getCiphers(): string[];
734
734
 
735
735
  /**
File without changes
node/ts3.2/base.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ // NOTE: These definitions support NodeJS and TypeScript 3.2.
2
+
3
+ // NOTE: TypeScript version-specific augmentations can be found in the following paths:
4
+ // - ~/base.d.ts - Shared definitions common to all TypeScript versions
5
+ // - ~/index.d.ts - Definitions specific to TypeScript 2.1
6
+ // - ~/ts3.2/base.d.ts - Definitions specific to TypeScript 3.2
7
+ // - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2 with assert pulled in
8
+
9
+ // Reference required types from the default lib:
10
+ /// <reference lib="es2018" />
11
+ /// <reference lib="esnext.asynciterable" />
12
+ /// <reference lib="esnext.intl" />
13
+ /// <reference lib="esnext.bigint" />
14
+
15
+ // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16
+ // tslint:disable-next-line:no-bad-reference
17
+ /// <reference path="../base.d.ts" />
18
+
19
+ // TypeScript 3.2-specific augmentations:
20
+ /// <reference path="fs.d.ts" />
21
+ /// <reference path="util.d.ts" />
22
+ /// <reference path="globals.d.ts" />
node/ts3.2/fs.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ // tslint:disable-next-line:no-bad-reference
2
+ /// <reference path="../fs.d.ts" />
3
+
4
+ declare module 'fs' {
5
+ interface BigIntStats extends StatsBase<bigint> {
6
+ }
7
+
8
+ class BigIntStats {
9
+ atimeNs: bigint;
10
+ mtimeNs: bigint;
11
+ ctimeNs: bigint;
12
+ birthtimeNs: bigint;
13
+ }
14
+
15
+ interface BigIntOptions {
16
+ bigint: true;
17
+ }
18
+
19
+ interface StatOptions {
20
+ bigint: boolean;
21
+ }
22
+
23
+ function stat(path: PathLike, options: BigIntOptions, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void;
24
+ function stat(path: PathLike, options: StatOptions, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
25
+
26
+ namespace stat {
27
+ function __promisify__(path: PathLike, options: BigIntOptions): Promise<BigIntStats>;
28
+ function __promisify__(path: PathLike, options: StatOptions): Promise<Stats | BigIntStats>;
29
+ }
30
+
31
+ function statSync(path: PathLike, options: BigIntOptions): BigIntStats;
32
+ function statSync(path: PathLike, options: StatOptions): Stats | BigIntStats;
33
+ }
@@ -0,0 +1,19 @@
1
+ // tslint:disable-next-line:no-bad-reference
2
+ /// <reference path="../globals.d.ts" />
3
+
4
+ declare namespace NodeJS {
5
+ interface HRTime {
6
+ bigint(): bigint;
7
+ }
8
+ }
9
+
10
+ interface Buffer extends Uint8Array {
11
+ readBigUInt64BE(offset?: number): bigint;
12
+ readBigUInt64LE(offset?: number): bigint;
13
+ readBigInt64BE(offset?: number): bigint;
14
+ readBigInt64LE(offset?: number): bigint;
15
+ writeBigInt64BE(value: bigint, offset?: number): number;
16
+ writeBigInt64LE(value: bigint, offset?: number): number;
17
+ writeBigUInt64BE(value: bigint, offset?: number): number;
18
+ writeBigUInt64LE(value: bigint, offset?: number): number;
19
+ }
node/ts3.2/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ // NOTE: These definitions support NodeJS and TypeScript 3.2.
2
+ // This is requried to enable typing assert in ts3.7 without causing errors
3
+ // Typically type modifiations should be made in base.d.ts instead of here
4
+
5
+ /// <reference path="base.d.ts" />
6
+
7
+ // tslint:disable-next-line:no-bad-reference
8
+ /// <reference path="../assert.d.ts" />
node/ts3.2/util.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ // tslint:disable-next-line:no-bad-reference
2
+ /// <reference path="../util.d.ts" />
3
+
4
+ declare module "util" {
5
+ namespace types {
6
+ function isBigInt64Array(value: any): value is BigInt64Array;
7
+ function isBigUint64Array(value: any): value is BigUint64Array;
8
+ }
9
+ }
node/ts3.5/base.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ // NOTE: These definitions support NodeJS and TypeScript 3.5.
2
+
3
+ // NOTE: TypeScript version-specific augmentations can be found in the following paths:
4
+ // - ~/base.d.ts - Shared definitions common to all TypeScript versions
5
+ // - ~/index.d.ts - Definitions specific to TypeScript 2.1
6
+ // - ~/ts3.5/base.d.ts - Definitions specific to TypeScript 3.5
7
+ // - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5 with assert pulled in
8
+
9
+ // Reference required types from the default lib:
10
+ /// <reference lib="es2018" />
11
+ /// <reference lib="esnext.asynciterable" />
12
+ /// <reference lib="esnext.intl" />
13
+ /// <reference lib="esnext.bigint" />
14
+
15
+ // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16
+ // tslint:disable-next-line:no-bad-reference
17
+ /// <reference path="../ts3.2/base.d.ts" />
18
+
19
+ // TypeScript 3.5-specific augmentations:
20
+ /// <reference path="wasi.d.ts" />
@@ -1,6 +1,8 @@
1
1
  // NOTE: These definitions support NodeJS and TypeScript 3.5.
2
- // This is required to enable typing assert in ts3.7 without causing errors
2
+ // This is requried to enable typing assert in ts3.7 without causing errors
3
3
  // Typically type modifiations should be made in base.d.ts instead of here
4
4
 
5
5
  /// <reference path="base.d.ts" />
6
- /// <reference path="assert.d.ts" />
6
+
7
+ // tslint:disable-next-line:no-bad-reference
8
+ /// <reference path="../assert.d.ts" />
@@ -6,13 +6,11 @@ declare module 'wasi' {
6
6
  * WASI command itself.
7
7
  */
8
8
  args?: string[];
9
-
10
9
  /**
11
10
  * An object similar to `process.env` that the WebAssembly
12
11
  * application will see as its environment.
13
12
  */
14
13
  env?: object;
15
-
16
14
  /**
17
15
  * This object represents the WebAssembly application's
18
16
  * sandbox directory structure. The string keys of `preopens` are treated as
@@ -44,10 +42,9 @@ declare module 'wasi' {
44
42
  * `memory`. If `instance` does not have a `memory` export an exception is thrown.
45
43
  */
46
44
  start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
47
-
48
45
  /**
49
46
  * Is an object that implements the WASI system call API. This object
50
- * should be passed as the `wasi_snapshot_preview1` import during the instantiation of a
47
+ * should be passed as the `wasi_unstable` import during the instantiation of a
51
48
  * [`WebAssembly.Instance`][].
52
49
  */
53
50
  readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
@@ -1,4 +1,4 @@
1
- declare module 'assert' {
1
+ declare module "assert" {
2
2
  function assert(value: any, message?: string | Error): asserts value;
3
3
  namespace assert {
4
4
  class AssertionError implements Error {
@@ -11,27 +11,16 @@ declare module 'assert' {
11
11
  code: 'ERR_ASSERTION';
12
12
 
13
13
  constructor(options?: {
14
- message?: string;
15
- actual?: any;
16
- expected?: any;
17
- operator?: string;
18
- // tslint:disable-next-line:ban-types
19
- stackStartFn?: Function;
14
+ message?: string; actual?: any; expected?: any;
15
+ operator?: string; stackStartFn?: Function
20
16
  });
21
17
  }
22
18
 
23
- type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
19
+ type AssertPredicate = RegExp | (new() => object) | ((thrown: any) => boolean) | object | Error;
24
20
 
25
21
  function fail(message?: string | Error): never;
26
22
  /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
27
- function fail(
28
- actual: any,
29
- expected: any,
30
- message?: string | Error,
31
- operator?: string,
32
- // tslint:disable-next-line:ban-types
33
- stackStartFn?: Function,
34
- ): never;
23
+ function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
35
24
  function ok(value: any, message?: string | Error): asserts value;
36
25
  /** @deprecated since v9.9.0 - use strictEqual() instead. */
37
26
  function equal(actual: any, expected: any, message?: string | Error): void;
@@ -49,53 +38,19 @@ declare module 'assert' {
49
38
  function throws(block: () => any, message?: string | Error): void;
50
39
  function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
51
40
  function doesNotThrow(block: () => any, message?: string | Error): void;
52
- function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
41
+ function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
53
42
 
54
43
  function ifError(value: any): asserts value is null | undefined;
55
44
 
56
45
  function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
57
- function rejects(
58
- block: (() => Promise<any>) | Promise<any>,
59
- error: AssertPredicate,
60
- message?: string | Error,
61
- ): Promise<void>;
46
+ function rejects(block: (() => Promise<any>) | Promise<any>, error: AssertPredicate, message?: string | Error): Promise<void>;
62
47
  function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
63
- function doesNotReject(
64
- block: (() => Promise<any>) | Promise<any>,
65
- error: AssertPredicate,
66
- message?: string | Error,
67
- ): Promise<void>;
48
+ function doesNotReject(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
68
49
 
69
50
  function match(value: string, regExp: RegExp, message?: string | Error): void;
70
51
  function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
71
52
 
72
- const strict: Omit<
73
- typeof assert,
74
- | 'equal'
75
- | 'notEqual'
76
- | 'deepEqual'
77
- | 'notDeepEqual'
78
- | 'ok'
79
- | 'strictEqual'
80
- | 'deepStrictEqual'
81
- | 'ifError'
82
- | 'strict'
83
- > & {
84
- (value: any, message?: string | Error): asserts value;
85
- equal: typeof strictEqual;
86
- notEqual: typeof notStrictEqual;
87
- deepEqual: typeof deepStrictEqual;
88
- notDeepEqual: typeof notDeepStrictEqual;
89
-
90
- // Mapped types and assertion functions are incompatible?
91
- // TS2775: Assertions require every name in the call target
92
- // to be declared with an explicit type annotation.
93
- ok: typeof ok;
94
- strictEqual: typeof strictEqual;
95
- deepStrictEqual: typeof deepStrictEqual;
96
- ifError: typeof ifError;
97
- strict: typeof strict;
98
- };
53
+ const strict: typeof assert;
99
54
  }
100
55
 
101
56
  export = assert;
@@ -13,7 +13,8 @@
13
13
  /// <reference lib="esnext.bigint" />
14
14
 
15
15
  // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16
- /// <reference path="ts3.6/base.d.ts" />
16
+ // tslint:disable-next-line:no-bad-reference
17
+ /// <reference path="../ts3.5/base.d.ts" />
17
18
 
18
19
  // TypeScript 3.7-specific augmentations:
19
20
  /// <reference path="assert.d.ts" />
node/ts3.7/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ // NOTE: These definitions support NodeJS and TypeScript 3.7.
2
+ // This isn't strictly needed since 3.7 has the assert module, but this way we're consistent.
3
+ // Typically type modificatons should be made in base.d.ts instead of here
4
+
5
+ /// <reference path="base.d.ts" />
File without changes