@types/node 18.16.1 → 18.16.3

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 (5) hide show
  1. node/README.md +1 -1
  2. node/http.d.ts +55 -0
  3. node/package.json +2 -2
  4. node/tls.d.ts +7 -0
  5. node/ts4.8/tls.d.ts +7 -0
node/README.md CHANGED
@@ -8,7 +8,7 @@ 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: Tue, 25 Apr 2023 21:32:47 GMT
11
+ * Last updated: Sat, 29 Apr 2023 06:32:49 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
node/http.d.ts CHANGED
@@ -345,6 +345,7 @@ declare module 'http' {
345
345
  event: 'connect',
346
346
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
347
347
  ): this;
348
+ addListener(event: 'dropRequest', listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
348
349
  addListener(event: 'request', listener: RequestListener<Request, Response>): this;
349
350
  addListener(
350
351
  event: 'upgrade',
@@ -367,6 +368,7 @@ declare module 'http' {
367
368
  ): boolean;
368
369
  emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean;
369
370
  emit(event: 'connect', req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
371
+ emit(event: 'dropRequest', req: InstanceType<Request>, socket: stream.Duplex): boolean;
370
372
  emit(
371
373
  event: 'request',
372
374
  req: InstanceType<Request>,
@@ -382,6 +384,7 @@ declare module 'http' {
382
384
  on(event: 'checkExpectation', listener: RequestListener<Request, Response>): this;
383
385
  on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
384
386
  on(event: 'connect', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
387
+ on(event: 'dropRequest', listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
385
388
  on(event: 'request', listener: RequestListener<Request, Response>): this;
386
389
  on(event: 'upgrade', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
387
390
  once(event: string, listener: (...args: any[]) => void): this;
@@ -396,6 +399,7 @@ declare module 'http' {
396
399
  event: 'connect',
397
400
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
398
401
  ): this;
402
+ once(event: 'dropRequest', listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
399
403
  once(event: 'request', listener: RequestListener<Request, Response>): this;
400
404
  once(
401
405
  event: 'upgrade',
@@ -413,6 +417,10 @@ declare module 'http' {
413
417
  event: 'connect',
414
418
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
415
419
  ): this;
420
+ prependListener(
421
+ event: 'dropRequest',
422
+ listener: (req: InstanceType<Request>, socket: stream.Duplex) => void,
423
+ ): this;
416
424
  prependListener(event: 'request', listener: RequestListener<Request, Response>): this;
417
425
  prependListener(
418
426
  event: 'upgrade',
@@ -430,6 +438,10 @@ declare module 'http' {
430
438
  event: 'connect',
431
439
  listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
432
440
  ): this;
441
+ prependOnceListener(
442
+ event: 'dropRequest',
443
+ listener: (req: InstanceType<Request>, socket: stream.Duplex) => void,
444
+ ): this;
433
445
  prependOnceListener(event: 'request', listener: RequestListener<Request, Response>): this;
434
446
  prependOnceListener(
435
447
  event: 'upgrade',
@@ -479,11 +491,26 @@ declare module 'http' {
479
491
  setTimeout(msecs: number, callback?: () => void): this;
480
492
  /**
481
493
  * Sets a single header value for the header object.
494
+ * If the header already exists in the to-be-sent headers, its value will be replaced. Use an array of strings to send multiple headers with the same name.
482
495
  * @since v0.4.0
483
496
  * @param name Header name
484
497
  * @param value Header value
485
498
  */
486
499
  setHeader(name: string, value: number | string | ReadonlyArray<string>): this;
500
+ /**
501
+ * Append a single header value for the header object.
502
+ *
503
+ * If the value is an array, this is equivalent of calling this method multiple times.
504
+ *
505
+ * If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`.
506
+ *
507
+ * Depending of the value of `options.uniqueHeaders` when the client request or the server were created,
508
+ * this will end up in the header being sent multiple times or a single time with values joined using `; `.
509
+ * @since v18.3.0, v16.17.0
510
+ * @param name Header name
511
+ * @param value Header value
512
+ */
513
+ appendHeader(name: string, value: string | ReadonlyArray<string>): this;
487
514
  /**
488
515
  * Gets the value of HTTP header with the given name. If such a name doesn't
489
516
  * exist in message, it will be `undefined`.
@@ -610,6 +637,14 @@ declare module 'http' {
610
637
  * @since v0.11.8
611
638
  */
612
639
  statusMessage: string;
640
+ /**
641
+ * If set to `true`, Node.js will check whether the `Content-Length` header value
642
+ * and the size of the body, in bytes, are equal. Mismatching the
643
+ * `Content-Length` header value will result in an `Error` being thrown,
644
+ * identified by `code: 'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`.
645
+ * @since v18.10.0, v16.18.0
646
+ */
647
+ strictContentLength: boolean;
613
648
  constructor(req: Request);
614
649
  assignSocket(socket: Socket): void;
615
650
  detachSocket(socket: Socket): void;
@@ -1090,6 +1125,20 @@ declare module 'http' {
1090
1125
  * @since v0.1.5
1091
1126
  */
1092
1127
  headers: IncomingHttpHeaders;
1128
+ /**
1129
+ * Similar to `message.headers`, but there is no join logic and the values are always arrays of strings, even for headers received just once.
1130
+ *
1131
+ * ```js
1132
+ * // Prints something like:
1133
+ * //
1134
+ * // { 'user-agent': ['curl/7.22.0'],
1135
+ * // host: ['127.0.0.1:8000'],
1136
+ * // accept: ['*'] }
1137
+ * console.log(request.headersDistinct);
1138
+ * ```
1139
+ * @since v18.3.0, v16.17.0
1140
+ */
1141
+ headersDistinct: NodeJS.Dict<string[]>;
1093
1142
  /**
1094
1143
  * The raw request/response headers list exactly as they were received.
1095
1144
  *
@@ -1120,6 +1169,12 @@ declare module 'http' {
1120
1169
  * @since v0.3.0
1121
1170
  */
1122
1171
  trailers: NodeJS.Dict<string>;
1172
+ /**
1173
+ * Similar to `message.trailers`, but there is no join logic and the values are always arrays of strings, even for headers received just once.
1174
+ * Only populated at the `'end'` event.
1175
+ * @since v18.3.0, v16.17.0
1176
+ */
1177
+ trailersDistinct: NodeJS.Dict<string[]>;
1123
1178
  /**
1124
1179
  * The raw request/response trailer keys and values exactly as they were
1125
1180
  * received. Only populated at the `'end'` event.
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.16.1",
3
+ "version": "18.16.3",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -232,6 +232,6 @@
232
232
  },
233
233
  "scripts": {},
234
234
  "dependencies": {},
235
- "typesPublisherContentHash": "d3663b78bd3d78e553ddfd126c148f35e1fe8e6b19795a15ed31c5fed7562192",
235
+ "typesPublisherContentHash": "69f2a06d3dd7a1f50c66f61c4e0df5c3791ce3dd65fc61ad18e536db6528487d",
236
236
  "typeScriptVersion": "4.3"
237
237
  }
node/tls.d.ts CHANGED
@@ -1092,6 +1092,13 @@ declare module 'tls' {
1092
1092
  * are provided, the lowest minimum is used.
1093
1093
  */
1094
1094
  let DEFAULT_MIN_VERSION: SecureVersion;
1095
+ /**
1096
+ * The default value of the ciphers option of tls.createSecureContext().
1097
+ * It can be assigned any of the supported OpenSSL ciphers.
1098
+ * Defaults to the content of crypto.constants.defaultCoreCipherList, unless
1099
+ * changed using CLI options using --tls-default-ciphers.
1100
+ */
1101
+ let DEFAULT_CIPHERS: string;
1095
1102
  /**
1096
1103
  * An immutable array of strings representing the root certificates (in PEM
1097
1104
  * format) used for verifying peer certificates. This is the default value
node/ts4.8/tls.d.ts CHANGED
@@ -1092,6 +1092,13 @@ declare module 'tls' {
1092
1092
  * are provided, the lowest minimum is used.
1093
1093
  */
1094
1094
  let DEFAULT_MIN_VERSION: SecureVersion;
1095
+ /**
1096
+ * The default value of the ciphers option of tls.createSecureContext().
1097
+ * It can be assigned any of the supported OpenSSL ciphers.
1098
+ * Defaults to the content of crypto.constants.defaultCoreCipherList, unless
1099
+ * changed using CLI options using --tls-default-ciphers.
1100
+ */
1101
+ let DEFAULT_CIPHERS: string;
1095
1102
  /**
1096
1103
  * An immutable array of strings representing the root certificates (in PEM
1097
1104
  * format) used for verifying peer certificates. This is the default value