@types/node 20.17.17 → 20.17.19

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 v20.17/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/v20.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 04 Feb 2025 00:04:06 GMT
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 v20.17/assert.d.ts CHANGED
@@ -1015,6 +1015,7 @@ declare module "assert" {
1015
1015
  | "deepStrictEqual"
1016
1016
  | "ifError"
1017
1017
  | "strict"
1018
+ | "AssertionError"
1018
1019
  >
1019
1020
  & {
1020
1021
  (value: unknown, message?: string | Error): asserts value;
@@ -1030,6 +1031,7 @@ declare module "assert" {
1030
1031
  deepStrictEqual: typeof deepStrictEqual;
1031
1032
  ifError: typeof ifError;
1032
1033
  strict: typeof strict;
1034
+ AssertionError: typeof AssertionError;
1033
1035
  };
1034
1036
  }
1035
1037
  export = assert;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.17.17",
3
+ "version": "20.17.19",
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.19.2"
216
216
  },
217
217
  "peerDependencies": {},
218
- "typesPublisherContentHash": "e184a1585085e8f3830812fd0f375097a556d3a552f6fb38e3244d755334d004",
218
+ "typesPublisherContentHash": "9bb30d44efc8fa9fe96fbdb857c476361cdbe4443ac95feed1f4e593a0638b84",
219
219
  "typeScriptVersion": "5.0"
220
220
  }
node v20.17/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(streamReadable: Readable): streamWeb.ReadableStream;
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 v20.17/test.d.ts CHANGED
@@ -455,6 +455,23 @@ declare module "node:test" {
455
455
  /**
456
456
  * An object containing assertion methods bound to the test context.
457
457
  * The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans.
458
+ *
459
+ * **Note:** Some of the functions from `node:assert` contain type assertions. If these are called via the
460
+ * TestContext `assert` object, then the context parameter in the test's function signature **must be explicitly typed**
461
+ * (ie. the parameter must have a type annotation), otherwise an error will be raised by the TypeScript compiler:
462
+ * ```ts
463
+ * import { test, type TestContext } from 'node:test';
464
+ *
465
+ * // The test function's context parameter must have a type annotation.
466
+ * test('example', (t: TestContext) => {
467
+ * t.assert.deepStrictEqual(actual, expected);
468
+ * });
469
+ *
470
+ * // Omitting the type annotation will result in a compilation error.
471
+ * test('example', t => {
472
+ * t.assert.deepStrictEqual(actual, expected); // Error: 't' needs an explicit type annotation.
473
+ * });
474
+ * ```
458
475
  * @since v20.15.0
459
476
  */
460
477
  readonly assert: TestContextAssert;
@@ -626,140 +643,28 @@ declare module "node:test" {
626
643
  */
627
644
  readonly mock: MockTracker;
628
645
  }
629
- interface TestContextAssert {
630
- /**
631
- * Identical to the `deepEqual` function from the `node:assert` module, but bound to the test context.
632
- */
633
- deepEqual: typeof import("node:assert").deepEqual;
634
- /**
635
- * Identical to the `deepStrictEqual` function from the `node:assert` module, but bound to the test context.
636
- *
637
- * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
638
- * type annotation, otherwise an error will be raised by the TypeScript compiler:
639
- * ```ts
640
- * import { test, type TestContext } from 'node:test';
641
- *
642
- * // The test function's context parameter must have a type annotation.
643
- * test('example', (t: TestContext) => {
644
- * t.assert.deepStrictEqual(actual, expected);
645
- * });
646
- *
647
- * // Omitting the type annotation will result in a compilation error.
648
- * test('example', t => {
649
- * t.assert.deepStrictEqual(actual, expected); // Error: 't' needs an explicit type annotation.
650
- * });
651
- * ```
652
- */
653
- deepStrictEqual: typeof import("node:assert").deepStrictEqual;
654
- /**
655
- * Identical to the `doesNotMatch` function from the `node:assert` module, but bound to the test context.
656
- */
657
- doesNotMatch: typeof import("node:assert").doesNotMatch;
658
- /**
659
- * Identical to the `doesNotReject` function from the `node:assert` module, but bound to the test context.
660
- */
661
- doesNotReject: typeof import("node:assert").doesNotReject;
662
- /**
663
- * Identical to the `doesNotThrow` function from the `node:assert` module, but bound to the test context.
664
- */
665
- doesNotThrow: typeof import("node:assert").doesNotThrow;
666
- /**
667
- * Identical to the `equal` function from the `node:assert` module, but bound to the test context.
668
- */
669
- equal: typeof import("node:assert").equal;
670
- /**
671
- * Identical to the `fail` function from the `node:assert` module, but bound to the test context.
672
- */
673
- fail: typeof import("node:assert").fail;
674
- /**
675
- * Identical to the `ifError` function from the `node:assert` module, but bound to the test context.
676
- *
677
- * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
678
- * type annotation, otherwise an error will be raised by the TypeScript compiler:
679
- * ```ts
680
- * import { test, type TestContext } from 'node:test';
681
- *
682
- * // The test function's context parameter must have a type annotation.
683
- * test('example', (t: TestContext) => {
684
- * t.assert.ifError(err);
685
- * });
686
- *
687
- * // Omitting the type annotation will result in a compilation error.
688
- * test('example', t => {
689
- * t.assert.ifError(err); // Error: 't' needs an explicit type annotation.
690
- * });
691
- * ```
692
- */
693
- ifError: typeof import("node:assert").ifError;
694
- /**
695
- * Identical to the `match` function from the `node:assert` module, but bound to the test context.
696
- */
697
- match: typeof import("node:assert").match;
698
- /**
699
- * Identical to the `notDeepEqual` function from the `node:assert` module, but bound to the test context.
700
- */
701
- notDeepEqual: typeof import("node:assert").notDeepEqual;
702
- /**
703
- * Identical to the `notDeepStrictEqual` function from the `node:assert` module, but bound to the test context.
704
- */
705
- notDeepStrictEqual: typeof import("node:assert").notDeepStrictEqual;
706
- /**
707
- * Identical to the `notEqual` function from the `node:assert` module, but bound to the test context.
708
- */
709
- notEqual: typeof import("node:assert").notEqual;
710
- /**
711
- * Identical to the `notStrictEqual` function from the `node:assert` module, but bound to the test context.
712
- */
713
- notStrictEqual: typeof import("node:assert").notStrictEqual;
714
- /**
715
- * Identical to the `ok` function from the `node:assert` module, but bound to the test context.
716
- *
717
- * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
718
- * type annotation, otherwise an error will be raised by the TypeScript compiler:
719
- * ```ts
720
- * import { test, type TestContext } from 'node:test';
721
- *
722
- * // The test function's context parameter must have a type annotation.
723
- * test('example', (t: TestContext) => {
724
- * t.assert.ok(condition);
725
- * });
726
- *
727
- * // Omitting the type annotation will result in a compilation error.
728
- * test('example', t => {
729
- * t.assert.ok(condition)); // Error: 't' needs an explicit type annotation.
730
- * });
731
- * ```
732
- */
733
- ok: typeof import("node:assert").ok;
734
- /**
735
- * Identical to the `rejects` function from the `node:assert` module, but bound to the test context.
736
- */
737
- rejects: typeof import("node:assert").rejects;
738
- /**
739
- * Identical to the `strictEqual` function from the `node:assert` module, but bound to the test context.
740
- *
741
- * **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
742
- * type annotation, otherwise an error will be raised by the TypeScript compiler:
743
- * ```ts
744
- * import { test, type TestContext } from 'node:test';
745
- *
746
- * // The test function's context parameter must have a type annotation.
747
- * test('example', (t: TestContext) => {
748
- * t.assert.strictEqual(actual, expected);
749
- * });
750
- *
751
- * // Omitting the type annotation will result in a compilation error.
752
- * test('example', t => {
753
- * t.assert.strictEqual(actual, expected); // Error: 't' needs an explicit type annotation.
754
- * });
755
- * ```
756
- */
757
- strictEqual: typeof import("node:assert").strictEqual;
758
- /**
759
- * Identical to the `throws` function from the `node:assert` module, but bound to the test context.
760
- */
761
- throws: typeof import("node:assert").throws;
762
- }
646
+ interface TestContextAssert extends
647
+ Pick<
648
+ typeof import("assert"),
649
+ | "deepEqual"
650
+ | "deepStrictEqual"
651
+ | "doesNotMatch"
652
+ | "doesNotReject"
653
+ | "doesNotThrow"
654
+ | "equal"
655
+ | "fail"
656
+ | "ifError"
657
+ | "match"
658
+ | "notDeepEqual"
659
+ | "notDeepStrictEqual"
660
+ | "notEqual"
661
+ | "notStrictEqual"
662
+ | "ok"
663
+ | "rejects"
664
+ | "strictEqual"
665
+ | "throws"
666
+ >
667
+ {}
763
668
 
764
669
  /**
765
670
  * An instance of `SuiteContext` is passed to each suite function in order to