@types/node 16.11.64 → 16.11.66

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 v16.11/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/v16.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 03 Oct 2022 22:33:04 GMT
11
+ * Last updated: Sat, 15 Oct 2022 21:33:15 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
14
14
 
node v16.11/http.d.ts CHANGED
@@ -1465,6 +1465,25 @@ declare module 'http' {
1465
1465
  */
1466
1466
  function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
1467
1467
  function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
1468
+
1469
+ /**
1470
+ * Performs the low-level validations on the provided name that are done when `res.setHeader(name, value)` is called.
1471
+ * Passing illegal value as name will result in a TypeError being thrown, identified by `code: 'ERR_INVALID_HTTP_TOKEN'`.
1472
+ * @param name Header name
1473
+ * @since v14.3.0
1474
+ */
1475
+ function validateHeaderName(name: string): void;
1476
+ /**
1477
+ * Performs the low-level validations on the provided value that are done when `res.setHeader(name, value)` is called.
1478
+ * Passing illegal value as value will result in a TypeError being thrown.
1479
+ * - Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`.
1480
+ * - Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`.
1481
+ * @param name Header name
1482
+ * @param value Header value
1483
+ * @since v14.3.0
1484
+ */
1485
+ function validateHeaderValue(name: string, value: string): void;
1486
+
1468
1487
  let globalAgent: Agent;
1469
1488
  /**
1470
1489
  * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.11.64",
3
+ "version": "16.11.66",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -227,6 +227,6 @@
227
227
  },
228
228
  "scripts": {},
229
229
  "dependencies": {},
230
- "typesPublisherContentHash": "ee1afca298a6f737a7b417dcc5bdf25fb305bf10e06a5b5b5becdb6cde8ee564",
230
+ "typesPublisherContentHash": "532925f70333cc189dd8444db5cada50200f6824ef5e062f067bcd4fe415dea6",
231
231
  "typeScriptVersion": "4.1"
232
232
  }
node v16.11/stream.d.ts CHANGED
@@ -18,6 +18,7 @@
18
18
  */
19
19
  declare module 'stream' {
20
20
  import { EventEmitter, Abortable } from 'node:events';
21
+ import { Blob } from 'node:buffer';
21
22
  import * as streamPromises from 'node:stream/promises';
22
23
  import * as streamConsumers from 'node:stream/consumers';
23
24
  class internal extends EventEmitter {
@@ -45,6 +45,7 @@
45
45
  */
46
46
  declare module 'buffer' {
47
47
  import { BinaryLike } from 'node:crypto';
48
+ import { ReadableStream as WebReadableStream } from 'node:stream/web';
48
49
  export const INSPECT_MAX_BYTES: number;
49
50
  export const kMaxLength: number;
50
51
  export const kStringMaxLength: number;
@@ -158,10 +159,10 @@ declare module 'buffer' {
158
159
  */
159
160
  text(): Promise<string>;
160
161
  /**
161
- * Returns a new `ReadableStream` that allows the content of the `Blob` to be read.
162
+ * Returns a new (WHATWG) `ReadableStream` that allows the content of the `Blob` to be read.
162
163
  * @since v16.7.0
163
164
  */
164
- stream(): unknown; // pending web streams types
165
+ stream(): WebReadableStream;
165
166
  }
166
167
  export import atob = globalThis.atob;
167
168
  export import btoa = globalThis.btoa;
@@ -1465,6 +1465,25 @@ declare module 'http' {
1465
1465
  */
1466
1466
  function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
1467
1467
  function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
1468
+
1469
+ /**
1470
+ * Performs the low-level validations on the provided name that are done when `res.setHeader(name, value)` is called.
1471
+ * Passing illegal value as name will result in a TypeError being thrown, identified by `code: 'ERR_INVALID_HTTP_TOKEN'`.
1472
+ * @param name Header name
1473
+ * @since v14.3.0
1474
+ */
1475
+ function validateHeaderName(name: string): void;
1476
+ /**
1477
+ * Performs the low-level validations on the provided value that are done when `res.setHeader(name, value)` is called.
1478
+ * Passing illegal value as value will result in a TypeError being thrown.
1479
+ * - Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`.
1480
+ * - Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`.
1481
+ * @param name Header name
1482
+ * @param value Header value
1483
+ * @since v14.3.0
1484
+ */
1485
+ function validateHeaderValue(name: string, value: string): void;
1486
+
1468
1487
  let globalAgent: Agent;
1469
1488
  /**
1470
1489
  * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
@@ -1,22 +1,10 @@
1
- // Duplicates of interface in lib.dom.ts.
2
- // Duplicated here rather than referencing lib.dom.ts because doing so causes lib.dom.ts to be loaded for "test-all"
3
- // Which in turn causes tests to pass that shouldn't pass.
4
- //
5
- // This interface is not, and should not be, exported.
6
- interface Blob {
7
- readonly size: number;
8
- readonly type: string;
9
- arrayBuffer(): Promise<ArrayBuffer>;
10
- slice(start?: number, end?: number, contentType?: string): Blob;
11
- stream(): NodeJS.ReadableStream;
12
- text(): Promise<string>;
13
- }
14
1
  declare module 'stream/consumers' {
15
2
  import { Readable } from 'node:stream';
3
+ import { Blob as NodeBlob } from "node:buffer";
16
4
  function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Buffer>;
17
5
  function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<string>;
18
6
  function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<ArrayBuffer>;
19
- function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Blob>;
7
+ function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<NodeBlob>;
20
8
  function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<unknown>;
21
9
  }
22
10
  declare module 'node:stream/consumers' {
@@ -18,6 +18,7 @@
18
18
  */
19
19
  declare module 'stream' {
20
20
  import { EventEmitter, Abortable } from 'node:events';
21
+ import { Blob } from 'node:buffer';
21
22
  import * as streamPromises from 'node:stream/promises';
22
23
  import * as streamConsumers from 'node:stream/consumers';
23
24
  class internal extends EventEmitter {