@types/node 22.13.3 → 22.13.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 +1 -1
- node/package.json +2 -2
- node/stream.d.ts +6 -1
- node/test.d.ts +40 -133
- node/vm.d.ts +1 -1
node/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: Thu, 13 Feb 2025 22:
|
11
|
+
* Last updated: Thu, 13 Feb 2025 22:34:15 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.13.
|
3
|
+
"version": "22.13.4",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -215,6 +215,6 @@
|
|
215
215
|
"undici-types": "~6.20.0"
|
216
216
|
},
|
217
217
|
"peerDependencies": {},
|
218
|
-
"typesPublisherContentHash": "
|
218
|
+
"typesPublisherContentHash": "dc164d6e72b86dd792e2033448f0a31cec674ea22fb6cbaf0dc05885f4337473",
|
219
219
|
"typeScriptVersion": "5.0"
|
220
220
|
}
|
node/stream.d.ts
CHANGED
@@ -981,7 +981,12 @@ declare module "stream" {
|
|
981
981
|
* @since v17.0.0
|
982
982
|
* @experimental
|
983
983
|
*/
|
984
|
-
static toWeb(
|
984
|
+
static toWeb(
|
985
|
+
streamReadable: Readable,
|
986
|
+
options?: {
|
987
|
+
strategy?: streamWeb.QueuingStrategy | undefined;
|
988
|
+
},
|
989
|
+
): streamWeb.ReadableStream;
|
985
990
|
}
|
986
991
|
interface WritableOptions extends StreamOptions<Writable> {
|
987
992
|
decodeStrings?: boolean | undefined;
|
node/test.d.ts
CHANGED
@@ -564,6 +564,23 @@ declare module "node:test" {
|
|
564
564
|
/**
|
565
565
|
* An object containing assertion methods bound to the test context.
|
566
566
|
* The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans.
|
567
|
+
*
|
568
|
+
* **Note:** Some of the functions from `node:assert` contain type assertions. If these are called via the
|
569
|
+
* TestContext `assert` object, then the context parameter in the test's function signature **must be explicitly typed**
|
570
|
+
* (ie. the parameter must have a type annotation), otherwise an error will be raised by the TypeScript compiler:
|
571
|
+
* ```ts
|
572
|
+
* import { test, type TestContext } from 'node:test';
|
573
|
+
*
|
574
|
+
* // The test function's context parameter must have a type annotation.
|
575
|
+
* test('example', (t: TestContext) => {
|
576
|
+
* t.assert.deepStrictEqual(actual, expected);
|
577
|
+
* });
|
578
|
+
*
|
579
|
+
* // Omitting the type annotation will result in a compilation error.
|
580
|
+
* test('example', t => {
|
581
|
+
* t.assert.deepStrictEqual(actual, expected); // Error: 't' needs an explicit type annotation.
|
582
|
+
* });
|
583
|
+
* ```
|
567
584
|
* @since v22.2.0, v20.15.0
|
568
585
|
*/
|
569
586
|
readonly assert: TestContextAssert;
|
@@ -741,139 +758,29 @@ declare module "node:test" {
|
|
741
758
|
*/
|
742
759
|
readonly mock: MockTracker;
|
743
760
|
}
|
744
|
-
interface TestContextAssert
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
*/
|
768
|
-
deepStrictEqual: typeof import("node:assert").deepStrictEqual;
|
769
|
-
/**
|
770
|
-
* Identical to the `doesNotMatch` function from the `node:assert` module, but bound to the test context.
|
771
|
-
*/
|
772
|
-
doesNotMatch: typeof import("node:assert").doesNotMatch;
|
773
|
-
/**
|
774
|
-
* Identical to the `doesNotReject` function from the `node:assert` module, but bound to the test context.
|
775
|
-
*/
|
776
|
-
doesNotReject: typeof import("node:assert").doesNotReject;
|
777
|
-
/**
|
778
|
-
* Identical to the `doesNotThrow` function from the `node:assert` module, but bound to the test context.
|
779
|
-
*/
|
780
|
-
doesNotThrow: typeof import("node:assert").doesNotThrow;
|
781
|
-
/**
|
782
|
-
* Identical to the `equal` function from the `node:assert` module, but bound to the test context.
|
783
|
-
*/
|
784
|
-
equal: typeof import("node:assert").equal;
|
785
|
-
/**
|
786
|
-
* Identical to the `fail` function from the `node:assert` module, but bound to the test context.
|
787
|
-
*/
|
788
|
-
fail: typeof import("node:assert").fail;
|
789
|
-
/**
|
790
|
-
* Identical to the `ifError` function from the `node:assert` module, but bound to the test context.
|
791
|
-
*
|
792
|
-
* **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
|
793
|
-
* type annotation, otherwise an error will be raised by the TypeScript compiler:
|
794
|
-
* ```ts
|
795
|
-
* import { test, type TestContext } from 'node:test';
|
796
|
-
*
|
797
|
-
* // The test function's context parameter must have a type annotation.
|
798
|
-
* test('example', (t: TestContext) => {
|
799
|
-
* t.assert.ifError(err);
|
800
|
-
* });
|
801
|
-
*
|
802
|
-
* // Omitting the type annotation will result in a compilation error.
|
803
|
-
* test('example', t => {
|
804
|
-
* t.assert.ifError(err); // Error: 't' needs an explicit type annotation.
|
805
|
-
* });
|
806
|
-
* ```
|
807
|
-
*/
|
808
|
-
ifError: typeof import("node:assert").ifError;
|
809
|
-
/**
|
810
|
-
* Identical to the `match` function from the `node:assert` module, but bound to the test context.
|
811
|
-
*/
|
812
|
-
match: typeof import("node:assert").match;
|
813
|
-
/**
|
814
|
-
* Identical to the `notDeepEqual` function from the `node:assert` module, but bound to the test context.
|
815
|
-
*/
|
816
|
-
notDeepEqual: typeof import("node:assert").notDeepEqual;
|
817
|
-
/**
|
818
|
-
* Identical to the `notDeepStrictEqual` function from the `node:assert` module, but bound to the test context.
|
819
|
-
*/
|
820
|
-
notDeepStrictEqual: typeof import("node:assert").notDeepStrictEqual;
|
821
|
-
/**
|
822
|
-
* Identical to the `notEqual` function from the `node:assert` module, but bound to the test context.
|
823
|
-
*/
|
824
|
-
notEqual: typeof import("node:assert").notEqual;
|
825
|
-
/**
|
826
|
-
* Identical to the `notStrictEqual` function from the `node:assert` module, but bound to the test context.
|
827
|
-
*/
|
828
|
-
notStrictEqual: typeof import("node:assert").notStrictEqual;
|
829
|
-
/**
|
830
|
-
* Identical to the `ok` function from the `node:assert` module, but bound to the test context.
|
831
|
-
*
|
832
|
-
* **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
|
833
|
-
* type annotation, otherwise an error will be raised by the TypeScript compiler:
|
834
|
-
* ```ts
|
835
|
-
* import { test, type TestContext } from 'node:test';
|
836
|
-
*
|
837
|
-
* // The test function's context parameter must have a type annotation.
|
838
|
-
* test('example', (t: TestContext) => {
|
839
|
-
* t.assert.ok(condition);
|
840
|
-
* });
|
841
|
-
*
|
842
|
-
* // Omitting the type annotation will result in a compilation error.
|
843
|
-
* test('example', t => {
|
844
|
-
* t.assert.ok(condition)); // Error: 't' needs an explicit type annotation.
|
845
|
-
* });
|
846
|
-
* ```
|
847
|
-
*/
|
848
|
-
ok: typeof import("node:assert").ok;
|
849
|
-
/**
|
850
|
-
* Identical to the `rejects` function from the `node:assert` module, but bound to the test context.
|
851
|
-
*/
|
852
|
-
rejects: typeof import("node:assert").rejects;
|
853
|
-
/**
|
854
|
-
* Identical to the `strictEqual` function from the `node:assert` module, but bound to the test context.
|
855
|
-
*
|
856
|
-
* **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
|
857
|
-
* type annotation, otherwise an error will be raised by the TypeScript compiler:
|
858
|
-
* ```ts
|
859
|
-
* import { test, type TestContext } from 'node:test';
|
860
|
-
*
|
861
|
-
* // The test function's context parameter must have a type annotation.
|
862
|
-
* test('example', (t: TestContext) => {
|
863
|
-
* t.assert.strictEqual(actual, expected);
|
864
|
-
* });
|
865
|
-
*
|
866
|
-
* // Omitting the type annotation will result in a compilation error.
|
867
|
-
* test('example', t => {
|
868
|
-
* t.assert.strictEqual(actual, expected); // Error: 't' needs an explicit type annotation.
|
869
|
-
* });
|
870
|
-
* ```
|
871
|
-
*/
|
872
|
-
strictEqual: typeof import("node:assert").strictEqual;
|
873
|
-
/**
|
874
|
-
* Identical to the `throws` function from the `node:assert` module, but bound to the test context.
|
875
|
-
*/
|
876
|
-
throws: typeof import("node:assert").throws;
|
761
|
+
interface TestContextAssert extends
|
762
|
+
Pick<
|
763
|
+
typeof import("assert"),
|
764
|
+
| "deepEqual"
|
765
|
+
| "deepStrictEqual"
|
766
|
+
| "doesNotMatch"
|
767
|
+
| "doesNotReject"
|
768
|
+
| "doesNotThrow"
|
769
|
+
| "equal"
|
770
|
+
| "fail"
|
771
|
+
| "ifError"
|
772
|
+
| "match"
|
773
|
+
| "notDeepEqual"
|
774
|
+
| "notDeepStrictEqual"
|
775
|
+
| "notEqual"
|
776
|
+
| "notStrictEqual"
|
777
|
+
| "ok"
|
778
|
+
| "partialDeepStrictEqual"
|
779
|
+
| "rejects"
|
780
|
+
| "strictEqual"
|
781
|
+
| "throws"
|
782
|
+
>
|
783
|
+
{
|
877
784
|
/**
|
878
785
|
* This function implements assertions for snapshot testing.
|
879
786
|
* ```js
|
node/vm.d.ts
CHANGED
@@ -69,7 +69,7 @@ declare module "vm" {
|
|
69
69
|
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
70
70
|
*/
|
71
71
|
importModuleDynamically?:
|
72
|
-
| ((specifier: string, script: Script, importAttributes: ImportAttributes) => Module)
|
72
|
+
| ((specifier: string, script: Script, importAttributes: ImportAttributes) => Module | Promise<Module>)
|
73
73
|
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
74
74
|
| undefined;
|
75
75
|
}
|