@types/node 18.7.18 → 18.7.20

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 (58) hide show
  1. node/README.md +1 -1
  2. node/globals.d.ts +1 -0
  3. node/index.d.ts +1 -1
  4. node/package.json +9 -2
  5. node/test.d.ts +127 -3
  6. node/ts4.8/assert/strict.d.ts +8 -0
  7. node/ts4.8/assert.d.ts +911 -0
  8. node/ts4.8/async_hooks.d.ts +501 -0
  9. node/ts4.8/buffer.d.ts +2238 -0
  10. node/ts4.8/child_process.d.ts +1369 -0
  11. node/ts4.8/cluster.d.ts +410 -0
  12. node/ts4.8/console.d.ts +412 -0
  13. node/ts4.8/constants.d.ts +18 -0
  14. node/ts4.8/crypto.d.ts +3961 -0
  15. node/ts4.8/dgram.d.ts +545 -0
  16. node/ts4.8/diagnostics_channel.d.ts +153 -0
  17. node/ts4.8/dns/promises.d.ts +370 -0
  18. node/ts4.8/dns.d.ts +659 -0
  19. node/ts4.8/domain.d.ts +170 -0
  20. node/ts4.8/events.d.ts +641 -0
  21. node/ts4.8/fs/promises.d.ts +1120 -0
  22. node/ts4.8/fs.d.ts +3872 -0
  23. node/ts4.8/globals.d.ts +294 -0
  24. node/ts4.8/globals.global.d.ts +1 -0
  25. node/ts4.8/http.d.ts +1553 -0
  26. node/ts4.8/http2.d.ts +2106 -0
  27. node/ts4.8/https.d.ts +541 -0
  28. node/ts4.8/index.d.ts +87 -0
  29. node/ts4.8/inspector.d.ts +2741 -0
  30. node/ts4.8/module.d.ts +114 -0
  31. node/ts4.8/net.d.ts +838 -0
  32. node/ts4.8/os.d.ts +465 -0
  33. node/ts4.8/path.d.ts +191 -0
  34. node/ts4.8/perf_hooks.d.ts +610 -0
  35. node/ts4.8/process.d.ts +1482 -0
  36. node/ts4.8/punycode.d.ts +117 -0
  37. node/ts4.8/querystring.d.ts +131 -0
  38. node/ts4.8/readline/promises.d.ts +143 -0
  39. node/ts4.8/readline.d.ts +653 -0
  40. node/ts4.8/repl.d.ts +424 -0
  41. node/ts4.8/stream/consumers.d.ts +24 -0
  42. node/ts4.8/stream/promises.d.ts +42 -0
  43. node/ts4.8/stream/web.d.ts +330 -0
  44. node/ts4.8/stream.d.ts +1339 -0
  45. node/ts4.8/string_decoder.d.ts +67 -0
  46. node/ts4.8/test.d.ts +190 -0
  47. node/ts4.8/timers/promises.d.ts +68 -0
  48. node/ts4.8/timers.d.ts +94 -0
  49. node/ts4.8/tls.d.ts +1028 -0
  50. node/ts4.8/trace_events.d.ts +171 -0
  51. node/ts4.8/tty.d.ts +206 -0
  52. node/ts4.8/url.d.ts +897 -0
  53. node/ts4.8/util.d.ts +1792 -0
  54. node/ts4.8/v8.d.ts +396 -0
  55. node/ts4.8/vm.d.ts +509 -0
  56. node/ts4.8/wasi.d.ts +158 -0
  57. node/ts4.8/worker_threads.d.ts +646 -0
  58. node/ts4.8/zlib.d.ts +517 -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, 13 Sep 2022 22:32:55 GMT
11
+ * Last updated: Sat, 24 Sep 2022 15:03:09 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
node/globals.d.ts CHANGED
@@ -73,6 +73,7 @@ declare var AbortSignal: {
73
73
  prototype: AbortSignal;
74
74
  new(): AbortSignal;
75
75
  // TODO: Add abort() static
76
+ timeout(milliseconds: number): AbortSignal;
76
77
  };
77
78
  //#endregion borrowed
78
79
 
node/index.d.ts CHANGED
@@ -67,7 +67,7 @@
67
67
  * IN THE SOFTWARE.
68
68
  */
69
69
 
70
- // NOTE: These definitions support NodeJS and TypeScript 3.7+.
70
+ // NOTE: These definitions support NodeJS and TypeScript 4.9+.
71
71
 
72
72
  // Reference required types from the default lib:
73
73
  /// <reference lib="es2020" />
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.7.18",
3
+ "version": "18.7.20",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -213,6 +213,13 @@
213
213
  ],
214
214
  "main": "",
215
215
  "types": "index.d.ts",
216
+ "typesVersions": {
217
+ "<4.9.0-0": {
218
+ "*": [
219
+ "ts4.8/*"
220
+ ]
221
+ }
222
+ },
216
223
  "repository": {
217
224
  "type": "git",
218
225
  "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
@@ -220,6 +227,6 @@
220
227
  },
221
228
  "scripts": {},
222
229
  "dependencies": {},
223
- "typesPublisherContentHash": "84a5d57ed95f7a07d1e51fa4e42df59efbcc4ba52b6e687f11f5fc0ea1ec9188",
230
+ "typesPublisherContentHash": "901533cbe1711b7da6d3baff2ae89391537719cc7b02f04eedb75093023c817a",
224
231
  "typeScriptVersion": "4.1"
225
232
  }
node/test.d.ts CHANGED
@@ -3,6 +3,14 @@
3
3
  * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/test.js)
4
4
  */
5
5
  declare module 'node:test' {
6
+ /**
7
+ * Programmatically start the test runner.
8
+ * @since v18.9.0
9
+ * @param options Configuration options for running tests.
10
+ * @returns A {@link TapStream} that emits events about the test execution.
11
+ */
12
+ function run(options?: RunOptions): TapStream;
13
+
6
14
  /**
7
15
  * The `test()` function is the value imported from the test module. Each invocation of this
8
16
  * function results in the creation of a test point in the TAP output.
@@ -86,6 +94,122 @@ declare module 'node:test' {
86
94
  */
87
95
  type ItFn = (done: (result?: any) => void) => any;
88
96
 
97
+ interface RunOptions {
98
+ /**
99
+ * @default false
100
+ */
101
+ concurrency?: number | boolean;
102
+
103
+ /**
104
+ * An array containing the list of files to run. If unspecified, the test runner execution model will be used.
105
+ */
106
+ files?: readonly string[];
107
+
108
+ /**
109
+ * Allows aborting an in-progress test.
110
+ * @default undefined
111
+ */
112
+ signal?: AbortSignal;
113
+
114
+ /**
115
+ * A number of milliseconds the test will fail after. If unspecified, subtests inherit this
116
+ * value from their parent.
117
+ * @default Infinity
118
+ */
119
+ timeout?: number;
120
+ }
121
+
122
+ /**
123
+ * A successful call of the run() method will return a new TapStream object, streaming a TAP output.
124
+ * TapStream will emit events in the order of the tests' definitions.
125
+ * @since v18.9.0
126
+ */
127
+ interface TapStream extends NodeJS.ReadableStream {
128
+ addListener(event: 'test:diagnostic', listener: (message: string) => void): this;
129
+ addListener(event: 'test:fail', listener: (data: TestFail) => void): this;
130
+ addListener(event: 'test:pass', listener: (data: TestPass) => void): this;
131
+ addListener(event: string, listener: (...args: any[]) => void): this;
132
+ emit(event: 'test:diagnostic', message: string): boolean;
133
+ emit(event: 'test:fail', data: TestFail): boolean;
134
+ emit(event: 'test:pass', data: TestPass): boolean;
135
+ emit(event: string | symbol, ...args: any[]): boolean;
136
+ on(event: 'test:diagnostic', listener: (message: string) => void): this;
137
+ on(event: 'test:fail', listener: (data: TestFail) => void): this;
138
+ on(event: 'test:pass', listener: (data: TestPass) => void): this;
139
+ on(event: string, listener: (...args: any[]) => void): this;
140
+ once(event: 'test:diagnostic', listener: (message: string) => void): this;
141
+ once(event: 'test:fail', listener: (data: TestFail) => void): this;
142
+ once(event: 'test:pass', listener: (data: TestPass) => void): this;
143
+ once(event: string, listener: (...args: any[]) => void): this;
144
+ prependListener(event: 'test:diagnostic', listener: (message: string) => void): this;
145
+ prependListener(event: 'test:fail', listener: (data: TestFail) => void): this;
146
+ prependListener(event: 'test:pass', listener: (data: TestPass) => void): this;
147
+ prependListener(event: string, listener: (...args: any[]) => void): this;
148
+ prependOnceListener(event: 'test:diagnostic', listener: (message: string) => void): this;
149
+ prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this;
150
+ prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this;
151
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
152
+ }
153
+
154
+ interface TestFail {
155
+ /**
156
+ * The test duration.
157
+ */
158
+ duration: number;
159
+
160
+ /**
161
+ * The failure casing test to fail.
162
+ */
163
+ error: Error;
164
+
165
+ /**
166
+ * The test name.
167
+ */
168
+ name: string;
169
+
170
+ /**
171
+ * The ordinal number of the test.
172
+ */
173
+ testNumber: number;
174
+
175
+ /**
176
+ * Present if `context.todo` is called.
177
+ */
178
+ todo?: string;
179
+
180
+ /**
181
+ * Present if `context.skip` is called.
182
+ */
183
+ skip?: string;
184
+ }
185
+
186
+ interface TestPass {
187
+ /**
188
+ * The test duration.
189
+ */
190
+ duration: number;
191
+
192
+ /**
193
+ * The test name.
194
+ */
195
+ name: string;
196
+
197
+ /**
198
+ * The ordinal number of the test.
199
+ */
200
+ testNumber: number;
201
+
202
+ /**
203
+ * Present if `context.todo` is called.
204
+ */
205
+ todo?: string;
206
+
207
+ /**
208
+ * Present if `context.skip` is called.
209
+ */
210
+ skip?: string;
211
+ }
212
+
89
213
  /**
90
214
  * An instance of `TestContext` is passed to each test function in order to interact with the
91
215
  * test runner. However, the `TestContext` constructor is not exposed as part of the API.
@@ -159,7 +283,7 @@ declare module 'node:test' {
159
283
 
160
284
  /**
161
285
  * Allows aborting an in-progress test.
162
- * @since 8.7.0
286
+ * @since v18.8.0
163
287
  */
164
288
  signal?: AbortSignal;
165
289
 
@@ -174,7 +298,7 @@ declare module 'node:test' {
174
298
  * A number of milliseconds the test will fail after. If unspecified, subtests inherit this
175
299
  * value from their parent.
176
300
  * @default Infinity
177
- * @since 8.7.0
301
+ * @since v18.7.0
178
302
  */
179
303
  timeout?: number;
180
304
 
@@ -186,5 +310,5 @@ declare module 'node:test' {
186
310
  todo?: boolean | string;
187
311
  }
188
312
 
189
- export { test as default, test, describe, it };
313
+ export { test as default, run, test, describe, it };
190
314
  }
@@ -0,0 +1,8 @@
1
+ declare module 'assert/strict' {
2
+ import { strict } from 'node:assert';
3
+ export = strict;
4
+ }
5
+ declare module 'node:assert/strict' {
6
+ import { strict } from 'node:assert';
7
+ export = strict;
8
+ }