@idlebox/stripe-node-types 24.0.14 → 24.0.15
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/README.md +1 -1
- package/assert/strict.d.ts +98 -1
- package/assert.d.ts +147 -248
- package/async_hooks.d.ts +5 -5
- package/buffer.buffer.d.ts +9 -6
- package/buffer.d.ts +49 -169
- package/child_process.d.ts +102 -223
- package/cluster.d.ts +236 -329
- package/console.d.ts +45 -346
- package/constants.d.ts +0 -1
- package/crypto.d.ts +698 -1149
- package/dgram.d.ts +15 -50
- package/diagnostics_channel.d.ts +1 -3
- package/dns.d.ts +135 -131
- package/domain.d.ts +10 -14
- package/events.d.ts +846 -722
- package/fs/promises.d.ts +102 -53
- package/fs.d.ts +714 -484
- package/globals.d.ts +130 -347
- package/globals.typedarray.d.ts +79 -0
- package/http.d.ts +343 -246
- package/http2.d.ts +563 -711
- package/https.d.ts +70 -216
- package/index.d.ts +24 -3
- package/inspector/promises.d.ts +54 -0
- package/inspector.d.ts +167 -3938
- package/inspector.generated.d.ts +4242 -0
- package/module.d.ts +45 -95
- package/net.d.ts +87 -186
- package/os.d.ts +17 -6
- package/package.json +3 -8
- package/path/posix.d.ts +20 -0
- package/path/win32.d.ts +20 -0
- package/path.d.ts +117 -122
- package/perf_hooks.d.ts +295 -644
- package/process.d.ts +177 -138
- package/punycode.d.ts +2 -2
- package/querystring.d.ts +1 -1
- package/quic.d.ts +926 -0
- package/readline/promises.d.ts +1 -1
- package/readline.d.ts +65 -118
- package/repl.d.ts +83 -96
- package/sea.d.ts +10 -1
- package/sqlite.d.ts +262 -13
- package/stream/consumers.d.ts +7 -7
- package/stream/promises.d.ts +133 -12
- package/stream/web.d.ts +173 -495
- package/stream.d.ts +593 -490
- package/string_decoder.d.ts +3 -3
- package/test/reporters.d.ts +112 -0
- package/test.d.ts +223 -199
- package/timers/promises.d.ts +1 -1
- package/timers.d.ts +1 -129
- package/tls.d.ts +148 -163
- package/trace_events.d.ts +6 -6
- package/ts5.6/buffer.buffer.d.ts +10 -8
- package/ts5.6/globals.typedarray.d.ts +16 -0
- package/ts5.6/index.d.ts +24 -3
- package/ts5.7/index.d.ts +24 -3
- package/tty.d.ts +55 -13
- package/url.d.ts +92 -587
- package/util/types.d.ts +571 -0
- package/util.d.ts +143 -792
- package/v8.d.ts +67 -7
- package/vm.d.ts +252 -108
- package/wasi.d.ts +23 -2
- package/web-globals/abortcontroller.d.ts +75 -0
- package/web-globals/blob.d.ts +39 -0
- package/{ts5.1/compatibility/disposable.d.ts → web-globals/console.d.ts} +6 -9
- package/web-globals/crypto.d.ts +55 -0
- package/web-globals/domexception.d.ts +84 -0
- package/web-globals/encoding.d.ts +27 -0
- package/{dom-events.d.ts → web-globals/events.d.ts} +57 -50
- package/web-globals/fetch.d.ts +70 -0
- package/web-globals/importmeta.d.ts +29 -0
- package/web-globals/messaging.d.ts +39 -0
- package/web-globals/navigator.d.ts +41 -0
- package/web-globals/performance.d.ts +61 -0
- package/web-globals/storage.d.ts +40 -0
- package/web-globals/streams.d.ts +131 -0
- package/web-globals/timers.d.ts +60 -0
- package/web-globals/url.d.ts +40 -0
- package/worker_threads.d.ts +291 -349
- package/zlib.d.ts +44 -94
- package/ts5.1/index.d.ts +0 -115
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (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,
|
|
11
|
+
* Last updated: Tue, 13 Jan 2026 15:03:39 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
package/assert/strict.d.ts
CHANGED
|
@@ -13,8 +13,105 @@
|
|
|
13
13
|
******************************************************************************/
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* In strict assertion mode, non-strict methods behave like their corresponding
|
|
18
|
+
* strict methods. For example, `assert.deepEqual()` will behave like
|
|
19
|
+
* `assert.deepStrictEqual()`.
|
|
20
|
+
*
|
|
21
|
+
* In strict assertion mode, error messages for objects display a diff. In legacy
|
|
22
|
+
* assertion mode, error messages for objects display the objects, often truncated.
|
|
23
|
+
*
|
|
24
|
+
* To use strict assertion mode:
|
|
25
|
+
*
|
|
26
|
+
* ```js
|
|
27
|
+
* import { strict as assert } from 'node:assert';
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* ```js
|
|
31
|
+
* import assert from 'node:assert/strict';
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* Example error diff:
|
|
35
|
+
*
|
|
36
|
+
* ```js
|
|
37
|
+
* import { strict as assert } from 'node:assert';
|
|
38
|
+
*
|
|
39
|
+
* assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);
|
|
40
|
+
* // AssertionError: Expected inputs to be strictly deep-equal:
|
|
41
|
+
* // + actual - expected ... Lines skipped
|
|
42
|
+
* //
|
|
43
|
+
* // [
|
|
44
|
+
* // [
|
|
45
|
+
* // ...
|
|
46
|
+
* // 2,
|
|
47
|
+
* // + 3
|
|
48
|
+
* // - '3'
|
|
49
|
+
* // ],
|
|
50
|
+
* // ...
|
|
51
|
+
* // 5
|
|
52
|
+
* // ]
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS`
|
|
56
|
+
* environment variables. This will also deactivate the colors in the REPL. For
|
|
57
|
+
* more on color support in terminal environments, read the tty
|
|
58
|
+
* [`getColorDepth()`](https://nodejs.org/docs/latest-v25.x/api/tty.html#writestreamgetcolordepthenv) documentation.
|
|
59
|
+
* @since v15.0.0
|
|
60
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert/strict.js)
|
|
61
|
+
*/
|
|
16
62
|
|
|
17
63
|
declare module "node:assert/strict" {
|
|
18
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
Assert,
|
|
66
|
+
AssertionError,
|
|
67
|
+
AssertionErrorOptions,
|
|
68
|
+
AssertOptions,
|
|
69
|
+
AssertPredicate,
|
|
70
|
+
AssertStrict,
|
|
71
|
+
deepStrictEqual,
|
|
72
|
+
doesNotMatch,
|
|
73
|
+
doesNotReject,
|
|
74
|
+
doesNotThrow,
|
|
75
|
+
fail,
|
|
76
|
+
ifError,
|
|
77
|
+
match,
|
|
78
|
+
notDeepStrictEqual,
|
|
79
|
+
notStrictEqual,
|
|
80
|
+
ok,
|
|
81
|
+
partialDeepStrictEqual,
|
|
82
|
+
rejects,
|
|
83
|
+
strictEqual,
|
|
84
|
+
throws,
|
|
85
|
+
} from 'node:assert';
|
|
86
|
+
function strict(value: unknown, message?: string | Error): asserts value;
|
|
87
|
+
namespace strict {
|
|
88
|
+
export {
|
|
89
|
+
Assert,
|
|
90
|
+
AssertionError,
|
|
91
|
+
AssertionErrorOptions,
|
|
92
|
+
AssertOptions,
|
|
93
|
+
AssertPredicate,
|
|
94
|
+
AssertStrict,
|
|
95
|
+
deepStrictEqual,
|
|
96
|
+
deepStrictEqual as deepEqual,
|
|
97
|
+
doesNotMatch,
|
|
98
|
+
doesNotReject,
|
|
99
|
+
doesNotThrow,
|
|
100
|
+
fail,
|
|
101
|
+
ifError,
|
|
102
|
+
match,
|
|
103
|
+
notDeepStrictEqual,
|
|
104
|
+
notDeepStrictEqual as notDeepEqual,
|
|
105
|
+
notStrictEqual,
|
|
106
|
+
notStrictEqual as notEqual,
|
|
107
|
+
ok,
|
|
108
|
+
partialDeepStrictEqual,
|
|
109
|
+
rejects,
|
|
110
|
+
strict,
|
|
111
|
+
strictEqual,
|
|
112
|
+
strictEqual as equal,
|
|
113
|
+
throws,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
19
116
|
export = strict;
|
|
20
117
|
}
|
package/assert.d.ts
CHANGED
|
@@ -16,202 +16,187 @@
|
|
|
16
16
|
/**
|
|
17
17
|
* The `node:assert` module provides a set of assertion functions for verifying
|
|
18
18
|
* invariants.
|
|
19
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
19
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert.js)
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
declare module "node:assert" {
|
|
23
|
+
import strict = require('node:assert/strict');
|
|
23
24
|
/**
|
|
24
|
-
* An alias of {@link ok}.
|
|
25
|
+
* An alias of {@link assert.ok}.
|
|
25
26
|
* @since v0.5.9
|
|
26
27
|
* @param value The input that is checked for being truthy.
|
|
27
28
|
*/
|
|
28
29
|
function assert(value: unknown, message?: string | Error): asserts value;
|
|
30
|
+
const kOptions: unique symbol;
|
|
29
31
|
namespace assert {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
type AssertMethodNames =
|
|
33
|
+
| "deepEqual"
|
|
34
|
+
| "deepStrictEqual"
|
|
35
|
+
| "doesNotMatch"
|
|
36
|
+
| "doesNotReject"
|
|
37
|
+
| "doesNotThrow"
|
|
38
|
+
| "equal"
|
|
39
|
+
| "fail"
|
|
40
|
+
| "ifError"
|
|
41
|
+
| "match"
|
|
42
|
+
| "notDeepEqual"
|
|
43
|
+
| "notDeepStrictEqual"
|
|
44
|
+
| "notEqual"
|
|
45
|
+
| "notStrictEqual"
|
|
46
|
+
| "ok"
|
|
47
|
+
| "partialDeepStrictEqual"
|
|
48
|
+
| "rejects"
|
|
49
|
+
| "strictEqual"
|
|
50
|
+
| "throws";
|
|
51
|
+
interface AssertOptions {
|
|
34
52
|
/**
|
|
35
|
-
*
|
|
53
|
+
* If set to `'full'`, shows the full diff in assertion errors.
|
|
54
|
+
* @default 'simple'
|
|
36
55
|
*/
|
|
37
|
-
|
|
56
|
+
diff?: "simple" | "full" | undefined;
|
|
38
57
|
/**
|
|
39
|
-
*
|
|
58
|
+
* If set to `true`, non-strict methods behave like their
|
|
59
|
+
* corresponding strict methods.
|
|
60
|
+
* @default true
|
|
40
61
|
*/
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Set to the passed in operator value.
|
|
44
|
-
*/
|
|
45
|
-
operator: string;
|
|
62
|
+
strict?: boolean | undefined;
|
|
46
63
|
/**
|
|
47
|
-
*
|
|
64
|
+
* If set to `true`, skips prototype and constructor
|
|
65
|
+
* comparison in deep equality checks.
|
|
66
|
+
* @since v24.9.0
|
|
67
|
+
* @default false
|
|
48
68
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
message?: string | undefined;
|
|
57
|
-
/** The `actual` property on the error instance. */
|
|
58
|
-
actual?: unknown | undefined;
|
|
59
|
-
/** The `expected` property on the error instance. */
|
|
60
|
-
expected?: unknown | undefined;
|
|
61
|
-
/** The `operator` property on the error instance. */
|
|
62
|
-
operator?: string | undefined;
|
|
63
|
-
/** If provided, the generated stack trace omits frames before this function. */
|
|
64
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
65
|
-
stackStartFn?: Function | undefined;
|
|
66
|
-
});
|
|
69
|
+
skipPrototype?: boolean | undefined;
|
|
70
|
+
}
|
|
71
|
+
interface Assert extends Pick<typeof assert, AssertMethodNames> {
|
|
72
|
+
readonly [kOptions]: AssertOptions & { strict: false };
|
|
73
|
+
}
|
|
74
|
+
interface AssertStrict extends Pick<typeof strict, AssertMethodNames> {
|
|
75
|
+
readonly [kOptions]: AssertOptions & { strict: true };
|
|
67
76
|
}
|
|
68
77
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* @since v14.2.0, v12.19.0
|
|
72
|
-
* @deprecated Deprecated
|
|
78
|
+
* The `Assert` class allows creating independent assertion instances with custom options.
|
|
79
|
+
* @since v24.6.0
|
|
73
80
|
*/
|
|
74
|
-
|
|
81
|
+
var Assert: {
|
|
75
82
|
/**
|
|
76
|
-
* The
|
|
77
|
-
* function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an
|
|
78
|
-
* error.
|
|
83
|
+
* Creates a new assertion instance. The `diff` option controls the verbosity of diffs in assertion error messages.
|
|
79
84
|
*
|
|
80
85
|
* ```js
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* function func() {}
|
|
87
|
-
*
|
|
88
|
-
* // Returns a function that wraps func() that must be called exact times
|
|
89
|
-
* // before tracker.verify().
|
|
90
|
-
* const callsfunc = tracker.calls(func);
|
|
86
|
+
* const { Assert } = require('node:assert');
|
|
87
|
+
* const assertInstance = new Assert({ diff: 'full' });
|
|
88
|
+
* assertInstance.deepStrictEqual({ a: 1 }, { a: 2 });
|
|
89
|
+
* // Shows a full diff in the error message.
|
|
91
90
|
* ```
|
|
92
|
-
* @since v14.2.0, v12.19.0
|
|
93
|
-
* @param [fn='A no-op function']
|
|
94
|
-
* @param [exact=1]
|
|
95
|
-
* @return A function that wraps `fn`.
|
|
96
|
-
*/
|
|
97
|
-
calls(exact?: number): () => void;
|
|
98
|
-
calls(fn: undefined, exact?: number): () => void;
|
|
99
|
-
calls<Func extends (...args: any[]) => any>(fn: Func, exact?: number): Func;
|
|
100
|
-
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func | (() => void);
|
|
101
|
-
/**
|
|
102
|
-
* Example:
|
|
103
91
|
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
92
|
+
* **Important**: When destructuring assertion methods from an `Assert` instance,
|
|
93
|
+
* the methods lose their connection to the instance's configuration options (such
|
|
94
|
+
* as `diff`, `strict`, and `skipPrototype` settings).
|
|
95
|
+
* The destructured methods will fall back to default behavior instead.
|
|
106
96
|
*
|
|
107
|
-
*
|
|
97
|
+
* ```js
|
|
98
|
+
* const myAssert = new Assert({ diff: 'full' });
|
|
108
99
|
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* callsfunc(1, 2, 3);
|
|
100
|
+
* // This works as expected - uses 'full' diff
|
|
101
|
+
* myAssert.strictEqual({ a: 1 }, { b: { c: 1 } });
|
|
112
102
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
103
|
+
* // This loses the 'full' diff setting - falls back to default 'simple' diff
|
|
104
|
+
* const { strictEqual } = myAssert;
|
|
105
|
+
* strictEqual({ a: 1 }, { b: { c: 1 } });
|
|
115
106
|
* ```
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*/
|
|
119
|
-
getCalls(fn: Function): CallTrackerCall[];
|
|
120
|
-
/**
|
|
121
|
-
* The arrays contains information about the expected and actual number of calls of
|
|
122
|
-
* the functions that have not been called the expected number of times.
|
|
107
|
+
*
|
|
108
|
+
* The `skipPrototype` option affects all deep equality methods:
|
|
123
109
|
*
|
|
124
110
|
* ```js
|
|
125
|
-
*
|
|
111
|
+
* class Foo {
|
|
112
|
+
* constructor(a) {
|
|
113
|
+
* this.a = a;
|
|
114
|
+
* }
|
|
115
|
+
* }
|
|
126
116
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
117
|
+
* class Bar {
|
|
118
|
+
* constructor(a) {
|
|
119
|
+
* this.a = a;
|
|
120
|
+
* }
|
|
121
|
+
* }
|
|
129
122
|
*
|
|
130
|
-
*
|
|
123
|
+
* const foo = new Foo(1);
|
|
124
|
+
* const bar = new Bar(1);
|
|
131
125
|
*
|
|
132
|
-
* //
|
|
133
|
-
*
|
|
134
|
-
*
|
|
126
|
+
* // Default behavior - fails due to different constructors
|
|
127
|
+
* const assert1 = new Assert();
|
|
128
|
+
* assert1.deepStrictEqual(foo, bar); // AssertionError
|
|
135
129
|
*
|
|
136
|
-
* //
|
|
137
|
-
*
|
|
138
|
-
* //
|
|
139
|
-
* // {
|
|
140
|
-
* // message: 'Expected the func function to be executed 2 time(s) but was
|
|
141
|
-
* // executed 0 time(s).',
|
|
142
|
-
* // actual: 0,
|
|
143
|
-
* // expected: 2,
|
|
144
|
-
* // operator: 'func',
|
|
145
|
-
* // stack: stack trace
|
|
146
|
-
* // }
|
|
147
|
-
* // ]
|
|
130
|
+
* // Skip prototype comparison - passes if properties are equal
|
|
131
|
+
* const assert2 = new Assert({ skipPrototype: true });
|
|
132
|
+
* assert2.deepStrictEqual(foo, bar); // OK
|
|
148
133
|
* ```
|
|
149
|
-
*
|
|
150
|
-
*
|
|
134
|
+
*
|
|
135
|
+
* When destructured, methods lose access to the instance's `this` context and revert to default assertion behavior
|
|
136
|
+
* (diff: 'simple', non-strict mode).
|
|
137
|
+
* To maintain custom options when using destructured methods, avoid
|
|
138
|
+
* destructuring and call methods directly on the instance.
|
|
139
|
+
* @since v24.6.0
|
|
151
140
|
*/
|
|
152
|
-
|
|
141
|
+
new(
|
|
142
|
+
options?: AssertOptions & { strict?: true | undefined },
|
|
143
|
+
): AssertStrict;
|
|
144
|
+
new(
|
|
145
|
+
options: AssertOptions,
|
|
146
|
+
): Assert;
|
|
147
|
+
};
|
|
148
|
+
interface AssertionErrorOptions {
|
|
153
149
|
/**
|
|
154
|
-
*
|
|
155
|
-
* If no arguments are passed, all tracked functions will be reset.
|
|
156
|
-
*
|
|
157
|
-
* ```js
|
|
158
|
-
* import assert from 'node:assert';
|
|
159
|
-
*
|
|
160
|
-
* const tracker = new assert.CallTracker();
|
|
161
|
-
*
|
|
162
|
-
* function func() {}
|
|
163
|
-
* const callsfunc = tracker.calls(func);
|
|
164
|
-
*
|
|
165
|
-
* callsfunc();
|
|
166
|
-
* // Tracker was called once
|
|
167
|
-
* assert.strictEqual(tracker.getCalls(callsfunc).length, 1);
|
|
168
|
-
*
|
|
169
|
-
* tracker.reset(callsfunc);
|
|
170
|
-
* assert.strictEqual(tracker.getCalls(callsfunc).length, 0);
|
|
171
|
-
* ```
|
|
172
|
-
* @since v18.8.0, v16.18.0
|
|
173
|
-
* @param fn a tracked function to reset.
|
|
150
|
+
* If provided, the error message is set to this value.
|
|
174
151
|
*/
|
|
175
|
-
|
|
152
|
+
message?: string | undefined;
|
|
176
153
|
/**
|
|
177
|
-
*
|
|
178
|
-
* have not been called the expected number of times.
|
|
179
|
-
*
|
|
180
|
-
* ```js
|
|
181
|
-
* import assert from 'node:assert';
|
|
182
|
-
*
|
|
183
|
-
* // Creates call tracker.
|
|
184
|
-
* const tracker = new assert.CallTracker();
|
|
185
|
-
*
|
|
186
|
-
* function func() {}
|
|
187
|
-
*
|
|
188
|
-
* // Returns a function that wraps func() that must be called exact times
|
|
189
|
-
* // before tracker.verify().
|
|
190
|
-
* const callsfunc = tracker.calls(func, 2);
|
|
191
|
-
*
|
|
192
|
-
* callsfunc();
|
|
193
|
-
*
|
|
194
|
-
* // Will throw an error since callsfunc() was only called once.
|
|
195
|
-
* tracker.verify();
|
|
196
|
-
* ```
|
|
197
|
-
* @since v14.2.0, v12.19.0
|
|
154
|
+
* The `actual` property on the error instance.
|
|
198
155
|
*/
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
156
|
+
actual?: unknown;
|
|
157
|
+
/**
|
|
158
|
+
* The `expected` property on the error instance.
|
|
159
|
+
*/
|
|
160
|
+
expected?: unknown;
|
|
161
|
+
/**
|
|
162
|
+
* The `operator` property on the error instance.
|
|
163
|
+
*/
|
|
164
|
+
operator?: string | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* If provided, the generated stack trace omits frames before this function.
|
|
167
|
+
*/
|
|
168
|
+
stackStartFn?: Function | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* If set to `'full'`, shows the full diff in assertion errors.
|
|
171
|
+
* @default 'simple'
|
|
172
|
+
*/
|
|
173
|
+
diff?: "simple" | "full" | undefined;
|
|
204
174
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
175
|
+
/**
|
|
176
|
+
* Indicates the failure of an assertion. All errors thrown by the `node:assert` module will be instances of the `AssertionError` class.
|
|
177
|
+
*/
|
|
178
|
+
class AssertionError extends Error {
|
|
179
|
+
constructor(options: AssertionErrorOptions);
|
|
180
|
+
/**
|
|
181
|
+
* Set to the `actual` argument for methods such as {@link assert.strictEqual()}.
|
|
182
|
+
*/
|
|
183
|
+
actual: unknown;
|
|
184
|
+
/**
|
|
185
|
+
* Set to the `expected` argument for methods such as {@link assert.strictEqual()}.
|
|
186
|
+
*/
|
|
187
|
+
expected: unknown;
|
|
188
|
+
/**
|
|
189
|
+
* Indicates if the message was auto-generated (`true`) or not.
|
|
190
|
+
*/
|
|
191
|
+
generatedMessage: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Value is always `ERR_ASSERTION` to show that the error is an assertion error.
|
|
194
|
+
*/
|
|
195
|
+
code: "ERR_ASSERTION";
|
|
196
|
+
/**
|
|
197
|
+
* Set to the passed in operator value.
|
|
198
|
+
*/
|
|
212
199
|
operator: string;
|
|
213
|
-
/** A stack trace of the function. */
|
|
214
|
-
stack: object;
|
|
215
200
|
}
|
|
216
201
|
type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
|
|
217
202
|
/**
|
|
@@ -231,22 +216,10 @@ declare module "node:assert" {
|
|
|
231
216
|
* assert.fail(new TypeError('need array'));
|
|
232
217
|
* // TypeError: need array
|
|
233
218
|
* ```
|
|
234
|
-
*
|
|
235
|
-
* Using `assert.fail()` with more than two arguments is possible but deprecated.
|
|
236
|
-
* See below for further details.
|
|
237
219
|
* @since v0.1.21
|
|
238
220
|
* @param [message='Failed']
|
|
239
221
|
*/
|
|
240
222
|
function fail(message?: string | Error): never;
|
|
241
|
-
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
|
242
|
-
function fail(
|
|
243
|
-
actual: unknown,
|
|
244
|
-
expected: unknown,
|
|
245
|
-
message?: string | Error,
|
|
246
|
-
operator?: string,
|
|
247
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
248
|
-
stackStartFn?: Function,
|
|
249
|
-
): never;
|
|
250
223
|
/**
|
|
251
224
|
* Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`.
|
|
252
225
|
*
|
|
@@ -814,7 +787,7 @@ declare module "node:assert" {
|
|
|
814
787
|
* check that the promise is rejected.
|
|
815
788
|
*
|
|
816
789
|
* If `asyncFn` is a function and it throws an error synchronously, `assert.rejects()` will return a rejected `Promise` with that error. If the
|
|
817
|
-
* function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-
|
|
790
|
+
* function does not return a promise, `assert.rejects()` will return a rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v25.x/api/errors.html#err_invalid_return_value)
|
|
818
791
|
* error. In both cases the error handler is skipped.
|
|
819
792
|
*
|
|
820
793
|
* Besides the async nature to await the completion behaves identically to {@link throws}.
|
|
@@ -884,7 +857,7 @@ declare module "node:assert" {
|
|
|
884
857
|
*
|
|
885
858
|
* If `asyncFn` is a function and it throws an error synchronously, `assert.doesNotReject()` will return a rejected `Promise` with that error. If
|
|
886
859
|
* the function does not return a promise, `assert.doesNotReject()` will return a
|
|
887
|
-
* rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-
|
|
860
|
+
* rejected `Promise` with an [ERR_INVALID_RETURN_VALUE](https://nodejs.org/docs/latest-v25.x/api/errors.html#err_invalid_return_value) error. In both cases
|
|
888
861
|
* the error handler is skipped.
|
|
889
862
|
*
|
|
890
863
|
* Using `assert.doesNotReject()` is actually not useful because there is little
|
|
@@ -947,7 +920,7 @@ declare module "node:assert" {
|
|
|
947
920
|
* If the values do not match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal
|
|
948
921
|
* to the value of the `message` parameter. If the `message` parameter is
|
|
949
922
|
* undefined, a default error message is assigned. If the `message` parameter is an
|
|
950
|
-
* instance of an [Error](https://nodejs.org/docs/latest-
|
|
923
|
+
* instance of an [Error](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`.
|
|
951
924
|
* @since v13.6.0, v12.16.0
|
|
952
925
|
*/
|
|
953
926
|
function match(value: string, regExp: RegExp, message?: string | Error): void;
|
|
@@ -970,7 +943,7 @@ declare module "node:assert" {
|
|
|
970
943
|
* If the values do match, or if the `string` argument is of another type than `string`, an `{@link AssertionError}` is thrown with a `message` property set equal
|
|
971
944
|
* to the value of the `message` parameter. If the `message` parameter is
|
|
972
945
|
* undefined, a default error message is assigned. If the `message` parameter is an
|
|
973
|
-
* instance of an [Error](https://nodejs.org/docs/latest-
|
|
946
|
+
* instance of an [Error](https://nodejs.org/docs/latest-v25.x/api/errors.html#class-error) then it will be thrown instead of the `{@link AssertionError}`.
|
|
974
947
|
* @since v13.6.0, v12.16.0
|
|
975
948
|
*/
|
|
976
949
|
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
|
@@ -986,83 +959,9 @@ declare module "node:assert" {
|
|
|
986
959
|
* @since v22.13.0
|
|
987
960
|
*/
|
|
988
961
|
function partialDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
*
|
|
993
|
-
* In strict assertion mode, error messages for objects display a diff. In legacy assertion mode, error
|
|
994
|
-
* messages for objects display the objects, often truncated.
|
|
995
|
-
*
|
|
996
|
-
* To use strict assertion mode:
|
|
997
|
-
*
|
|
998
|
-
* ```js
|
|
999
|
-
* import { strict as assert } from 'node:assert';
|
|
1000
|
-
* import assert from 'node:assert/strict';
|
|
1001
|
-
* ```
|
|
1002
|
-
*
|
|
1003
|
-
* Example error diff:
|
|
1004
|
-
*
|
|
1005
|
-
* ```js
|
|
1006
|
-
* import { strict as assert } from 'node:assert';
|
|
1007
|
-
*
|
|
1008
|
-
* assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);
|
|
1009
|
-
* // AssertionError: Expected inputs to be strictly deep-equal:
|
|
1010
|
-
* // + actual - expected ... Lines skipped
|
|
1011
|
-
* //
|
|
1012
|
-
* // [
|
|
1013
|
-
* // [
|
|
1014
|
-
* // ...
|
|
1015
|
-
* // 2,
|
|
1016
|
-
* // + 3
|
|
1017
|
-
* // - '3'
|
|
1018
|
-
* // ],
|
|
1019
|
-
* // ...
|
|
1020
|
-
* // 5
|
|
1021
|
-
* // ]
|
|
1022
|
-
* ```
|
|
1023
|
-
*
|
|
1024
|
-
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS` environment variables. This will also
|
|
1025
|
-
* deactivate the colors in the REPL. For more on color support in terminal environments, read the tty
|
|
1026
|
-
* `getColorDepth()` documentation.
|
|
1027
|
-
*
|
|
1028
|
-
* @since v15.0.0, v13.9.0, v12.16.2, v9.9.0
|
|
1029
|
-
*/
|
|
1030
|
-
namespace strict {
|
|
1031
|
-
type AssertionError = assert.AssertionError;
|
|
1032
|
-
type AssertPredicate = assert.AssertPredicate;
|
|
1033
|
-
type CallTrackerCall = assert.CallTrackerCall;
|
|
1034
|
-
type CallTrackerReportInformation = assert.CallTrackerReportInformation;
|
|
1035
|
-
}
|
|
1036
|
-
const strict:
|
|
1037
|
-
& Omit<
|
|
1038
|
-
typeof assert,
|
|
1039
|
-
| "equal"
|
|
1040
|
-
| "notEqual"
|
|
1041
|
-
| "deepEqual"
|
|
1042
|
-
| "notDeepEqual"
|
|
1043
|
-
| "ok"
|
|
1044
|
-
| "strictEqual"
|
|
1045
|
-
| "deepStrictEqual"
|
|
1046
|
-
| "ifError"
|
|
1047
|
-
| "strict"
|
|
1048
|
-
| "AssertionError"
|
|
1049
|
-
>
|
|
1050
|
-
& {
|
|
1051
|
-
(value: unknown, message?: string | Error): asserts value;
|
|
1052
|
-
equal: typeof strictEqual;
|
|
1053
|
-
notEqual: typeof notStrictEqual;
|
|
1054
|
-
deepEqual: typeof deepStrictEqual;
|
|
1055
|
-
notDeepEqual: typeof notDeepStrictEqual;
|
|
1056
|
-
// Mapped types and assertion functions are incompatible?
|
|
1057
|
-
// TS2775: Assertions require every name in the call target
|
|
1058
|
-
// to be declared with an explicit type annotation.
|
|
1059
|
-
ok: typeof ok;
|
|
1060
|
-
strictEqual: typeof strictEqual;
|
|
1061
|
-
deepStrictEqual: typeof deepStrictEqual;
|
|
1062
|
-
ifError: typeof ifError;
|
|
1063
|
-
strict: typeof strict;
|
|
1064
|
-
AssertionError: typeof AssertionError;
|
|
1065
|
-
};
|
|
962
|
+
}
|
|
963
|
+
namespace assert {
|
|
964
|
+
export { strict };
|
|
1066
965
|
}
|
|
1067
966
|
export = assert;
|
|
1068
967
|
}
|
package/async_hooks.d.ts
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* We strongly discourage the use of the `async_hooks` API.
|
|
18
18
|
* Other APIs that can cover most of its use cases include:
|
|
19
19
|
*
|
|
20
|
-
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-
|
|
21
|
-
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-
|
|
20
|
+
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v25.x/api/async_context.html#class-asynclocalstorage) tracks async context
|
|
21
|
+
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v25.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
|
|
22
22
|
*
|
|
23
23
|
* The `node:async_hooks` module provides an API to track asynchronous resources.
|
|
24
24
|
* It can be accessed using:
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* import async_hooks from 'node:async_hooks';
|
|
28
28
|
* ```
|
|
29
29
|
* @experimental
|
|
30
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
30
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/async_hooks.js)
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
declare module "node:async_hooks" {
|
|
@@ -60,7 +60,7 @@ declare module "node:async_hooks" {
|
|
|
60
60
|
* ```
|
|
61
61
|
*
|
|
62
62
|
* Promise contexts may not get precise `executionAsyncIds` by default.
|
|
63
|
-
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-
|
|
63
|
+
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promise-execution-tracking).
|
|
64
64
|
* @since v8.1.0
|
|
65
65
|
* @return The `asyncId` of the current execution context. Useful to track when something calls.
|
|
66
66
|
*/
|
|
@@ -133,7 +133,7 @@ declare module "node:async_hooks" {
|
|
|
133
133
|
* ```
|
|
134
134
|
*
|
|
135
135
|
* Promise contexts may not get valid `triggerAsyncId`s by default. See
|
|
136
|
-
* the section on [promise execution tracking](https://nodejs.org/docs/latest-
|
|
136
|
+
* the section on [promise execution tracking](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promise-execution-tracking).
|
|
137
137
|
* @return The ID of the resource responsible for calling the callback that is currently being executed.
|
|
138
138
|
*/
|
|
139
139
|
function triggerAsyncId(): number;
|
package/buffer.buffer.d.ts
CHANGED
|
@@ -467,13 +467,16 @@ declare module "node:buffer" {
|
|
|
467
467
|
*/
|
|
468
468
|
subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
|
|
469
469
|
}
|
|
470
|
+
// TODO: remove globals in future version
|
|
471
|
+
/**
|
|
472
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
473
|
+
* TypeScript versions earlier than 5.7.
|
|
474
|
+
*/
|
|
470
475
|
type NonSharedBuffer = Buffer<ArrayBuffer>;
|
|
476
|
+
/**
|
|
477
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
478
|
+
* TypeScript versions earlier than 5.7.
|
|
479
|
+
*/
|
|
471
480
|
type AllowSharedBuffer = Buffer<ArrayBufferLike>;
|
|
472
481
|
}
|
|
473
|
-
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
474
|
-
var SlowBuffer: {
|
|
475
|
-
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
476
|
-
new(size: number): Buffer<ArrayBuffer>;
|
|
477
|
-
prototype: Buffer;
|
|
478
|
-
};
|
|
479
482
|
}
|