@types/node 20.8.2 → 20.8.4

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.
node/README.md CHANGED
@@ -8,9 +8,9 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 02 Oct 2023 21:06:31 GMT
12
- * Dependencies: none
13
- * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
11
+ * Last updated: Mon, 09 Oct 2023 17:35:36 GMT
12
+ * Dependencies: [@types/undici-types](https://npmjs.com/package/@types/undici-types)
13
+ * Global values: `AbortController`, `AbortSignal`, `FormData`, `Headers`, `Request`, `Response`, `__dirname`, `__filename`, `console`, `exports`, `fetch`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
15
15
  # Credits
16
16
  These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
node/buffer.d.ts CHANGED
@@ -71,7 +71,16 @@ declare module "buffer" {
71
71
  MAX_LENGTH: number;
72
72
  MAX_STRING_LENGTH: number;
73
73
  };
74
- export type TranscodeEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "latin1" | "binary";
74
+ export type TranscodeEncoding =
75
+ | "ascii"
76
+ | "utf8"
77
+ | "utf-8"
78
+ | "utf16le"
79
+ | "utf-16le"
80
+ | "ucs2"
81
+ | "ucs-2"
82
+ | "latin1"
83
+ | "binary";
75
84
  /**
76
85
  * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
77
86
  * encoding to another. Returns a new `Buffer` instance.
node/events.d.ts CHANGED
@@ -502,7 +502,6 @@ declare module "events" {
502
502
  global {
503
503
  namespace NodeJS {
504
504
  interface EventEmitter {
505
-
506
505
  [EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
507
506
  /**
508
507
  * Alias for `emitter.on(eventName, listener)`.
node/globals.d.ts CHANGED
@@ -320,4 +320,62 @@ declare namespace NodeJS {
320
320
  interface ReadOnlyDict<T> {
321
321
  readonly [key: string]: T | undefined;
322
322
  }
323
+
324
+ namespace fetch {
325
+ type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request;
326
+ type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
327
+ type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
328
+ type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
329
+ type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
330
+ : import("undici-types").RequestInit;
331
+ type Request = globalThis.Request;
332
+ type Response = globalThis.Response;
333
+ type Headers = globalThis.Headers;
334
+ type FormData = globalThis.FormData;
335
+ type RequestInit = globalThis.RequestInit;
336
+ type RequestInfo = import("undici-types").RequestInfo;
337
+ type HeadersInit = import("undici-types").HeadersInit;
338
+ type BodyInit = import("undici-types").BodyInit;
339
+ type RequestRedirect = import("undici-types").RequestRedirect;
340
+ type RequestCredentials = import("undici-types").RequestCredentials;
341
+ type RequestMode = import("undici-types").RequestMode;
342
+ type ReferrerPolicy = import("undici-types").ReferrerPolicy;
343
+ type Dispatcher = import("undici-types").Dispatcher;
344
+ type RequestDuplex = import("undici-types").RequestDuplex;
345
+ }
323
346
  }
347
+
348
+ interface RequestInit extends NodeJS.fetch._RequestInit {}
349
+
350
+ declare function fetch(
351
+ input: NodeJS.fetch.RequestInfo,
352
+ init?: RequestInit,
353
+ ): Promise<Response>;
354
+
355
+ interface Request extends NodeJS.fetch._Request {}
356
+ declare var Request: typeof globalThis extends {
357
+ onmessage: any;
358
+ Request: infer T;
359
+ } ? T
360
+ : typeof import("undici-types").Request;
361
+
362
+ interface Response extends NodeJS.fetch._Response {}
363
+ declare var Response: typeof globalThis extends {
364
+ onmessage: any;
365
+ Response: infer T;
366
+ } ? T
367
+ : typeof import("undici-types").Response;
368
+
369
+ interface FormData extends NodeJS.fetch._FormData {}
370
+ declare var FormData: typeof globalThis extends {
371
+ onmessage: any;
372
+ FormData: infer T;
373
+ } ? T
374
+ : typeof import("undici-types").FormData;
375
+
376
+ interface Headers extends NodeJS.fetch._Headers {}
377
+ declare var Headers: typeof globalThis extends {
378
+ onmessage: any;
379
+ Headers: infer T;
380
+ } ? T
381
+ : typeof import("undici-types").Headers;
node/http.d.ts CHANGED
@@ -115,32 +115,32 @@ declare module "http" {
115
115
  type OutgoingHttpHeader = number | string | string[];
116
116
  interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {
117
117
  accept?: string | string[] | undefined;
118
- 'accept-charset'?: string | string[] | undefined;
119
- 'accept-encoding'?: string | string[] | undefined;
120
- 'accept-language'?: string | string[] | undefined;
121
- 'accept-ranges'?: string | undefined;
122
- 'access-control-allow-credentials'?: string | undefined;
123
- 'access-control-allow-headers'?: string | undefined;
124
- 'access-control-allow-methods'?: string | undefined;
125
- 'access-control-allow-origin'?: string | undefined;
126
- 'access-control-expose-headers'?: string | undefined;
127
- 'access-control-max-age'?: string | undefined;
128
- 'access-control-request-headers'?: string | undefined;
129
- 'access-control-request-method'?: string | undefined;
118
+ "accept-charset"?: string | string[] | undefined;
119
+ "accept-encoding"?: string | string[] | undefined;
120
+ "accept-language"?: string | string[] | undefined;
121
+ "accept-ranges"?: string | undefined;
122
+ "access-control-allow-credentials"?: string | undefined;
123
+ "access-control-allow-headers"?: string | undefined;
124
+ "access-control-allow-methods"?: string | undefined;
125
+ "access-control-allow-origin"?: string | undefined;
126
+ "access-control-expose-headers"?: string | undefined;
127
+ "access-control-max-age"?: string | undefined;
128
+ "access-control-request-headers"?: string | undefined;
129
+ "access-control-request-method"?: string | undefined;
130
130
  age?: string | undefined;
131
131
  allow?: string | undefined;
132
132
  authorization?: string | undefined;
133
- 'cache-control'?: string | undefined;
134
- 'cdn-cache-control'?: string | undefined;
133
+ "cache-control"?: string | undefined;
134
+ "cdn-cache-control"?: string | undefined;
135
135
  connection?: string | string[] | undefined;
136
- 'content-disposition'?: string | undefined;
137
- 'content-encoding'?: string | undefined;
138
- 'content-language'?: string | undefined;
139
- 'content-length'?: string | number | undefined;
140
- 'content-location'?: string | undefined;
141
- 'content-range'?: string | undefined;
142
- 'content-security-policy'?: string | undefined;
143
- 'content-security-policy-report-only'?: string | undefined;
136
+ "content-disposition"?: string | undefined;
137
+ "content-encoding"?: string | undefined;
138
+ "content-language"?: string | undefined;
139
+ "content-length"?: string | number | undefined;
140
+ "content-location"?: string | undefined;
141
+ "content-range"?: string | undefined;
142
+ "content-security-policy"?: string | undefined;
143
+ "content-security-policy-report-only"?: string | undefined;
144
144
  cookie?: string | string[] | undefined;
145
145
  dav?: string | string[] | undefined;
146
146
  dnt?: string | undefined;
@@ -151,48 +151,48 @@ declare module "http" {
151
151
  forwarded?: string | undefined;
152
152
  from?: string | undefined;
153
153
  host?: string | undefined;
154
- 'if-match'?: string | undefined;
155
- 'if-modified-since'?: string | undefined;
156
- 'if-none-match'?: string | undefined;
157
- 'if-range'?: string | undefined;
158
- 'if-unmodified-since'?: string | undefined;
159
- 'last-modified'?: string | undefined;
154
+ "if-match"?: string | undefined;
155
+ "if-modified-since"?: string | undefined;
156
+ "if-none-match"?: string | undefined;
157
+ "if-range"?: string | undefined;
158
+ "if-unmodified-since"?: string | undefined;
159
+ "last-modified"?: string | undefined;
160
160
  link?: string | string[] | undefined;
161
161
  location?: string | undefined;
162
- 'max-forwards'?: string | undefined;
162
+ "max-forwards"?: string | undefined;
163
163
  origin?: string | undefined;
164
164
  prgama?: string | string[] | undefined;
165
- 'proxy-authenticate'?: string | string[] | undefined;
166
- 'proxy-authorization'?: string | undefined;
167
- 'public-key-pins'?: string | undefined;
168
- 'public-key-pins-report-only'?: string | undefined;
165
+ "proxy-authenticate"?: string | string[] | undefined;
166
+ "proxy-authorization"?: string | undefined;
167
+ "public-key-pins"?: string | undefined;
168
+ "public-key-pins-report-only"?: string | undefined;
169
169
  range?: string | undefined;
170
170
  referer?: string | undefined;
171
- 'referrer-policy'?: string | undefined;
171
+ "referrer-policy"?: string | undefined;
172
172
  refresh?: string | undefined;
173
- 'retry-after'?: string | undefined;
174
- 'sec-websocket-accept'?: string | undefined;
175
- 'sec-websocket-extensions'?: string | string[] | undefined;
176
- 'sec-websocket-key'?: string | undefined;
177
- 'sec-websocket-protocol'?: string | string[] | undefined;
178
- 'sec-websocket-version'?: string | undefined;
173
+ "retry-after"?: string | undefined;
174
+ "sec-websocket-accept"?: string | undefined;
175
+ "sec-websocket-extensions"?: string | string[] | undefined;
176
+ "sec-websocket-key"?: string | undefined;
177
+ "sec-websocket-protocol"?: string | string[] | undefined;
178
+ "sec-websocket-version"?: string | undefined;
179
179
  server?: string | undefined;
180
- 'set-cookie'?: string | string[] | undefined;
181
- 'strict-transport-security'?: string | undefined;
180
+ "set-cookie"?: string | string[] | undefined;
181
+ "strict-transport-security"?: string | undefined;
182
182
  te?: string | undefined;
183
183
  trailer?: string | undefined;
184
- 'transfer-encoding'?: string | undefined;
185
- 'user-agent'?: string | undefined;
184
+ "transfer-encoding"?: string | undefined;
185
+ "user-agent"?: string | undefined;
186
186
  upgrade?: string | undefined;
187
- 'upgrade-insecure-requests'?: string | undefined;
187
+ "upgrade-insecure-requests"?: string | undefined;
188
188
  vary?: string | undefined;
189
189
  via?: string | string[] | undefined;
190
190
  warning?: string | undefined;
191
- 'www-authenticate'?: string | string[] | undefined;
192
- 'x-content-type-options'?: string | undefined;
193
- 'x-dns-prefetch-control'?: string | undefined;
194
- 'x-frame-options'?: string | undefined;
195
- 'x-xss-protection'?: string | undefined;
191
+ "www-authenticate"?: string | string[] | undefined;
192
+ "x-content-type-options"?: string | undefined;
193
+ "x-dns-prefetch-control"?: string | undefined;
194
+ "x-frame-options"?: string | undefined;
195
+ "x-xss-protection"?: string | undefined;
196
196
  }
197
197
  interface ClientRequestArgs {
198
198
  _defaultAgent?: Agent | undefined;
@@ -423,21 +423,21 @@ declare module "http" {
423
423
  */
424
424
  closeIdleConnections(): void;
425
425
  addListener(event: string, listener: (...args: any[]) => void): this;
426
- addListener(event: 'close', listener: () => void): this;
427
- addListener(event: 'connection', listener: (socket: Socket) => void): this;
428
- addListener(event: 'error', listener: (err: Error) => void): this;
429
- addListener(event: 'listening', listener: () => void): this;
430
- addListener(event: 'checkContinue', listener: RequestListener<Request, Response>): this;
431
- addListener(event: 'checkExpectation', listener: RequestListener<Request, Response>): this;
432
- addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
426
+ addListener(event: "close", listener: () => void): this;
427
+ addListener(event: "connection", listener: (socket: Socket) => void): this;
428
+ addListener(event: "error", listener: (err: Error) => void): this;
429
+ addListener(event: "listening", listener: () => void): this;
430
+ addListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
431
+ addListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
432
+ addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
433
433
  addListener(
434
- event: 'connect',
434
+ event: "connect",
435
435
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
436
436
  ): this;
437
- addListener(event: 'dropRequest', listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
438
- addListener(event: 'request', listener: RequestListener<Request, Response>): this;
437
+ addListener(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
438
+ addListener(event: "request", listener: RequestListener<Request, Response>): this;
439
439
  addListener(
440
- event: 'upgrade',
440
+ event: "upgrade",
441
441
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
442
442
  ): this;
443
443
  emit(event: string, ...args: any[]): boolean;
@@ -477,63 +477,63 @@ declare module "http" {
477
477
  on(event: "request", listener: RequestListener<Request, Response>): this;
478
478
  on(event: "upgrade", listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
479
479
  once(event: string, listener: (...args: any[]) => void): this;
480
- once(event: 'close', listener: () => void): this;
481
- once(event: 'connection', listener: (socket: Socket) => void): this;
482
- once(event: 'error', listener: (err: Error) => void): this;
483
- once(event: 'listening', listener: () => void): this;
484
- once(event: 'checkContinue', listener: RequestListener<Request, Response>): this;
485
- once(event: 'checkExpectation', listener: RequestListener<Request, Response>): this;
486
- once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
480
+ once(event: "close", listener: () => void): this;
481
+ once(event: "connection", listener: (socket: Socket) => void): this;
482
+ once(event: "error", listener: (err: Error) => void): this;
483
+ once(event: "listening", listener: () => void): this;
484
+ once(event: "checkContinue", listener: RequestListener<Request, Response>): this;
485
+ once(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
486
+ once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
487
487
  once(
488
- event: 'connect',
488
+ event: "connect",
489
489
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
490
490
  ): this;
491
- once(event: 'dropRequest', listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
492
- once(event: 'request', listener: RequestListener<Request, Response>): this;
491
+ once(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
492
+ once(event: "request", listener: RequestListener<Request, Response>): this;
493
493
  once(
494
- event: 'upgrade',
494
+ event: "upgrade",
495
495
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
496
496
  ): this;
497
497
  prependListener(event: string, listener: (...args: any[]) => void): this;
498
- prependListener(event: 'close', listener: () => void): this;
499
- prependListener(event: 'connection', listener: (socket: Socket) => void): this;
500
- prependListener(event: 'error', listener: (err: Error) => void): this;
501
- prependListener(event: 'listening', listener: () => void): this;
502
- prependListener(event: 'checkContinue', listener: RequestListener<Request, Response>): this;
503
- prependListener(event: 'checkExpectation', listener: RequestListener<Request, Response>): this;
504
- prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
498
+ prependListener(event: "close", listener: () => void): this;
499
+ prependListener(event: "connection", listener: (socket: Socket) => void): this;
500
+ prependListener(event: "error", listener: (err: Error) => void): this;
501
+ prependListener(event: "listening", listener: () => void): this;
502
+ prependListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
503
+ prependListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
504
+ prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
505
505
  prependListener(
506
- event: 'connect',
506
+ event: "connect",
507
507
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
508
508
  ): this;
509
509
  prependListener(
510
- event: 'dropRequest',
510
+ event: "dropRequest",
511
511
  listener: (req: InstanceType<Request>, socket: stream.Duplex) => void,
512
512
  ): this;
513
- prependListener(event: 'request', listener: RequestListener<Request, Response>): this;
513
+ prependListener(event: "request", listener: RequestListener<Request, Response>): this;
514
514
  prependListener(
515
- event: 'upgrade',
515
+ event: "upgrade",
516
516
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
517
517
  ): this;
518
518
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
519
- prependOnceListener(event: 'close', listener: () => void): this;
520
- prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this;
521
- prependOnceListener(event: 'error', listener: (err: Error) => void): this;
522
- prependOnceListener(event: 'listening', listener: () => void): this;
523
- prependOnceListener(event: 'checkContinue', listener: RequestListener<Request, Response>): this;
524
- prependOnceListener(event: 'checkExpectation', listener: RequestListener<Request, Response>): this;
525
- prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
519
+ prependOnceListener(event: "close", listener: () => void): this;
520
+ prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
521
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
522
+ prependOnceListener(event: "listening", listener: () => void): this;
523
+ prependOnceListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
524
+ prependOnceListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
525
+ prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
526
526
  prependOnceListener(
527
- event: 'connect',
527
+ event: "connect",
528
528
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
529
529
  ): this;
530
530
  prependOnceListener(
531
- event: 'dropRequest',
531
+ event: "dropRequest",
532
532
  listener: (req: InstanceType<Request>, socket: stream.Duplex) => void,
533
533
  ): this;
534
- prependOnceListener(event: 'request', listener: RequestListener<Request, Response>): this;
534
+ prependOnceListener(event: "request", listener: RequestListener<Request, Response>): this;
535
535
  prependOnceListener(
536
- event: 'upgrade',
536
+ event: "upgrade",
537
537
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
538
538
  ): this;
539
539
  }
@@ -1015,26 +1015,26 @@ declare module "http" {
1015
1015
  /**
1016
1016
  * @deprecated
1017
1017
  */
1018
- addListener(event: 'abort', listener: () => void): this;
1018
+ addListener(event: "abort", listener: () => void): this;
1019
1019
  addListener(
1020
- event: 'connect',
1020
+ event: "connect",
1021
1021
  listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1022
1022
  ): this;
1023
- addListener(event: 'continue', listener: () => void): this;
1024
- addListener(event: 'information', listener: (info: InformationEvent) => void): this;
1025
- addListener(event: 'response', listener: (response: IncomingMessage) => void): this;
1026
- addListener(event: 'socket', listener: (socket: Socket) => void): this;
1027
- addListener(event: 'timeout', listener: () => void): this;
1023
+ addListener(event: "continue", listener: () => void): this;
1024
+ addListener(event: "information", listener: (info: InformationEvent) => void): this;
1025
+ addListener(event: "response", listener: (response: IncomingMessage) => void): this;
1026
+ addListener(event: "socket", listener: (socket: Socket) => void): this;
1027
+ addListener(event: "timeout", listener: () => void): this;
1028
1028
  addListener(
1029
- event: 'upgrade',
1029
+ event: "upgrade",
1030
1030
  listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1031
1031
  ): this;
1032
- addListener(event: 'close', listener: () => void): this;
1033
- addListener(event: 'drain', listener: () => void): this;
1034
- addListener(event: 'error', listener: (err: Error) => void): this;
1035
- addListener(event: 'finish', listener: () => void): this;
1036
- addListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
1037
- addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
1032
+ addListener(event: "close", listener: () => void): this;
1033
+ addListener(event: "drain", listener: () => void): this;
1034
+ addListener(event: "error", listener: (err: Error) => void): this;
1035
+ addListener(event: "finish", listener: () => void): this;
1036
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
1037
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
1038
1038
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1039
1039
  /**
1040
1040
  * @deprecated
@@ -1075,50 +1075,50 @@ declare module "http" {
1075
1075
  /**
1076
1076
  * @deprecated
1077
1077
  */
1078
- prependListener(event: 'abort', listener: () => void): this;
1078
+ prependListener(event: "abort", listener: () => void): this;
1079
1079
  prependListener(
1080
- event: 'connect',
1080
+ event: "connect",
1081
1081
  listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1082
1082
  ): this;
1083
- prependListener(event: 'continue', listener: () => void): this;
1084
- prependListener(event: 'information', listener: (info: InformationEvent) => void): this;
1085
- prependListener(event: 'response', listener: (response: IncomingMessage) => void): this;
1086
- prependListener(event: 'socket', listener: (socket: Socket) => void): this;
1087
- prependListener(event: 'timeout', listener: () => void): this;
1083
+ prependListener(event: "continue", listener: () => void): this;
1084
+ prependListener(event: "information", listener: (info: InformationEvent) => void): this;
1085
+ prependListener(event: "response", listener: (response: IncomingMessage) => void): this;
1086
+ prependListener(event: "socket", listener: (socket: Socket) => void): this;
1087
+ prependListener(event: "timeout", listener: () => void): this;
1088
1088
  prependListener(
1089
- event: 'upgrade',
1089
+ event: "upgrade",
1090
1090
  listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1091
1091
  ): this;
1092
- prependListener(event: 'close', listener: () => void): this;
1093
- prependListener(event: 'drain', listener: () => void): this;
1094
- prependListener(event: 'error', listener: (err: Error) => void): this;
1095
- prependListener(event: 'finish', listener: () => void): this;
1096
- prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
1097
- prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
1092
+ prependListener(event: "close", listener: () => void): this;
1093
+ prependListener(event: "drain", listener: () => void): this;
1094
+ prependListener(event: "error", listener: (err: Error) => void): this;
1095
+ prependListener(event: "finish", listener: () => void): this;
1096
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
1097
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
1098
1098
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
1099
1099
  /**
1100
1100
  * @deprecated
1101
1101
  */
1102
- prependOnceListener(event: 'abort', listener: () => void): this;
1102
+ prependOnceListener(event: "abort", listener: () => void): this;
1103
1103
  prependOnceListener(
1104
- event: 'connect',
1104
+ event: "connect",
1105
1105
  listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1106
1106
  ): this;
1107
- prependOnceListener(event: 'continue', listener: () => void): this;
1108
- prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this;
1109
- prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this;
1110
- prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this;
1111
- prependOnceListener(event: 'timeout', listener: () => void): this;
1107
+ prependOnceListener(event: "continue", listener: () => void): this;
1108
+ prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this;
1109
+ prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this;
1110
+ prependOnceListener(event: "socket", listener: (socket: Socket) => void): this;
1111
+ prependOnceListener(event: "timeout", listener: () => void): this;
1112
1112
  prependOnceListener(
1113
- event: 'upgrade',
1113
+ event: "upgrade",
1114
1114
  listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1115
1115
  ): this;
1116
- prependOnceListener(event: 'close', listener: () => void): this;
1117
- prependOnceListener(event: 'drain', listener: () => void): this;
1118
- prependOnceListener(event: 'error', listener: (err: Error) => void): this;
1119
- prependOnceListener(event: 'finish', listener: () => void): this;
1120
- prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
1121
- prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
1116
+ prependOnceListener(event: "close", listener: () => void): this;
1117
+ prependOnceListener(event: "drain", listener: () => void): this;
1118
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
1119
+ prependOnceListener(event: "finish", listener: () => void): this;
1120
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
1121
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
1122
1122
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
1123
1123
  }
1124
1124
  /**
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.8.2",
3
+ "version": "20.8.4",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -226,7 +226,9 @@
226
226
  "directory": "types/node"
227
227
  },
228
228
  "scripts": {},
229
- "dependencies": {},
230
- "typesPublisherContentHash": "6fe03076f21a2582000286d4d4d3451cf25369d7fcdb3e021c336aa70cfc3f68",
229
+ "dependencies": {
230
+ "undici-types": "~5.25.1"
231
+ },
232
+ "typesPublisherContentHash": "2838dc399a85e9b85a3a405ba23ca1871738adf3d0908db1877a2e5c39a9f7a6",
231
233
  "typeScriptVersion": "4.5"
232
234
  }
node/test.d.ts CHANGED
@@ -1378,5 +1378,5 @@ declare module "node:test/reporters" {
1378
1378
  * The `junit` reporter outputs test results in a jUnit XML format
1379
1379
  */
1380
1380
  function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
1381
- export { dot, Spec as spec, tap, junit, TestEvent };
1381
+ export { dot, junit, Spec as spec, tap, TestEvent };
1382
1382
  }
node/ts4.8/buffer.d.ts CHANGED
@@ -71,7 +71,16 @@ declare module "buffer" {
71
71
  MAX_LENGTH: number;
72
72
  MAX_STRING_LENGTH: number;
73
73
  };
74
- export type TranscodeEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "latin1" | "binary";
74
+ export type TranscodeEncoding =
75
+ | "ascii"
76
+ | "utf8"
77
+ | "utf-8"
78
+ | "utf16le"
79
+ | "utf-16le"
80
+ | "ucs2"
81
+ | "ucs-2"
82
+ | "latin1"
83
+ | "binary";
75
84
  /**
76
85
  * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
77
86
  * encoding to another. Returns a new `Buffer` instance.
node/ts4.8/globals.d.ts CHANGED
@@ -320,4 +320,62 @@ declare namespace NodeJS {
320
320
  interface ReadOnlyDict<T> {
321
321
  readonly [key: string]: T | undefined;
322
322
  }
323
+
324
+ namespace fetch {
325
+ type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request;
326
+ type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
327
+ type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
328
+ type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
329
+ type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
330
+ : import("undici-types").RequestInit;
331
+ type Request = globalThis.Request;
332
+ type Response = globalThis.Response;
333
+ type Headers = globalThis.Headers;
334
+ type FormData = globalThis.FormData;
335
+ type RequestInit = globalThis.RequestInit;
336
+ type RequestInfo = import("undici-types").RequestInfo;
337
+ type HeadersInit = import("undici-types").HeadersInit;
338
+ type BodyInit = import("undici-types").BodyInit;
339
+ type RequestRedirect = import("undici-types").RequestRedirect;
340
+ type RequestCredentials = import("undici-types").RequestCredentials;
341
+ type RequestMode = import("undici-types").RequestMode;
342
+ type ReferrerPolicy = import("undici-types").ReferrerPolicy;
343
+ type Dispatcher = import("undici-types").Dispatcher;
344
+ type RequestDuplex = import("undici-types").RequestDuplex;
345
+ }
323
346
  }
347
+
348
+ interface RequestInit extends NodeJS.fetch._RequestInit {}
349
+
350
+ declare function fetch(
351
+ input: NodeJS.fetch.RequestInfo,
352
+ init?: RequestInit,
353
+ ): Promise<Response>;
354
+
355
+ interface Request extends NodeJS.fetch._Request {}
356
+ declare var Request: typeof globalThis extends {
357
+ onmessage: any;
358
+ Request: infer T;
359
+ } ? T
360
+ : typeof import("undici-types").Request;
361
+
362
+ interface Response extends NodeJS.fetch._Response {}
363
+ declare var Response: typeof globalThis extends {
364
+ onmessage: any;
365
+ Response: infer T;
366
+ } ? T
367
+ : typeof import("undici-types").Response;
368
+
369
+ interface FormData extends NodeJS.fetch._FormData {}
370
+ declare var FormData: typeof globalThis extends {
371
+ onmessage: any;
372
+ FormData: infer T;
373
+ } ? T
374
+ : typeof import("undici-types").FormData;
375
+
376
+ interface Headers extends NodeJS.fetch._Headers {}
377
+ declare var Headers: typeof globalThis extends {
378
+ onmessage: any;
379
+ Headers: infer T;
380
+ } ? T
381
+ : typeof import("undici-types").Headers;
node/ts4.8/http.d.ts CHANGED
@@ -115,32 +115,32 @@ declare module "http" {
115
115
  type OutgoingHttpHeader = number | string | string[];
116
116
  interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {
117
117
  accept?: string | string[] | undefined;
118
- 'accept-charset'?: string | string[] | undefined;
119
- 'accept-encoding'?: string | string[] | undefined;
120
- 'accept-language'?: string | string[] | undefined;
121
- 'accept-ranges'?: string | undefined;
122
- 'access-control-allow-credentials'?: string | undefined;
123
- 'access-control-allow-headers'?: string | undefined;
124
- 'access-control-allow-methods'?: string | undefined;
125
- 'access-control-allow-origin'?: string | undefined;
126
- 'access-control-expose-headers'?: string | undefined;
127
- 'access-control-max-age'?: string | undefined;
128
- 'access-control-request-headers'?: string | undefined;
129
- 'access-control-request-method'?: string | undefined;
118
+ "accept-charset"?: string | string[] | undefined;
119
+ "accept-encoding"?: string | string[] | undefined;
120
+ "accept-language"?: string | string[] | undefined;
121
+ "accept-ranges"?: string | undefined;
122
+ "access-control-allow-credentials"?: string | undefined;
123
+ "access-control-allow-headers"?: string | undefined;
124
+ "access-control-allow-methods"?: string | undefined;
125
+ "access-control-allow-origin"?: string | undefined;
126
+ "access-control-expose-headers"?: string | undefined;
127
+ "access-control-max-age"?: string | undefined;
128
+ "access-control-request-headers"?: string | undefined;
129
+ "access-control-request-method"?: string | undefined;
130
130
  age?: string | undefined;
131
131
  allow?: string | undefined;
132
132
  authorization?: string | undefined;
133
- 'cache-control'?: string | undefined;
134
- 'cdn-cache-control'?: string | undefined;
133
+ "cache-control"?: string | undefined;
134
+ "cdn-cache-control"?: string | undefined;
135
135
  connection?: string | string[] | undefined;
136
- 'content-disposition'?: string | undefined;
137
- 'content-encoding'?: string | undefined;
138
- 'content-language'?: string | undefined;
139
- 'content-length'?: string | number | undefined;
140
- 'content-location'?: string | undefined;
141
- 'content-range'?: string | undefined;
142
- 'content-security-policy'?: string | undefined;
143
- 'content-security-policy-report-only'?: string | undefined;
136
+ "content-disposition"?: string | undefined;
137
+ "content-encoding"?: string | undefined;
138
+ "content-language"?: string | undefined;
139
+ "content-length"?: string | number | undefined;
140
+ "content-location"?: string | undefined;
141
+ "content-range"?: string | undefined;
142
+ "content-security-policy"?: string | undefined;
143
+ "content-security-policy-report-only"?: string | undefined;
144
144
  cookie?: string | string[] | undefined;
145
145
  dav?: string | string[] | undefined;
146
146
  dnt?: string | undefined;
@@ -151,48 +151,48 @@ declare module "http" {
151
151
  forwarded?: string | undefined;
152
152
  from?: string | undefined;
153
153
  host?: string | undefined;
154
- 'if-match'?: string | undefined;
155
- 'if-modified-since'?: string | undefined;
156
- 'if-none-match'?: string | undefined;
157
- 'if-range'?: string | undefined;
158
- 'if-unmodified-since'?: string | undefined;
159
- 'last-modified'?: string | undefined;
154
+ "if-match"?: string | undefined;
155
+ "if-modified-since"?: string | undefined;
156
+ "if-none-match"?: string | undefined;
157
+ "if-range"?: string | undefined;
158
+ "if-unmodified-since"?: string | undefined;
159
+ "last-modified"?: string | undefined;
160
160
  link?: string | string[] | undefined;
161
161
  location?: string | undefined;
162
- 'max-forwards'?: string | undefined;
162
+ "max-forwards"?: string | undefined;
163
163
  origin?: string | undefined;
164
164
  prgama?: string | string[] | undefined;
165
- 'proxy-authenticate'?: string | string[] | undefined;
166
- 'proxy-authorization'?: string | undefined;
167
- 'public-key-pins'?: string | undefined;
168
- 'public-key-pins-report-only'?: string | undefined;
165
+ "proxy-authenticate"?: string | string[] | undefined;
166
+ "proxy-authorization"?: string | undefined;
167
+ "public-key-pins"?: string | undefined;
168
+ "public-key-pins-report-only"?: string | undefined;
169
169
  range?: string | undefined;
170
170
  referer?: string | undefined;
171
- 'referrer-policy'?: string | undefined;
171
+ "referrer-policy"?: string | undefined;
172
172
  refresh?: string | undefined;
173
- 'retry-after'?: string | undefined;
174
- 'sec-websocket-accept'?: string | undefined;
175
- 'sec-websocket-extensions'?: string | string[] | undefined;
176
- 'sec-websocket-key'?: string | undefined;
177
- 'sec-websocket-protocol'?: string | string[] | undefined;
178
- 'sec-websocket-version'?: string | undefined;
173
+ "retry-after"?: string | undefined;
174
+ "sec-websocket-accept"?: string | undefined;
175
+ "sec-websocket-extensions"?: string | string[] | undefined;
176
+ "sec-websocket-key"?: string | undefined;
177
+ "sec-websocket-protocol"?: string | string[] | undefined;
178
+ "sec-websocket-version"?: string | undefined;
179
179
  server?: string | undefined;
180
- 'set-cookie'?: string | string[] | undefined;
181
- 'strict-transport-security'?: string | undefined;
180
+ "set-cookie"?: string | string[] | undefined;
181
+ "strict-transport-security"?: string | undefined;
182
182
  te?: string | undefined;
183
183
  trailer?: string | undefined;
184
- 'transfer-encoding'?: string | undefined;
185
- 'user-agent'?: string | undefined;
184
+ "transfer-encoding"?: string | undefined;
185
+ "user-agent"?: string | undefined;
186
186
  upgrade?: string | undefined;
187
- 'upgrade-insecure-requests'?: string | undefined;
187
+ "upgrade-insecure-requests"?: string | undefined;
188
188
  vary?: string | undefined;
189
189
  via?: string | string[] | undefined;
190
190
  warning?: string | undefined;
191
- 'www-authenticate'?: string | string[] | undefined;
192
- 'x-content-type-options'?: string | undefined;
193
- 'x-dns-prefetch-control'?: string | undefined;
194
- 'x-frame-options'?: string | undefined;
195
- 'x-xss-protection'?: string | undefined;
191
+ "www-authenticate"?: string | string[] | undefined;
192
+ "x-content-type-options"?: string | undefined;
193
+ "x-dns-prefetch-control"?: string | undefined;
194
+ "x-frame-options"?: string | undefined;
195
+ "x-xss-protection"?: string | undefined;
196
196
  }
197
197
  interface ClientRequestArgs {
198
198
  _defaultAgent?: Agent | undefined;
node/ts4.8/test.d.ts CHANGED
@@ -1378,5 +1378,5 @@ declare module "node:test/reporters" {
1378
1378
  * The `junit` reporter outputs test results in a jUnit XML format
1379
1379
  */
1380
1380
  function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
1381
- export { dot, Spec as spec, tap, junit, TestEvent };
1381
+ export { dot, junit, Spec as spec, tap, TestEvent };
1382
1382
  }