@types/node 16.7.0 → 16.7.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,7 +8,7 @@ This package contains type definitions for Node.js (http://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: Fri, 20 Aug 2021 20:01:22 GMT
11
+ * Last updated: Fri, 27 Aug 2021 18:31:21 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
14
14
 
node/child_process.d.ts CHANGED
@@ -1248,7 +1248,7 @@ declare module 'child_process' {
1248
1248
  }
1249
1249
  interface SpawnSyncReturns<T> {
1250
1250
  pid: number;
1251
- output: string[];
1251
+ output: Array<T | null>;
1252
1252
  stdout: T;
1253
1253
  stderr: T;
1254
1254
  status: number | null;
node/fs.d.ts CHANGED
@@ -188,7 +188,7 @@ declare module 'fs' {
188
188
  /**
189
189
  * A class representing a directory stream.
190
190
  *
191
- * Created by {@link opendir}, {@link opendirSync}, or {@link romises.opendir}.
191
+ * Created by {@link opendir}, {@link opendirSync}, or {@link promises.opendir}.
192
192
  *
193
193
  * ```js
194
194
  * import { opendir } from 'fs/promises';
@@ -208,7 +208,7 @@ declare module 'fs' {
208
208
  */
209
209
  export class Dir implements AsyncIterable<Dirent> {
210
210
  /**
211
- * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or {@link romises.opendir}.
211
+ * The read-only path of this directory as was provided to {@link opendir}, {@link opendirSync}, or {@link promises.opendir}.
212
212
  * @since v12.12.0
213
213
  */
214
214
  readonly path: string;
node/index.d.ts CHANGED
@@ -69,16 +69,64 @@
69
69
  * IN THE SOFTWARE.
70
70
  */
71
71
 
72
- // NOTE: These definitions support NodeJS and TypeScript 3.7.
73
- // Typically type modifications should be made in base.d.ts instead of here
72
+ // NOTE: These definitions support NodeJS and TypeScript 3.7+.
74
73
 
75
- /// <reference path="base.d.ts" />
74
+ // Reference required types from the default lib:
75
+ /// <reference lib="es2020" />
76
+ /// <reference lib="esnext.asynciterable" />
77
+ /// <reference lib="esnext.intl" />
78
+ /// <reference lib="esnext.bigint" />
76
79
 
77
- // NOTE: TypeScript version-specific augmentations can be found in the following paths:
78
- // - ~/base.d.ts - Shared definitions common to all TypeScript versions
79
- // - ~/index.d.ts - Definitions specific to TypeScript 3.7
80
- // - ~/ts3.6/index.d.ts - Definitions specific to TypeScript 3.6
80
+ // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
81
+ /// <reference path="assert.d.ts" />
82
+ /// <reference path="assert/strict.d.ts" />
83
+ /// <reference path="globals.d.ts" />
84
+ /// <reference path="async_hooks.d.ts" />
85
+ /// <reference path="buffer.d.ts" />
86
+ /// <reference path="child_process.d.ts" />
87
+ /// <reference path="cluster.d.ts" />
88
+ /// <reference path="console.d.ts" />
89
+ /// <reference path="constants.d.ts" />
90
+ /// <reference path="crypto.d.ts" />
91
+ /// <reference path="dgram.d.ts" />
92
+ /// <reference path="diagnostics_channel.d.ts" />
93
+ /// <reference path="dns.d.ts" />
94
+ /// <reference path="dns/promises.d.ts" />
95
+ /// <reference path="dns/promises.d.ts" />
96
+ /// <reference path="domain.d.ts" />
97
+ /// <reference path="events.d.ts" />
98
+ /// <reference path="fs.d.ts" />
99
+ /// <reference path="fs/promises.d.ts" />
100
+ /// <reference path="http.d.ts" />
101
+ /// <reference path="http2.d.ts" />
102
+ /// <reference path="https.d.ts" />
103
+ /// <reference path="inspector.d.ts" />
104
+ /// <reference path="module.d.ts" />
105
+ /// <reference path="net.d.ts" />
106
+ /// <reference path="os.d.ts" />
107
+ /// <reference path="path.d.ts" />
108
+ /// <reference path="perf_hooks.d.ts" />
109
+ /// <reference path="process.d.ts" />
110
+ /// <reference path="punycode.d.ts" />
111
+ /// <reference path="querystring.d.ts" />
112
+ /// <reference path="readline.d.ts" />
113
+ /// <reference path="repl.d.ts" />
114
+ /// <reference path="stream.d.ts" />
115
+ /// <reference path="stream/promises.d.ts" />
116
+ /// <reference path="stream/consumers.d.ts" />
117
+ /// <reference path="stream/web.d.ts" />
118
+ /// <reference path="string_decoder.d.ts" />
119
+ /// <reference path="timers.d.ts" />
120
+ /// <reference path="timers/promises.d.ts" />
121
+ /// <reference path="tls.d.ts" />
122
+ /// <reference path="trace_events.d.ts" />
123
+ /// <reference path="tty.d.ts" />
124
+ /// <reference path="url.d.ts" />
125
+ /// <reference path="util.d.ts" />
126
+ /// <reference path="v8.d.ts" />
127
+ /// <reference path="vm.d.ts" />
128
+ /// <reference path="wasi.d.ts" />
129
+ /// <reference path="worker_threads.d.ts" />
130
+ /// <reference path="zlib.d.ts" />
81
131
 
82
- // NOTE: Augmentations for TypeScript 3.6 and later should use individual files for overrides
83
- // within the respective ~/ts3.6 (or later) folder. However, this is disallowed for versions
84
- // prior to TypeScript 3.6, so the older definitions will be found here.
132
+ /// <reference path="globals.global.d.ts" />
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.7.0",
3
+ "version": "16.7.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",
@@ -223,13 +223,6 @@
223
223
  ],
224
224
  "main": "",
225
225
  "types": "index.d.ts",
226
- "typesVersions": {
227
- "<=3.6": {
228
- "*": [
229
- "ts3.6/*"
230
- ]
231
- }
232
- },
233
226
  "repository": {
234
227
  "type": "git",
235
228
  "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
@@ -237,6 +230,6 @@
237
230
  },
238
231
  "scripts": {},
239
232
  "dependencies": {},
240
- "typesPublisherContentHash": "7cd86199c47cc6326c3466fa04e6a7ddc2670bd283713c0c6ef81cfe9e715118",
233
+ "typesPublisherContentHash": "648f940c27be6330c253b8572452c11333ea8e77ecb5b8e4eeba1f4447928eb4",
241
234
  "typeScriptVersion": "3.7"
242
235
  }
@@ -0,0 +1,25 @@
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
+
15
+ declare module 'stream/consumers' {
16
+ import { Readable } from 'node:stream';
17
+ function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Buffer>;
18
+ function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<string>;
19
+ function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<ArrayBuffer>;
20
+ function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Blob>;
21
+ function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<unknown>;
22
+ }
23
+ declare module 'node:stream/consumers' {
24
+ export * from 'stream/consumers';
25
+ }
node/stream.d.ts CHANGED
@@ -19,6 +19,7 @@
19
19
  declare module 'stream' {
20
20
  import { EventEmitter, Abortable } from 'node:events';
21
21
  import * as streamPromises from 'node:stream/promises';
22
+ import * as streamConsumers from 'node:stream/consumers';
22
23
  class internal extends EventEmitter {
23
24
  pipe<T extends NodeJS.WritableStream>(
24
25
  destination: T,
@@ -1169,6 +1170,7 @@ declare module 'stream' {
1169
1170
  unref(): void;
1170
1171
  }
1171
1172
  const promises: typeof streamPromises;
1173
+ const consumers: typeof streamConsumers;
1172
1174
  }
1173
1175
  export = internal;
1174
1176
  }
node/base.d.ts DELETED
@@ -1,19 +0,0 @@
1
- // NOTE: These definitions support NodeJS and TypeScript 3.7.
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.7/base.d.ts - Definitions specific to TypeScript 3.7
7
- // - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in
8
-
9
- // Reference required types from the default lib:
10
- /// <reference lib="es2020" />
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
- /// <reference path="ts3.6/base.d.ts" />
17
-
18
- // TypeScript 3.7-specific augmentations:
19
- /// <reference path="assert.d.ts" />
node/ts3.6/assert.d.ts DELETED
@@ -1,103 +0,0 @@
1
- declare module 'assert' {
2
- /** An alias of `assert.ok()`. */
3
- function assert(value: unknown, message?: string | Error): void;
4
- namespace assert {
5
- class AssertionError extends Error {
6
- actual: unknown;
7
- expected: unknown;
8
- operator: string;
9
- generatedMessage: boolean;
10
- code: 'ERR_ASSERTION';
11
-
12
- constructor(options?: {
13
- /** If provided, the error message is set to this value. */
14
- message?: string;
15
- /** The `actual` property on the error instance. */
16
- actual?: unknown;
17
- /** The `expected` property on the error instance. */
18
- expected?: unknown;
19
- /** The `operator` property on the error instance. */
20
- operator?: string;
21
- /** If provided, the generated stack trace omits frames before this function. */
22
- // tslint:disable-next-line:ban-types
23
- stackStartFn?: Function;
24
- });
25
- }
26
-
27
- class CallTracker {
28
- calls(exact?: number): () => void;
29
- calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
30
- report(): CallTrackerReportInformation[];
31
- verify(): void;
32
- }
33
- interface CallTrackerReportInformation {
34
- message: string;
35
- /** The actual number of times the function was called. */
36
- actual: number;
37
- /** The number of times the function was expected to be called. */
38
- expected: number;
39
- /** The name of the function that is wrapped. */
40
- operator: string;
41
- /** A stack trace of the function. */
42
- stack: object;
43
- }
44
-
45
- type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error;
46
-
47
- function fail(message?: string | Error): never;
48
- /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
49
- function fail(
50
- actual: unknown,
51
- expected: unknown,
52
- message?: string | Error,
53
- operator?: string,
54
- // tslint:disable-next-line:ban-types
55
- stackStartFn?: Function,
56
- ): never;
57
- function ok(value: unknown, message?: string | Error): void;
58
- /** @deprecated since v9.9.0 - use strictEqual() instead. */
59
- function equal(actual: unknown, expected: unknown, message?: string | Error): void;
60
- /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
61
- function notEqual(actual: unknown, expected: unknown, message?: string | Error): void;
62
- /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
63
- function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
64
- /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
65
- function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void;
66
- function strictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
67
- function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
68
- function deepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
69
- function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
70
-
71
- function throws(block: () => unknown, message?: string | Error): void;
72
- function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
73
- function doesNotThrow(block: () => unknown, message?: string | Error): void;
74
- function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void;
75
-
76
- function ifError(value: unknown): void;
77
-
78
- function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
79
- function rejects(
80
- block: (() => Promise<unknown>) | Promise<unknown>,
81
- error: AssertPredicate,
82
- message?: string | Error,
83
- ): Promise<void>;
84
- function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
85
- function doesNotReject(
86
- block: (() => Promise<unknown>) | Promise<unknown>,
87
- error: AssertPredicate,
88
- message?: string | Error,
89
- ): Promise<void>;
90
-
91
- function match(value: string, regExp: RegExp, message?: string | Error): void;
92
- function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
93
-
94
- const strict: typeof assert;
95
- }
96
-
97
- export = assert;
98
- }
99
-
100
- declare module 'node:assert' {
101
- import assert = require('assert');
102
- export = assert;
103
- }
node/ts3.6/base.d.ts DELETED
@@ -1,68 +0,0 @@
1
- // NOTE: These definitions support NodeJS and TypeScript 3.6 and earlier.
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 3.7 and above
6
- // - ~/ts3.6/base.d.ts - Definitions specific to TypeScript 3.6 and earlier
7
- // - ~/ts3.6/index.d.ts - Definitions specific to TypeScript 3.6 and earlier with assert pulled in
8
-
9
- // Reference required types from the default lib:
10
- /// <reference lib="es2020" />
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
- /// <reference path="../assert/strict.d.ts" />
17
- /// <reference path="../globals.d.ts" />
18
- /// <reference path="../async_hooks.d.ts" />
19
- /// <reference path="../buffer.d.ts" />
20
- /// <reference path="../child_process.d.ts" />
21
- /// <reference path="../cluster.d.ts" />
22
- /// <reference path="../console.d.ts" />
23
- /// <reference path="../constants.d.ts" />
24
- /// <reference path="../crypto.d.ts" />
25
- /// <reference path="../dgram.d.ts" />
26
- /// <reference path="../diagnostics_channel.d.ts" />
27
- /// <reference path="../dns.d.ts" />
28
- /// <reference path="../dns/promises.d.ts" />
29
- /// <reference path="../dns/promises.d.ts" />
30
- /// <reference path="../domain.d.ts" />
31
- /// <reference path="../events.d.ts" />
32
- /// <reference path="../fs.d.ts" />
33
- /// <reference path="../fs/promises.d.ts" />
34
- /// <reference path="../http.d.ts" />
35
- /// <reference path="../http2.d.ts" />
36
- /// <reference path="../https.d.ts" />
37
- /// <reference path="../inspector.d.ts" />
38
- /// <reference path="../module.d.ts" />
39
- /// <reference path="../net.d.ts" />
40
- /// <reference path="../os.d.ts" />
41
- /// <reference path="../path.d.ts" />
42
- /// <reference path="../perf_hooks.d.ts" />
43
- /// <reference path="../process.d.ts" />
44
- /// <reference path="../punycode.d.ts" />
45
- /// <reference path="../querystring.d.ts" />
46
- /// <reference path="../readline.d.ts" />
47
- /// <reference path="../repl.d.ts" />
48
- /// <reference path="../stream.d.ts" />
49
- /// <reference path="../stream/promises.d.ts" />
50
- /// <reference path="../stream/web.d.ts" />
51
- /// <reference path="../string_decoder.d.ts" />
52
- /// <reference path="../timers.d.ts" />
53
- /// <reference path="../timers/promises.d.ts" />
54
- /// <reference path="../tls.d.ts" />
55
- /// <reference path="../trace_events.d.ts" />
56
- /// <reference path="../tty.d.ts" />
57
- /// <reference path="../url.d.ts" />
58
- /// <reference path="../util.d.ts" />
59
- /// <reference path="../v8.d.ts" />
60
- /// <reference path="../vm.d.ts" />
61
- /// <reference path="../worker_threads.d.ts" />
62
- /// <reference path="../zlib.d.ts" />
63
-
64
- // TypeScript 3.6-specific augmentations:
65
- /// <reference path="../globals.global.d.ts" />
66
-
67
- // TypeScript 3.6-specific augmentations:
68
- /// <reference path="../wasi.d.ts" />
node/ts3.6/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- // NOTE: These definitions support NodeJS and TypeScript 3.6.
2
- // This is required to enable typing assert in ts3.7 without causing errors
3
- // Typically type modifications should be made in base.d.ts instead of here
4
-
5
- /// <reference path="base.d.ts" />
6
-
7
- /// <reference path="assert.d.ts" />