@types/node 12.20.13 → 12.20.17

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.
@@ -21,16 +21,16 @@ interface Console {
21
21
  */
22
22
  countReset(label?: string): void;
23
23
  /**
24
- * The `console.debug()` function is an alias for {@link console.log()}.
24
+ * The `console.debug()` function is an alias for {@link console.log}.
25
25
  */
26
26
  debug(message?: any, ...optionalParams: any[]): void;
27
27
  /**
28
- * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`.
28
+ * Uses {@link util.inspect} on `obj` and prints the resulting string to `stdout`.
29
29
  * This function bypasses any custom `inspect()` function defined on `obj`.
30
30
  */
31
31
  dir(obj: any, options?: NodeJS.InspectOptions): void;
32
32
  /**
33
- * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting
33
+ * This method calls {@link console.log} passing it the arguments received. Please note that this method does not produce any XML formatting
34
34
  */
35
35
  dirxml(...data: any[]): void;
36
36
  /**
@@ -43,7 +43,7 @@ interface Console {
43
43
  */
44
44
  group(...label: any[]): void;
45
45
  /**
46
- * The `console.groupCollapsed()` function is an alias for {@link console.group()}.
46
+ * The `console.groupCollapsed()` function is an alias for {@link console.group}.
47
47
  */
48
48
  groupCollapsed(...label: any[]): void;
49
49
  /**
@@ -51,7 +51,7 @@ interface Console {
51
51
  */
52
52
  groupEnd(): void;
53
53
  /**
54
- * The {@link console.info()} function is an alias for {@link console.log()}.
54
+ * The {@link console.info} function is an alias for {@link console.log}.
55
55
  */
56
56
  info(message?: any, ...optionalParams: any[]): void;
57
57
  /**
@@ -68,19 +68,19 @@ interface Console {
68
68
  */
69
69
  time(label?: string): void;
70
70
  /**
71
- * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`.
71
+ * Stops a timer that was previously started by calling {@link console.time} and prints the result to `stdout`.
72
72
  */
73
73
  timeEnd(label?: string): void;
74
74
  /**
75
- * For a timer that was previously started by calling {@link console.time()}, prints the elapsed time and other `data` arguments to `stdout`.
75
+ * For a timer that was previously started by calling {@link console.time}, prints the elapsed time and other `data` arguments to `stdout`.
76
76
  */
77
77
  timeLog(label?: string, ...data: any[]): void;
78
78
  /**
79
- * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code.
79
+ * Prints to `stderr` the string 'Trace :', followed by the {@link util.format} formatted message and stack trace to the current position in the code.
80
80
  */
81
81
  trace(message?: any, ...optionalParams: any[]): void;
82
82
  /**
83
- * The {@link console.warn()} function is an alias for {@link console.error()}.
83
+ * The {@link console.warn} function is an alias for {@link console.error}.
84
84
  */
85
85
  warn(message?: any, ...optionalParams: any[]): void;
86
86
 
@@ -124,7 +124,7 @@ interface Console {
124
124
  }
125
125
 
126
126
  interface Error {
127
- stack?: string;
127
+ stack?: string | undefined;
128
128
  }
129
129
 
130
130
  // Declare "static" methods in Error
@@ -137,7 +137,7 @@ interface ErrorConstructor {
137
137
  *
138
138
  * @see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces
139
139
  */
140
- prepareStackTrace?: (err: Error, stackTraces: NodeJS.CallSite[]) => any;
140
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
141
141
 
142
142
  stackTraceLimit: number;
143
143
  }
@@ -211,7 +211,7 @@ interface NodeRequire extends NodeRequireFunction {
211
211
  }
212
212
 
213
213
  interface RequireResolve {
214
- (id: string, options?: { paths?: string[]; }): string;
214
+ (id: string, options?: { paths?: string[] | undefined; }): string;
215
215
  paths(request: string): string[] | null;
216
216
  }
217
217
 
@@ -511,17 +511,17 @@ declare namespace NodeJS {
511
511
  * the getter function.
512
512
  * @default `false`
513
513
  */
514
- getters?: 'get' | 'set' | boolean;
515
- showHidden?: boolean;
514
+ getters?: 'get' | 'set' | boolean | undefined;
515
+ showHidden?: boolean | undefined;
516
516
  /**
517
517
  * @default 2
518
518
  */
519
- depth?: number | null;
520
- colors?: boolean;
521
- customInspect?: boolean;
522
- showProxy?: boolean;
523
- maxArrayLength?: number | null;
524
- breakLength?: number;
519
+ depth?: number | null | undefined;
520
+ colors?: boolean | undefined;
521
+ customInspect?: boolean | undefined;
522
+ showProxy?: boolean | undefined;
523
+ maxArrayLength?: number | null | undefined;
524
+ breakLength?: number | undefined;
525
525
  /**
526
526
  * Setting this to `false` causes each object key
527
527
  * to be displayed on a new line. It will also add new lines to text that is
@@ -532,16 +532,16 @@ declare namespace NodeJS {
532
532
  * For more information, see the example below.
533
533
  * @default `true`
534
534
  */
535
- compact?: boolean | number;
536
- sorted?: boolean | ((a: string, b: string) => number);
535
+ compact?: boolean | number | undefined;
536
+ sorted?: boolean | ((a: string, b: string) => number) | undefined;
537
537
  }
538
538
 
539
539
  interface ConsoleConstructorOptions {
540
540
  stdout: WritableStream;
541
- stderr?: WritableStream;
542
- ignoreErrors?: boolean;
543
- colorMode?: boolean | 'auto';
544
- inspectOptions?: InspectOptions;
541
+ stderr?: WritableStream | undefined;
542
+ ignoreErrors?: boolean | undefined;
543
+ colorMode?: boolean | 'auto' | undefined;
544
+ inspectOptions?: InspectOptions | undefined;
545
545
  }
546
546
 
547
547
  interface ConsoleConstructor {
@@ -625,11 +625,11 @@ declare namespace NodeJS {
625
625
  }
626
626
 
627
627
  interface ErrnoException extends Error {
628
- errno?: number;
629
- code?: string;
630
- path?: string;
631
- syscall?: string;
632
- stack?: string;
628
+ errno?: number | undefined;
629
+ code?: string | undefined;
630
+ path?: string | undefined;
631
+ syscall?: string | undefined;
632
+ stack?: string | undefined;
633
633
  }
634
634
 
635
635
  class EventEmitter {
@@ -658,7 +658,7 @@ declare namespace NodeJS {
658
658
  pause(): this;
659
659
  resume(): this;
660
660
  isPaused(): boolean;
661
- pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T;
661
+ pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
662
662
  unpipe(destination?: WritableStream): this;
663
663
  unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
664
664
  wrap(oldStream: ReadableStream): this;
@@ -704,10 +704,10 @@ declare namespace NodeJS {
704
704
 
705
705
  interface ProcessRelease {
706
706
  name: string;
707
- sourceUrl?: string;
708
- headersUrl?: string;
709
- libUrl?: string;
710
- lts?: string;
707
+ sourceUrl?: string | undefined;
708
+ headersUrl?: string | undefined;
709
+ libUrl?: string | undefined;
710
+ lts?: string | undefined;
711
711
  }
712
712
 
713
713
  interface ProcessVersions {
@@ -754,7 +754,7 @@ declare namespace NodeJS {
754
754
  type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
755
755
 
756
756
  interface Socket extends ReadWriteStream {
757
- isTTY?: true;
757
+ isTTY?: true | undefined;
758
758
  }
759
759
 
760
760
  interface ProcessEnv {
@@ -856,24 +856,24 @@ declare namespace NodeJS {
856
856
  *
857
857
  * @default 'Warning'
858
858
  */
859
- type?: string;
859
+ type?: string | undefined;
860
860
 
861
861
  /**
862
862
  * A unique identifier for the warning instance being emitted.
863
863
  */
864
- code?: string;
864
+ code?: string | undefined;
865
865
 
866
866
  /**
867
867
  * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
868
868
  *
869
869
  * @default process.emitWarning
870
870
  */
871
- ctor?: Function;
871
+ ctor?: Function | undefined;
872
872
 
873
873
  /**
874
874
  * Additional text to include with the error.
875
875
  */
876
- detail?: string;
876
+ detail?: string | undefined;
877
877
  }
878
878
 
879
879
  interface Process extends EventEmitter {
@@ -913,7 +913,7 @@ declare namespace NodeJS {
913
913
 
914
914
  env: ProcessEnv;
915
915
  exit(code?: number): never;
916
- exitCode?: number;
916
+ exitCode?: number | undefined;
917
917
  getgid(): number;
918
918
  setgid(id: number | string): void;
919
919
  getuid(): number;
@@ -960,7 +960,7 @@ declare namespace NodeJS {
960
960
  title: string;
961
961
  arch: string;
962
962
  platform: Platform;
963
- mainModule?: NodeModule;
963
+ mainModule?: NodeModule | undefined;
964
964
  memoryUsage(): MemoryUsage;
965
965
  cpuUsage(previousValue?: CpuUsage): CpuUsage;
966
966
  nextTick(callback: Function, ...args: any[]): void;
@@ -990,7 +990,7 @@ declare namespace NodeJS {
990
990
  domain: Domain;
991
991
 
992
992
  // Worker
993
- send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
993
+ send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean | undefined}, callback?: (error: Error | null) => void): boolean;
994
994
  disconnect(): void;
995
995
  connected: boolean;
996
996
 
@@ -1004,7 +1004,7 @@ declare namespace NodeJS {
1004
1004
  /**
1005
1005
  * Only available with `--experimental-report`
1006
1006
  */
1007
- report?: ProcessReport;
1007
+ report?: ProcessReport | undefined;
1008
1008
 
1009
1009
  resourceUsage(): ResourceUsage;
1010
1010
 
node v12.20/http.d.ts CHANGED
@@ -5,64 +5,64 @@ declare module 'http' {
5
5
 
6
6
  // incoming headers will never contain number
7
7
  interface IncomingHttpHeaders {
8
- 'accept'?: string;
9
- 'accept-language'?: string;
10
- 'accept-patch'?: string;
11
- 'accept-ranges'?: string;
12
- 'access-control-allow-credentials'?: string;
13
- 'access-control-allow-headers'?: string;
14
- 'access-control-allow-methods'?: string;
15
- 'access-control-allow-origin'?: string;
16
- 'access-control-expose-headers'?: string;
17
- 'access-control-max-age'?: string;
18
- 'access-control-request-headers'?: string;
19
- 'access-control-request-method'?: string;
20
- 'age'?: string;
21
- 'allow'?: string;
22
- 'alt-svc'?: string;
23
- 'authorization'?: string;
24
- 'cache-control'?: string;
25
- 'connection'?: string;
26
- 'content-disposition'?: string;
27
- 'content-encoding'?: string;
28
- 'content-language'?: string;
29
- 'content-length'?: string;
30
- 'content-location'?: string;
31
- 'content-range'?: string;
32
- 'content-type'?: string;
33
- 'cookie'?: string;
34
- 'date'?: string;
35
- 'etag'?: string;
36
- 'expect'?: string;
37
- 'expires'?: string;
38
- 'forwarded'?: string;
39
- 'from'?: string;
40
- 'host'?: string;
41
- 'if-match'?: string;
42
- 'if-modified-since'?: string;
43
- 'if-none-match'?: string;
44
- 'if-unmodified-since'?: string;
45
- 'last-modified'?: string;
46
- 'location'?: string;
47
- 'origin'?: string;
48
- 'pragma'?: string;
49
- 'proxy-authenticate'?: string;
50
- 'proxy-authorization'?: string;
51
- 'public-key-pins'?: string;
52
- 'range'?: string;
53
- 'referer'?: string;
54
- 'retry-after'?: string;
55
- 'set-cookie'?: string[];
56
- 'strict-transport-security'?: string;
57
- 'tk'?: string;
58
- 'trailer'?: string;
59
- 'transfer-encoding'?: string;
60
- 'upgrade'?: string;
61
- 'user-agent'?: string;
62
- 'vary'?: string;
63
- 'via'?: string;
64
- 'warning'?: string;
65
- 'www-authenticate'?: string;
8
+ 'accept'?: string | undefined;
9
+ 'accept-language'?: string | undefined;
10
+ 'accept-patch'?: string | undefined;
11
+ 'accept-ranges'?: string | undefined;
12
+ 'access-control-allow-credentials'?: string | undefined;
13
+ 'access-control-allow-headers'?: string | undefined;
14
+ 'access-control-allow-methods'?: string | undefined;
15
+ 'access-control-allow-origin'?: string | undefined;
16
+ 'access-control-expose-headers'?: string | undefined;
17
+ 'access-control-max-age'?: string | undefined;
18
+ 'access-control-request-headers'?: string | undefined;
19
+ 'access-control-request-method'?: string | undefined;
20
+ 'age'?: string | undefined;
21
+ 'allow'?: string | undefined;
22
+ 'alt-svc'?: string | undefined;
23
+ 'authorization'?: string | undefined;
24
+ 'cache-control'?: string | undefined;
25
+ 'connection'?: string | undefined;
26
+ 'content-disposition'?: string | undefined;
27
+ 'content-encoding'?: string | undefined;
28
+ 'content-language'?: string | undefined;
29
+ 'content-length'?: string | undefined;
30
+ 'content-location'?: string | undefined;
31
+ 'content-range'?: string | undefined;
32
+ 'content-type'?: string | undefined;
33
+ 'cookie'?: string | undefined;
34
+ 'date'?: string | undefined;
35
+ 'etag'?: string | undefined;
36
+ 'expect'?: string | undefined;
37
+ 'expires'?: string | undefined;
38
+ 'forwarded'?: string | undefined;
39
+ 'from'?: string | undefined;
40
+ 'host'?: string | undefined;
41
+ 'if-match'?: string | undefined;
42
+ 'if-modified-since'?: string | undefined;
43
+ 'if-none-match'?: string | undefined;
44
+ 'if-unmodified-since'?: string | undefined;
45
+ 'last-modified'?: string | undefined;
46
+ 'location'?: string | undefined;
47
+ 'origin'?: string | undefined;
48
+ 'pragma'?: string | undefined;
49
+ 'proxy-authenticate'?: string | undefined;
50
+ 'proxy-authorization'?: string | undefined;
51
+ 'public-key-pins'?: string | undefined;
52
+ 'range'?: string | undefined;
53
+ 'referer'?: string | undefined;
54
+ 'retry-after'?: string | undefined;
55
+ 'set-cookie'?: string[] | undefined;
56
+ 'strict-transport-security'?: string | undefined;
57
+ 'tk'?: string | undefined;
58
+ 'trailer'?: string | undefined;
59
+ 'transfer-encoding'?: string | undefined;
60
+ 'upgrade'?: string | undefined;
61
+ 'user-agent'?: string | undefined;
62
+ 'vary'?: string | undefined;
63
+ 'via'?: string | undefined;
64
+ 'warning'?: string | undefined;
65
+ 'www-authenticate'?: string | undefined;
66
66
  [header: string]: string | string[] | undefined;
67
67
  }
68
68
 
@@ -72,29 +72,29 @@ declare module 'http' {
72
72
  }
73
73
 
74
74
  interface ClientRequestArgs {
75
- protocol?: string | null;
76
- host?: string | null;
77
- hostname?: string | null;
78
- family?: number;
79
- port?: number | string | null;
80
- defaultPort?: number | string;
81
- localAddress?: string;
82
- socketPath?: string;
83
- method?: string;
84
- path?: string | null;
85
- headers?: OutgoingHttpHeaders;
86
- auth?: string | null;
87
- agent?: Agent | boolean;
88
- _defaultAgent?: Agent;
89
- timeout?: number;
90
- setHost?: boolean;
75
+ protocol?: string | null | undefined;
76
+ host?: string | null | undefined;
77
+ hostname?: string | null | undefined;
78
+ family?: number | undefined;
79
+ port?: number | string | null | undefined;
80
+ defaultPort?: number | string | undefined;
81
+ localAddress?: string | undefined;
82
+ socketPath?: string | undefined;
83
+ method?: string | undefined;
84
+ path?: string | null | undefined;
85
+ headers?: OutgoingHttpHeaders | undefined;
86
+ auth?: string | null | undefined;
87
+ agent?: Agent | boolean | undefined;
88
+ _defaultAgent?: Agent | undefined;
89
+ timeout?: number | undefined;
90
+ setHost?: boolean | undefined;
91
91
  // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
92
- createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket;
92
+ createConnection?: ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) | undefined;
93
93
  }
94
94
 
95
95
  interface ServerOptions {
96
- IncomingMessage?: typeof IncomingMessage;
97
- ServerResponse?: typeof ServerResponse;
96
+ IncomingMessage?: typeof IncomingMessage | undefined;
97
+ ServerResponse?: typeof ServerResponse | undefined;
98
98
  }
99
99
 
100
100
  type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
@@ -158,7 +158,7 @@ declare module 'http' {
158
158
  // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53
159
159
  // no args in writeContinue callback
160
160
  writeContinue(callback?: () => void): void;
161
- writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): this;
161
+ writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders): this;
162
162
  writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
163
163
  writeProcessing(): void;
164
164
  }
@@ -289,19 +289,19 @@ declare module 'http' {
289
289
  /**
290
290
  * Only valid for request obtained from http.Server.
291
291
  */
292
- method?: string;
292
+ method?: string | undefined;
293
293
  /**
294
294
  * Only valid for request obtained from http.Server.
295
295
  */
296
- url?: string;
296
+ url?: string | undefined;
297
297
  /**
298
298
  * Only valid for response obtained from http.ClientRequest.
299
299
  */
300
- statusCode?: number;
300
+ statusCode?: number | undefined;
301
301
  /**
302
302
  * Only valid for response obtained from http.ClientRequest.
303
303
  */
304
- statusMessage?: string;
304
+ statusMessage?: string | undefined;
305
305
  socket: Socket;
306
306
  destroy(error?: Error): void;
307
307
  }
@@ -310,32 +310,32 @@ declare module 'http' {
310
310
  /**
311
311
  * Keep sockets around in a pool to be used by other requests in the future. Default = false
312
312
  */
313
- keepAlive?: boolean;
313
+ keepAlive?: boolean | undefined;
314
314
  /**
315
315
  * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
316
316
  * Only relevant if keepAlive is set to true.
317
317
  */
318
- keepAliveMsecs?: number;
318
+ keepAliveMsecs?: number | undefined;
319
319
  /**
320
320
  * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
321
321
  */
322
- maxSockets?: number;
322
+ maxSockets?: number | undefined;
323
323
  /**
324
324
  * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity.
325
325
  */
326
- maxTotalSockets?: number;
326
+ maxTotalSockets?: number | undefined;
327
327
  /**
328
328
  * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
329
329
  */
330
- maxFreeSockets?: number;
330
+ maxFreeSockets?: number | undefined;
331
331
  /**
332
332
  * Socket timeout in milliseconds. This will set the timeout after the socket is connected.
333
333
  */
334
- timeout?: number;
334
+ timeout?: number | undefined;
335
335
  /**
336
336
  * Scheduling strategy to apply when picking the next free socket to use. Default: 'fifo'.
337
337
  */
338
- scheduling?: 'fifo' | 'lifo';
338
+ scheduling?: 'fifo' | 'lifo' | undefined;
339
339
  }
340
340
 
341
341
  class Agent {