cdk-common 2.0.1351 → 2.0.1353
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.
- package/.jsii +38 -2
- package/API.md +36 -0
- package/lib/main.js +1 -1
- package/lib/managed-policies.d.ts +7 -1
- package/lib/managed-policies.js +7 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/assert/strict.d.ts +5 -11
- package/node_modules/@types/concat-stream/node_modules/@types/node/assert.d.ts +9 -169
- package/node_modules/@types/concat-stream/node_modules/@types/node/async_hooks.d.ts +8 -8
- package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.buffer.d.ts +1 -7
- package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.d.ts +44 -168
- package/node_modules/@types/concat-stream/node_modules/@types/node/child_process.d.ts +16 -64
- package/node_modules/@types/concat-stream/node_modules/@types/node/cluster.d.ts +240 -332
- package/node_modules/@types/concat-stream/node_modules/@types/node/console.d.ts +49 -351
- package/node_modules/@types/concat-stream/node_modules/@types/node/constants.d.ts +3 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/crypto.d.ts +279 -1631
- package/node_modules/@types/concat-stream/node_modules/@types/node/dgram.d.ts +15 -51
- package/node_modules/@types/concat-stream/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/dns/promises.d.ts +3 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/dns.d.ts +131 -132
- package/node_modules/@types/concat-stream/node_modules/@types/node/domain.d.ts +13 -17
- package/node_modules/@types/concat-stream/node_modules/@types/node/events.d.ts +869 -791
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs/promises.d.ts +7 -8
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +417 -455
- package/node_modules/@types/concat-stream/node_modules/@types/node/globals.d.ts +6 -26
- package/node_modules/@types/concat-stream/node_modules/@types/node/globals.typedarray.d.ts +60 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +263 -254
- package/node_modules/@types/concat-stream/node_modules/@types/node/http2.d.ts +528 -804
- package/node_modules/@types/concat-stream/node_modules/@types/node/https.d.ts +59 -239
- package/node_modules/@types/concat-stream/node_modules/@types/node/index.d.ts +15 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/inspector/promises.d.ts +41 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/inspector.d.ts +6 -59
- package/node_modules/@types/concat-stream/node_modules/@types/node/inspector.generated.d.ts +3 -10
- package/node_modules/@types/concat-stream/node_modules/@types/node/module.d.ts +47 -122
- package/node_modules/@types/concat-stream/node_modules/@types/node/net.d.ts +63 -184
- package/node_modules/@types/concat-stream/node_modules/@types/node/os.d.ts +6 -6
- package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/path.d.ts +120 -133
- package/node_modules/@types/concat-stream/node_modules/@types/node/perf_hooks.d.ts +282 -643
- package/node_modules/@types/concat-stream/node_modules/@types/node/process.d.ts +156 -128
- package/node_modules/@types/concat-stream/node_modules/@types/node/punycode.d.ts +5 -5
- package/node_modules/@types/concat-stream/node_modules/@types/node/querystring.d.ts +4 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/quic.d.ts +910 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/readline/promises.d.ts +3 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/readline.d.ts +67 -120
- package/node_modules/@types/concat-stream/node_modules/@types/node/repl.d.ts +75 -98
- package/node_modules/@types/concat-stream/node_modules/@types/node/sea.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/sqlite.d.ts +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream/consumers.d.ts +10 -10
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream/promises.d.ts +136 -15
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream/web.d.ts +176 -453
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream.d.ts +555 -478
- package/node_modules/@types/concat-stream/node_modules/@types/node/string_decoder.d.ts +4 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/test/reporters.d.ts +96 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +80 -180
- package/node_modules/@types/concat-stream/node_modules/@types/node/timers/promises.d.ts +4 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/timers.d.ts +4 -130
- package/node_modules/@types/concat-stream/node_modules/@types/node/tls.d.ts +102 -177
- package/node_modules/@types/concat-stream/node_modules/@types/node/trace_events.d.ts +9 -9
- package/node_modules/@types/concat-stream/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -7
- package/node_modules/@types/concat-stream/node_modules/@types/node/ts5.6/index.d.ts +15 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/ts5.7/index.d.ts +15 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/tty.d.ts +58 -16
- package/node_modules/@types/concat-stream/node_modules/@types/node/url.d.ts +54 -592
- package/node_modules/@types/concat-stream/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +120 -792
- package/node_modules/@types/concat-stream/node_modules/@types/node/v8.d.ts +32 -5
- package/node_modules/@types/concat-stream/node_modules/@types/node/vm.d.ts +13 -13
- package/node_modules/@types/concat-stream/node_modules/@types/node/wasi.d.ts +4 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/crypto.d.ts +7 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/events.d.ts +9 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/fetch.d.ts +4 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/streams.d.ts +93 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/worker_threads.d.ts +176 -358
- package/node_modules/@types/concat-stream/node_modules/@types/node/zlib.d.ts +8 -71
- package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/assert/strict.d.ts +5 -11
- package/node_modules/@types/form-data/node_modules/@types/node/assert.d.ts +9 -169
- package/node_modules/@types/form-data/node_modules/@types/node/async_hooks.d.ts +8 -8
- package/node_modules/@types/form-data/node_modules/@types/node/buffer.buffer.d.ts +1 -7
- package/node_modules/@types/form-data/node_modules/@types/node/buffer.d.ts +44 -168
- package/node_modules/@types/form-data/node_modules/@types/node/child_process.d.ts +16 -64
- package/node_modules/@types/form-data/node_modules/@types/node/cluster.d.ts +240 -332
- package/node_modules/@types/form-data/node_modules/@types/node/console.d.ts +49 -351
- package/node_modules/@types/form-data/node_modules/@types/node/constants.d.ts +3 -4
- package/node_modules/@types/form-data/node_modules/@types/node/crypto.d.ts +279 -1631
- package/node_modules/@types/form-data/node_modules/@types/node/dgram.d.ts +15 -51
- package/node_modules/@types/form-data/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
- package/node_modules/@types/form-data/node_modules/@types/node/dns/promises.d.ts +3 -3
- package/node_modules/@types/form-data/node_modules/@types/node/dns.d.ts +131 -132
- package/node_modules/@types/form-data/node_modules/@types/node/domain.d.ts +13 -17
- package/node_modules/@types/form-data/node_modules/@types/node/events.d.ts +869 -791
- package/node_modules/@types/form-data/node_modules/@types/node/fs/promises.d.ts +7 -8
- package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +417 -455
- package/node_modules/@types/form-data/node_modules/@types/node/globals.d.ts +6 -26
- package/node_modules/@types/form-data/node_modules/@types/node/globals.typedarray.d.ts +60 -0
- package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +263 -254
- package/node_modules/@types/form-data/node_modules/@types/node/http2.d.ts +528 -804
- package/node_modules/@types/form-data/node_modules/@types/node/https.d.ts +59 -239
- package/node_modules/@types/form-data/node_modules/@types/node/index.d.ts +15 -1
- package/node_modules/@types/form-data/node_modules/@types/node/inspector/promises.d.ts +41 -0
- package/node_modules/@types/form-data/node_modules/@types/node/inspector.d.ts +6 -59
- package/node_modules/@types/form-data/node_modules/@types/node/inspector.generated.d.ts +3 -10
- package/node_modules/@types/form-data/node_modules/@types/node/module.d.ts +47 -122
- package/node_modules/@types/form-data/node_modules/@types/node/net.d.ts +63 -184
- package/node_modules/@types/form-data/node_modules/@types/node/os.d.ts +6 -6
- package/node_modules/@types/form-data/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/form-data/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/form-data/node_modules/@types/node/path.d.ts +120 -133
- package/node_modules/@types/form-data/node_modules/@types/node/perf_hooks.d.ts +282 -643
- package/node_modules/@types/form-data/node_modules/@types/node/process.d.ts +156 -128
- package/node_modules/@types/form-data/node_modules/@types/node/punycode.d.ts +5 -5
- package/node_modules/@types/form-data/node_modules/@types/node/querystring.d.ts +4 -4
- package/node_modules/@types/form-data/node_modules/@types/node/quic.d.ts +910 -0
- package/node_modules/@types/form-data/node_modules/@types/node/readline/promises.d.ts +3 -3
- package/node_modules/@types/form-data/node_modules/@types/node/readline.d.ts +67 -120
- package/node_modules/@types/form-data/node_modules/@types/node/repl.d.ts +75 -98
- package/node_modules/@types/form-data/node_modules/@types/node/sea.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/sqlite.d.ts +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/stream/consumers.d.ts +10 -10
- package/node_modules/@types/form-data/node_modules/@types/node/stream/promises.d.ts +136 -15
- package/node_modules/@types/form-data/node_modules/@types/node/stream/web.d.ts +176 -453
- package/node_modules/@types/form-data/node_modules/@types/node/stream.d.ts +555 -478
- package/node_modules/@types/form-data/node_modules/@types/node/string_decoder.d.ts +4 -4
- package/node_modules/@types/form-data/node_modules/@types/node/test/reporters.d.ts +96 -0
- package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +80 -180
- package/node_modules/@types/form-data/node_modules/@types/node/timers/promises.d.ts +4 -4
- package/node_modules/@types/form-data/node_modules/@types/node/timers.d.ts +4 -130
- package/node_modules/@types/form-data/node_modules/@types/node/tls.d.ts +102 -177
- package/node_modules/@types/form-data/node_modules/@types/node/trace_events.d.ts +9 -9
- package/node_modules/@types/form-data/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -7
- package/node_modules/@types/form-data/node_modules/@types/node/ts5.6/index.d.ts +15 -1
- package/node_modules/@types/form-data/node_modules/@types/node/ts5.7/index.d.ts +15 -1
- package/node_modules/@types/form-data/node_modules/@types/node/tty.d.ts +58 -16
- package/node_modules/@types/form-data/node_modules/@types/node/url.d.ts +54 -592
- package/node_modules/@types/form-data/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +120 -792
- package/node_modules/@types/form-data/node_modules/@types/node/v8.d.ts +32 -5
- package/node_modules/@types/form-data/node_modules/@types/node/vm.d.ts +13 -13
- package/node_modules/@types/form-data/node_modules/@types/node/wasi.d.ts +4 -4
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/crypto.d.ts +7 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/events.d.ts +9 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/fetch.d.ts +4 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/streams.d.ts +93 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/form-data/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/form-data/node_modules/@types/node/worker_threads.d.ts +176 -358
- package/node_modules/@types/form-data/node_modules/@types/node/zlib.d.ts +8 -71
- package/package.json +4 -4
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
* decoder.write(Buffer.from([0x82]));
|
|
37
37
|
* console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
|
|
38
38
|
* ```
|
|
39
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
39
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/string_decoder.js)
|
|
40
40
|
*/
|
|
41
|
-
declare module "string_decoder" {
|
|
41
|
+
declare module "node:string_decoder" {
|
|
42
42
|
class StringDecoder {
|
|
43
43
|
constructor(encoding?: BufferEncoding);
|
|
44
44
|
/**
|
|
@@ -62,6 +62,6 @@ declare module "string_decoder" {
|
|
|
62
62
|
end(buffer?: string | NodeJS.ArrayBufferView): string;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
declare module "
|
|
66
|
-
export * from "string_decoder";
|
|
65
|
+
declare module "string_decoder" {
|
|
66
|
+
export * from "node:string_decoder";
|
|
67
67
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `node:test` module supports passing `--test-reporter`
|
|
3
|
+
* flags for the test runner to use a specific reporter.
|
|
4
|
+
*
|
|
5
|
+
* The following built-reporters are supported:
|
|
6
|
+
*
|
|
7
|
+
* * `spec`
|
|
8
|
+
* The `spec` reporter outputs the test results in a human-readable format. This
|
|
9
|
+
* is the default reporter.
|
|
10
|
+
*
|
|
11
|
+
* * `tap`
|
|
12
|
+
* The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
|
|
13
|
+
*
|
|
14
|
+
* * `dot`
|
|
15
|
+
* The `dot` reporter outputs the test results in a compact format,
|
|
16
|
+
* where each passing test is represented by a `.`,
|
|
17
|
+
* and each failing test is represented by a `X`.
|
|
18
|
+
*
|
|
19
|
+
* * `junit`
|
|
20
|
+
* The junit reporter outputs test results in a jUnit XML format
|
|
21
|
+
*
|
|
22
|
+
* * `lcov`
|
|
23
|
+
* The `lcov` reporter outputs test coverage when used with the
|
|
24
|
+
* `--experimental-test-coverage` flag.
|
|
25
|
+
*
|
|
26
|
+
* The exact output of these reporters is subject to change between versions of
|
|
27
|
+
* Node.js, and should not be relied on programmatically. If programmatic access
|
|
28
|
+
* to the test runner's output is required, use the events emitted by the
|
|
29
|
+
* `TestsStream`.
|
|
30
|
+
*
|
|
31
|
+
* The reporters are available via the `node:test/reporters` module:
|
|
32
|
+
*
|
|
33
|
+
* ```js
|
|
34
|
+
* import { tap, spec, dot, junit, lcov } from 'node:test/reporters';
|
|
35
|
+
* ```
|
|
36
|
+
* @since v19.9.0, v18.17.0
|
|
37
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/test/reporters.js)
|
|
38
|
+
*/
|
|
39
|
+
declare module "node:test/reporters" {
|
|
40
|
+
import { Transform, TransformOptions } from "node:stream";
|
|
41
|
+
import { EventData } from "node:test";
|
|
42
|
+
type TestEvent =
|
|
43
|
+
| { type: "test:coverage"; data: EventData.TestCoverage }
|
|
44
|
+
| { type: "test:complete"; data: EventData.TestComplete }
|
|
45
|
+
| { type: "test:dequeue"; data: EventData.TestDequeue }
|
|
46
|
+
| { type: "test:diagnostic"; data: EventData.TestDiagnostic }
|
|
47
|
+
| { type: "test:enqueue"; data: EventData.TestEnqueue }
|
|
48
|
+
| { type: "test:fail"; data: EventData.TestFail }
|
|
49
|
+
| { type: "test:pass"; data: EventData.TestPass }
|
|
50
|
+
| { type: "test:plan"; data: EventData.TestPlan }
|
|
51
|
+
| { type: "test:start"; data: EventData.TestStart }
|
|
52
|
+
| { type: "test:stderr"; data: EventData.TestStderr }
|
|
53
|
+
| { type: "test:stdout"; data: EventData.TestStdout }
|
|
54
|
+
| { type: "test:summary"; data: EventData.TestSummary }
|
|
55
|
+
| { type: "test:watch:drained"; data: undefined }
|
|
56
|
+
| { type: "test:watch:restarted"; data: undefined };
|
|
57
|
+
interface ReporterConstructorWrapper<T extends new(...args: any[]) => Transform> {
|
|
58
|
+
new(...args: ConstructorParameters<T>): InstanceType<T>;
|
|
59
|
+
(...args: ConstructorParameters<T>): InstanceType<T>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The `dot` reporter outputs the test results in a compact format,
|
|
63
|
+
* where each passing test is represented by a `.`,
|
|
64
|
+
* and each failing test is represented by a `X`.
|
|
65
|
+
* @since v20.0.0
|
|
66
|
+
*/
|
|
67
|
+
function dot(source: AsyncIterable<TestEvent>): NodeJS.AsyncIterator<string>;
|
|
68
|
+
/**
|
|
69
|
+
* The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
|
|
70
|
+
* @since v20.0.0
|
|
71
|
+
*/
|
|
72
|
+
function tap(source: AsyncIterable<TestEvent>): NodeJS.AsyncIterator<string>;
|
|
73
|
+
class SpecReporter extends Transform {
|
|
74
|
+
constructor();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The `spec` reporter outputs the test results in a human-readable format.
|
|
78
|
+
* @since v20.0.0
|
|
79
|
+
*/
|
|
80
|
+
const spec: ReporterConstructorWrapper<typeof SpecReporter>;
|
|
81
|
+
/**
|
|
82
|
+
* The `junit` reporter outputs test results in a jUnit XML format.
|
|
83
|
+
* @since v21.0.0
|
|
84
|
+
*/
|
|
85
|
+
function junit(source: AsyncIterable<TestEvent>): NodeJS.AsyncIterator<string>;
|
|
86
|
+
class LcovReporter extends Transform {
|
|
87
|
+
constructor(options?: Omit<TransformOptions, "writableObjectMode">);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The `lcov` reporter outputs test coverage when used with the
|
|
91
|
+
* [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--experimental-test-coverage) flag.
|
|
92
|
+
* @since v22.0.0
|
|
93
|
+
*/
|
|
94
|
+
const lcov: ReporterConstructorWrapper<typeof LcovReporter>;
|
|
95
|
+
export { dot, junit, lcov, spec, tap, TestEvent };
|
|
96
|
+
}
|
|
@@ -76,11 +76,12 @@
|
|
|
76
76
|
*
|
|
77
77
|
* If any tests fail, the process exit code is set to `1`.
|
|
78
78
|
* @since v18.0.0, v16.17.0
|
|
79
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
79
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/test.js)
|
|
80
80
|
*/
|
|
81
81
|
declare module "node:test" {
|
|
82
82
|
import { AssertMethodNames } from "node:assert";
|
|
83
|
-
import { Readable } from "node:stream";
|
|
83
|
+
import { Readable, ReadableEventMap } from "node:stream";
|
|
84
|
+
import { TestEvent } from "node:test/reporters";
|
|
84
85
|
import TestFn = test.TestFn;
|
|
85
86
|
import TestOptions = test.TestOptions;
|
|
86
87
|
/**
|
|
@@ -243,14 +244,14 @@ declare module "node:test" {
|
|
|
243
244
|
/**
|
|
244
245
|
* Specifies the current working directory to be used by the test runner.
|
|
245
246
|
* Serves as the base path for resolving files according to the
|
|
246
|
-
* [test runner execution model](https://nodejs.org/docs/latest-
|
|
247
|
+
* [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model).
|
|
247
248
|
* @since v23.0.0
|
|
248
249
|
* @default process.cwd()
|
|
249
250
|
*/
|
|
250
251
|
cwd?: string | undefined;
|
|
251
252
|
/**
|
|
252
253
|
* An array containing the list of files to run. If omitted, files are run according to the
|
|
253
|
-
* [test runner execution model](https://nodejs.org/docs/latest-
|
|
254
|
+
* [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model).
|
|
254
255
|
*/
|
|
255
256
|
files?: readonly string[] | undefined;
|
|
256
257
|
/**
|
|
@@ -263,7 +264,7 @@ declare module "node:test" {
|
|
|
263
264
|
/**
|
|
264
265
|
* An array containing the list of glob patterns to match test files.
|
|
265
266
|
* This option cannot be used together with `files`. If omitted, files are run according to the
|
|
266
|
-
* [test runner execution model](https://nodejs.org/docs/latest-
|
|
267
|
+
* [test runner execution model](https://nodejs.org/docs/latest-v25.x/api/test.html#test-runner-execution-model).
|
|
267
268
|
* @since v22.6.0
|
|
268
269
|
*/
|
|
269
270
|
globPatterns?: readonly string[] | undefined;
|
|
@@ -351,7 +352,7 @@ declare module "node:test" {
|
|
|
351
352
|
*/
|
|
352
353
|
rerunFailuresFilePath?: string | undefined;
|
|
353
354
|
/**
|
|
354
|
-
* enable [code coverage](https://nodejs.org/docs/latest-
|
|
355
|
+
* enable [code coverage](https://nodejs.org/docs/latest-v25.x/api/test.html#collecting-code-coverage) collection.
|
|
355
356
|
* @since v22.10.0
|
|
356
357
|
* @default false
|
|
357
358
|
*/
|
|
@@ -398,6 +399,23 @@ declare module "node:test" {
|
|
|
398
399
|
*/
|
|
399
400
|
functionCoverage?: number | undefined;
|
|
400
401
|
}
|
|
402
|
+
interface TestsStreamEventMap extends ReadableEventMap {
|
|
403
|
+
"data": [data: TestEvent];
|
|
404
|
+
"test:coverage": [data: EventData.TestCoverage];
|
|
405
|
+
"test:complete": [data: EventData.TestComplete];
|
|
406
|
+
"test:dequeue": [data: EventData.TestDequeue];
|
|
407
|
+
"test:diagnostic": [data: EventData.TestDiagnostic];
|
|
408
|
+
"test:enqueue": [data: EventData.TestEnqueue];
|
|
409
|
+
"test:fail": [data: EventData.TestFail];
|
|
410
|
+
"test:pass": [data: EventData.TestPass];
|
|
411
|
+
"test:plan": [data: EventData.TestPlan];
|
|
412
|
+
"test:start": [data: EventData.TestStart];
|
|
413
|
+
"test:stderr": [data: EventData.TestStderr];
|
|
414
|
+
"test:stdout": [data: EventData.TestStdout];
|
|
415
|
+
"test:summary": [data: EventData.TestSummary];
|
|
416
|
+
"test:watch:drained": [];
|
|
417
|
+
"test:watch:restarted": [];
|
|
418
|
+
}
|
|
401
419
|
/**
|
|
402
420
|
* A successful call to `run()` will return a new `TestsStream` object, streaming a series of events representing the execution of the tests.
|
|
403
421
|
*
|
|
@@ -405,96 +423,59 @@ declare module "node:test" {
|
|
|
405
423
|
* @since v18.9.0, v16.19.0
|
|
406
424
|
*/
|
|
407
425
|
interface TestsStream extends Readable {
|
|
408
|
-
|
|
409
|
-
addListener
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
addListener(
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
once(event: "test:start", listener: (data: EventData.TestStart) => void): this;
|
|
462
|
-
once(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this;
|
|
463
|
-
once(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
|
464
|
-
once(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
465
|
-
once(event: "test:watch:drained", listener: () => void): this;
|
|
466
|
-
once(event: "test:watch:restarted", listener: () => void): this;
|
|
467
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
468
|
-
prependListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
|
469
|
-
prependListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
|
470
|
-
prependListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this;
|
|
471
|
-
prependListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this;
|
|
472
|
-
prependListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this;
|
|
473
|
-
prependListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this;
|
|
474
|
-
prependListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this;
|
|
475
|
-
prependListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this;
|
|
476
|
-
prependListener(event: "test:start", listener: (data: EventData.TestStart) => void): this;
|
|
477
|
-
prependListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this;
|
|
478
|
-
prependListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
|
479
|
-
prependListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
480
|
-
prependListener(event: "test:watch:drained", listener: () => void): this;
|
|
481
|
-
prependListener(event: "test:watch:restarted", listener: () => void): this;
|
|
482
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
483
|
-
prependOnceListener(event: "test:coverage", listener: (data: EventData.TestCoverage) => void): this;
|
|
484
|
-
prependOnceListener(event: "test:complete", listener: (data: EventData.TestComplete) => void): this;
|
|
485
|
-
prependOnceListener(event: "test:dequeue", listener: (data: EventData.TestDequeue) => void): this;
|
|
486
|
-
prependOnceListener(event: "test:diagnostic", listener: (data: EventData.TestDiagnostic) => void): this;
|
|
487
|
-
prependOnceListener(event: "test:enqueue", listener: (data: EventData.TestEnqueue) => void): this;
|
|
488
|
-
prependOnceListener(event: "test:fail", listener: (data: EventData.TestFail) => void): this;
|
|
489
|
-
prependOnceListener(event: "test:pass", listener: (data: EventData.TestPass) => void): this;
|
|
490
|
-
prependOnceListener(event: "test:plan", listener: (data: EventData.TestPlan) => void): this;
|
|
491
|
-
prependOnceListener(event: "test:start", listener: (data: EventData.TestStart) => void): this;
|
|
492
|
-
prependOnceListener(event: "test:stderr", listener: (data: EventData.TestStderr) => void): this;
|
|
493
|
-
prependOnceListener(event: "test:stdout", listener: (data: EventData.TestStdout) => void): this;
|
|
494
|
-
prependOnceListener(event: "test:summary", listener: (data: EventData.TestSummary) => void): this;
|
|
495
|
-
prependOnceListener(event: "test:watch:drained", listener: () => void): this;
|
|
496
|
-
prependOnceListener(event: "test:watch:restarted", listener: () => void): this;
|
|
497
|
-
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
426
|
+
// #region InternalEventEmitter
|
|
427
|
+
addListener<E extends keyof TestsStreamEventMap>(
|
|
428
|
+
eventName: E,
|
|
429
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
430
|
+
): this;
|
|
431
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
432
|
+
emit<E extends keyof TestsStreamEventMap>(eventName: E, ...args: TestsStreamEventMap[E]): boolean;
|
|
433
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
434
|
+
listenerCount<E extends keyof TestsStreamEventMap>(
|
|
435
|
+
eventName: E,
|
|
436
|
+
listener?: (...args: TestsStreamEventMap[E]) => void,
|
|
437
|
+
): number;
|
|
438
|
+
listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
|
|
439
|
+
listeners<E extends keyof TestsStreamEventMap>(eventName: E): ((...args: TestsStreamEventMap[E]) => void)[];
|
|
440
|
+
listeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
441
|
+
off<E extends keyof TestsStreamEventMap>(
|
|
442
|
+
eventName: E,
|
|
443
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
444
|
+
): this;
|
|
445
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
446
|
+
on<E extends keyof TestsStreamEventMap>(
|
|
447
|
+
eventName: E,
|
|
448
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
449
|
+
): this;
|
|
450
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
451
|
+
once<E extends keyof TestsStreamEventMap>(
|
|
452
|
+
eventName: E,
|
|
453
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
454
|
+
): this;
|
|
455
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
456
|
+
prependListener<E extends keyof TestsStreamEventMap>(
|
|
457
|
+
eventName: E,
|
|
458
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
459
|
+
): this;
|
|
460
|
+
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
461
|
+
prependOnceListener<E extends keyof TestsStreamEventMap>(
|
|
462
|
+
eventName: E,
|
|
463
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
464
|
+
): this;
|
|
465
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
466
|
+
rawListeners<E extends keyof TestsStreamEventMap>(
|
|
467
|
+
eventName: E,
|
|
468
|
+
): ((...args: TestsStreamEventMap[E]) => void)[];
|
|
469
|
+
rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
470
|
+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
471
|
+
removeAllListeners<E extends keyof TestsStreamEventMap>(eventName?: E): this;
|
|
472
|
+
removeAllListeners(eventName?: string | symbol): this;
|
|
473
|
+
removeListener<E extends keyof TestsStreamEventMap>(
|
|
474
|
+
eventName: E,
|
|
475
|
+
listener: (...args: TestsStreamEventMap[E]) => void,
|
|
476
|
+
): this;
|
|
477
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
478
|
+
// #endregion
|
|
498
479
|
}
|
|
499
480
|
namespace EventData {
|
|
500
481
|
interface Error extends globalThis.Error {
|
|
@@ -1218,7 +1199,7 @@ declare module "node:test" {
|
|
|
1218
1199
|
* highlighting.
|
|
1219
1200
|
* @since v22.14.0
|
|
1220
1201
|
* @param value A value to serialize to a string. If Node.js was started with
|
|
1221
|
-
* the [`--test-update-snapshots`](https://nodejs.org/docs/latest-
|
|
1202
|
+
* the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--test-update-snapshots)
|
|
1222
1203
|
* flag, the serialized value is written to
|
|
1223
1204
|
* `path`. Otherwise, the serialized value is compared to the contents of the
|
|
1224
1205
|
* existing snapshot file.
|
|
@@ -1241,7 +1222,7 @@ declare module "node:test" {
|
|
|
1241
1222
|
* ```
|
|
1242
1223
|
* @since v22.3.0
|
|
1243
1224
|
* @param value A value to serialize to a string. If Node.js was started with
|
|
1244
|
-
* the [`--test-update-snapshots`](https://nodejs.org/docs/latest-
|
|
1225
|
+
* the [`--test-update-snapshots`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--test-update-snapshots)
|
|
1245
1226
|
* flag, the serialized value is written to
|
|
1246
1227
|
* the snapshot file. Otherwise, the serialized value is compared to the
|
|
1247
1228
|
* corresponding value in the existing snapshot file.
|
|
@@ -1672,7 +1653,7 @@ declare module "node:test" {
|
|
|
1672
1653
|
* This function is used to mock the exports of ECMAScript modules, CommonJS modules, JSON modules, and
|
|
1673
1654
|
* Node.js builtin modules. Any references to the original module prior to mocking are not impacted. In
|
|
1674
1655
|
* order to enable module mocking, Node.js must be started with the
|
|
1675
|
-
* [`--experimental-test-module-mocks`](https://nodejs.org/docs/latest-
|
|
1656
|
+
* [`--experimental-test-module-mocks`](https://nodejs.org/docs/latest-v25.x/api/cli.html#--experimental-test-module-mocks)
|
|
1676
1657
|
* command-line flag.
|
|
1677
1658
|
*
|
|
1678
1659
|
* The following example demonstrates how a mock is created for a module.
|
|
@@ -2256,84 +2237,3 @@ declare module "node:test" {
|
|
|
2256
2237
|
}[keyof T];
|
|
2257
2238
|
export = test;
|
|
2258
2239
|
}
|
|
2259
|
-
|
|
2260
|
-
/**
|
|
2261
|
-
* The `node:test/reporters` module exposes the builtin-reporters for `node:test`.
|
|
2262
|
-
* To access it:
|
|
2263
|
-
*
|
|
2264
|
-
* ```js
|
|
2265
|
-
* import test from 'node:test/reporters';
|
|
2266
|
-
* ```
|
|
2267
|
-
*
|
|
2268
|
-
* This module is only available under the `node:` scheme. The following will not
|
|
2269
|
-
* work:
|
|
2270
|
-
*
|
|
2271
|
-
* ```js
|
|
2272
|
-
* import test from 'node:test/reporters';
|
|
2273
|
-
* ```
|
|
2274
|
-
* @since v19.9.0
|
|
2275
|
-
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/test/reporters.js)
|
|
2276
|
-
*/
|
|
2277
|
-
declare module "node:test/reporters" {
|
|
2278
|
-
import { Transform, TransformOptions } from "node:stream";
|
|
2279
|
-
import { EventData } from "node:test";
|
|
2280
|
-
|
|
2281
|
-
type TestEvent =
|
|
2282
|
-
| { type: "test:coverage"; data: EventData.TestCoverage }
|
|
2283
|
-
| { type: "test:complete"; data: EventData.TestComplete }
|
|
2284
|
-
| { type: "test:dequeue"; data: EventData.TestDequeue }
|
|
2285
|
-
| { type: "test:diagnostic"; data: EventData.TestDiagnostic }
|
|
2286
|
-
| { type: "test:enqueue"; data: EventData.TestEnqueue }
|
|
2287
|
-
| { type: "test:fail"; data: EventData.TestFail }
|
|
2288
|
-
| { type: "test:pass"; data: EventData.TestPass }
|
|
2289
|
-
| { type: "test:plan"; data: EventData.TestPlan }
|
|
2290
|
-
| { type: "test:start"; data: EventData.TestStart }
|
|
2291
|
-
| { type: "test:stderr"; data: EventData.TestStderr }
|
|
2292
|
-
| { type: "test:stdout"; data: EventData.TestStdout }
|
|
2293
|
-
| { type: "test:summary"; data: EventData.TestSummary }
|
|
2294
|
-
| { type: "test:watch:drained"; data: undefined }
|
|
2295
|
-
| { type: "test:watch:restarted"; data: undefined };
|
|
2296
|
-
type TestEventGenerator = AsyncGenerator<TestEvent, void>;
|
|
2297
|
-
|
|
2298
|
-
interface ReporterConstructorWrapper<T extends new(...args: any[]) => Transform> {
|
|
2299
|
-
new(...args: ConstructorParameters<T>): InstanceType<T>;
|
|
2300
|
-
(...args: ConstructorParameters<T>): InstanceType<T>;
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
/**
|
|
2304
|
-
* The `dot` reporter outputs the test results in a compact format,
|
|
2305
|
-
* where each passing test is represented by a `.`,
|
|
2306
|
-
* and each failing test is represented by a `X`.
|
|
2307
|
-
* @since v20.0.0
|
|
2308
|
-
*/
|
|
2309
|
-
function dot(source: TestEventGenerator): AsyncGenerator<"\n" | "." | "X", void>;
|
|
2310
|
-
/**
|
|
2311
|
-
* The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
|
|
2312
|
-
* @since v20.0.0
|
|
2313
|
-
*/
|
|
2314
|
-
function tap(source: TestEventGenerator): AsyncGenerator<string, void>;
|
|
2315
|
-
class SpecReporter extends Transform {
|
|
2316
|
-
constructor();
|
|
2317
|
-
}
|
|
2318
|
-
/**
|
|
2319
|
-
* The `spec` reporter outputs the test results in a human-readable format.
|
|
2320
|
-
* @since v20.0.0
|
|
2321
|
-
*/
|
|
2322
|
-
const spec: ReporterConstructorWrapper<typeof SpecReporter>;
|
|
2323
|
-
/**
|
|
2324
|
-
* The `junit` reporter outputs test results in a jUnit XML format.
|
|
2325
|
-
* @since v21.0.0
|
|
2326
|
-
*/
|
|
2327
|
-
function junit(source: TestEventGenerator): AsyncGenerator<string, void>;
|
|
2328
|
-
class LcovReporter extends Transform {
|
|
2329
|
-
constructor(opts?: Omit<TransformOptions, "writableObjectMode">);
|
|
2330
|
-
}
|
|
2331
|
-
/**
|
|
2332
|
-
* The `lcov` reporter outputs test coverage when used with the
|
|
2333
|
-
* [`--experimental-test-coverage`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--experimental-test-coverage) flag.
|
|
2334
|
-
* @since v22.0.0
|
|
2335
|
-
*/
|
|
2336
|
-
const lcov: ReporterConstructorWrapper<typeof LcovReporter>;
|
|
2337
|
-
|
|
2338
|
-
export { dot, junit, lcov, spec, tap, TestEvent };
|
|
2339
|
-
}
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* } from 'node:timers/promises';
|
|
12
12
|
* ```
|
|
13
13
|
* @since v15.0.0
|
|
14
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
14
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers/promises.js)
|
|
15
15
|
*/
|
|
16
|
-
declare module "timers/promises" {
|
|
16
|
+
declare module "node:timers/promises" {
|
|
17
17
|
import { TimerOptions } from "node:timers";
|
|
18
18
|
/**
|
|
19
19
|
* ```js
|
|
@@ -103,6 +103,6 @@ declare module "timers/promises" {
|
|
|
103
103
|
}
|
|
104
104
|
const scheduler: Scheduler;
|
|
105
105
|
}
|
|
106
|
-
declare module "
|
|
107
|
-
export * from "timers/promises";
|
|
106
|
+
declare module "timers/promises" {
|
|
107
|
+
export * from "node:timers/promises";
|
|
108
108
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* The timer functions within Node.js implement a similar API as the timers API
|
|
7
7
|
* provided by Web Browsers but use a different internal implementation that is
|
|
8
8
|
* built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers.js)
|
|
10
10
|
*/
|
|
11
|
-
declare module "timers" {
|
|
11
|
+
declare module "node:timers" {
|
|
12
12
|
import { Abortable } from "node:events";
|
|
13
13
|
import * as promises from "node:timers/promises";
|
|
14
14
|
export interface TimerOptions extends Abortable {
|
|
@@ -145,132 +145,6 @@ declare module "timers" {
|
|
|
145
145
|
_onTimeout(...args: any[]): void;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Schedules the "immediate" execution of the `callback` after I/O events'
|
|
150
|
-
* callbacks.
|
|
151
|
-
*
|
|
152
|
-
* When multiple calls to `setImmediate()` are made, the `callback` functions are
|
|
153
|
-
* queued for execution in the order in which they are created. The entire callback
|
|
154
|
-
* queue is processed every event loop iteration. If an immediate timer is queued
|
|
155
|
-
* from inside an executing callback, that timer will not be triggered until the
|
|
156
|
-
* next event loop iteration.
|
|
157
|
-
*
|
|
158
|
-
* If `callback` is not a function, a `TypeError` will be thrown.
|
|
159
|
-
*
|
|
160
|
-
* This method has a custom variant for promises that is available using
|
|
161
|
-
* `timersPromises.setImmediate()`.
|
|
162
|
-
* @since v0.9.1
|
|
163
|
-
* @param callback The function to call at the end of this turn of
|
|
164
|
-
* the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
|
|
165
|
-
* @param args Optional arguments to pass when the `callback` is called.
|
|
166
|
-
* @returns for use with `clearImmediate()`
|
|
167
|
-
*/
|
|
168
|
-
function setImmediate<TArgs extends any[]>(
|
|
169
|
-
callback: (...args: TArgs) => void,
|
|
170
|
-
...args: TArgs
|
|
171
|
-
): NodeJS.Immediate;
|
|
172
|
-
// Allow a single void-accepting argument to be optional in arguments lists.
|
|
173
|
-
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
|
174
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
175
|
-
function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
|
|
176
|
-
namespace setImmediate {
|
|
177
|
-
import __promisify__ = promises.setImmediate;
|
|
178
|
-
export { __promisify__ };
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Schedules repeated execution of `callback` every `delay` milliseconds.
|
|
182
|
-
*
|
|
183
|
-
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
|
|
184
|
-
* will be set to `1`. Non-integer delays are truncated to an integer.
|
|
185
|
-
*
|
|
186
|
-
* If `callback` is not a function, a `TypeError` will be thrown.
|
|
187
|
-
*
|
|
188
|
-
* This method has a custom variant for promises that is available using
|
|
189
|
-
* `timersPromises.setInterval()`.
|
|
190
|
-
* @since v0.0.1
|
|
191
|
-
* @param callback The function to call when the timer elapses.
|
|
192
|
-
* @param delay The number of milliseconds to wait before calling the
|
|
193
|
-
* `callback`. **Default:** `1`.
|
|
194
|
-
* @param args Optional arguments to pass when the `callback` is called.
|
|
195
|
-
* @returns for use with `clearInterval()`
|
|
196
|
-
*/
|
|
197
|
-
function setInterval<TArgs extends any[]>(
|
|
198
|
-
callback: (...args: TArgs) => void,
|
|
199
|
-
delay?: number,
|
|
200
|
-
...args: TArgs
|
|
201
|
-
): NodeJS.Timeout;
|
|
202
|
-
// Allow a single void-accepting argument to be optional in arguments lists.
|
|
203
|
-
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
|
204
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
205
|
-
function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
|
|
206
|
-
/**
|
|
207
|
-
* Schedules execution of a one-time `callback` after `delay` milliseconds.
|
|
208
|
-
*
|
|
209
|
-
* The `callback` will likely not be invoked in precisely `delay` milliseconds.
|
|
210
|
-
* Node.js makes no guarantees about the exact timing of when callbacks will fire,
|
|
211
|
-
* nor of their ordering. The callback will be called as close as possible to the
|
|
212
|
-
* time specified.
|
|
213
|
-
*
|
|
214
|
-
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
|
|
215
|
-
* will be set to `1`. Non-integer delays are truncated to an integer.
|
|
216
|
-
*
|
|
217
|
-
* If `callback` is not a function, a `TypeError` will be thrown.
|
|
218
|
-
*
|
|
219
|
-
* This method has a custom variant for promises that is available using
|
|
220
|
-
* `timersPromises.setTimeout()`.
|
|
221
|
-
* @since v0.0.1
|
|
222
|
-
* @param callback The function to call when the timer elapses.
|
|
223
|
-
* @param delay The number of milliseconds to wait before calling the
|
|
224
|
-
* `callback`. **Default:** `1`.
|
|
225
|
-
* @param args Optional arguments to pass when the `callback` is called.
|
|
226
|
-
* @returns for use with `clearTimeout()`
|
|
227
|
-
*/
|
|
228
|
-
function setTimeout<TArgs extends any[]>(
|
|
229
|
-
callback: (...args: TArgs) => void,
|
|
230
|
-
delay?: number,
|
|
231
|
-
...args: TArgs
|
|
232
|
-
): NodeJS.Timeout;
|
|
233
|
-
// Allow a single void-accepting argument to be optional in arguments lists.
|
|
234
|
-
// Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
|
|
235
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
236
|
-
function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
|
|
237
|
-
namespace setTimeout {
|
|
238
|
-
import __promisify__ = promises.setTimeout;
|
|
239
|
-
export { __promisify__ };
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Cancels an `Immediate` object created by `setImmediate()`.
|
|
243
|
-
* @since v0.9.1
|
|
244
|
-
* @param immediate An `Immediate` object as returned by `setImmediate()`.
|
|
245
|
-
*/
|
|
246
|
-
function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
|
|
247
|
-
/**
|
|
248
|
-
* Cancels a `Timeout` object created by `setInterval()`.
|
|
249
|
-
* @since v0.0.1
|
|
250
|
-
* @param timeout A `Timeout` object as returned by `setInterval()`
|
|
251
|
-
* or the primitive of the `Timeout` object as a string or a number.
|
|
252
|
-
*/
|
|
253
|
-
function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
|
|
254
|
-
/**
|
|
255
|
-
* Cancels a `Timeout` object created by `setTimeout()`.
|
|
256
|
-
* @since v0.0.1
|
|
257
|
-
* @param timeout A `Timeout` object as returned by `setTimeout()`
|
|
258
|
-
* or the primitive of the `Timeout` object as a string or a number.
|
|
259
|
-
*/
|
|
260
|
-
function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
|
|
261
|
-
/**
|
|
262
|
-
* The `queueMicrotask()` method queues a microtask to invoke `callback`. If
|
|
263
|
-
* `callback` throws an exception, the `process` object `'uncaughtException'`
|
|
264
|
-
* event will be emitted.
|
|
265
|
-
*
|
|
266
|
-
* The microtask queue is managed by V8 and may be used in a similar manner to
|
|
267
|
-
* the `process.nextTick()` queue, which is managed by Node.js. The
|
|
268
|
-
* `process.nextTick()` queue is always processed before the microtask queue
|
|
269
|
-
* within each turn of the Node.js event loop.
|
|
270
|
-
* @since v11.0.0
|
|
271
|
-
* @param callback Function to be queued.
|
|
272
|
-
*/
|
|
273
|
-
function queueMicrotask(callback: () => void): void;
|
|
274
148
|
}
|
|
275
149
|
import clearImmediate = globalThis.clearImmediate;
|
|
276
150
|
import clearInterval = globalThis.clearInterval;
|
|
@@ -280,6 +154,6 @@ declare module "timers" {
|
|
|
280
154
|
import setTimeout = globalThis.setTimeout;
|
|
281
155
|
export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout };
|
|
282
156
|
}
|
|
283
|
-
declare module "
|
|
284
|
-
export * from "timers";
|
|
157
|
+
declare module "timers" {
|
|
158
|
+
export * from "node:timers";
|
|
285
159
|
}
|