@types/node 20.14.15 → 20.15.0
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.14 → node v20.15}/README.md +1 -1
- {node v20.14 → node v20.15}/package.json +3 -3
- {node v20.14 → node v20.15}/test.d.ts +120 -0
- {node v20.14 → node v20.15}/zlib.d.ts +9 -0
- {node v20.14 → node v20.15}/LICENSE +0 -0
- {node v20.14 → node v20.15}/assert/strict.d.ts +0 -0
- {node v20.14 → node v20.15}/assert.d.ts +0 -0
- {node v20.14 → node v20.15}/async_hooks.d.ts +0 -0
- {node v20.14 → node v20.15}/buffer.d.ts +0 -0
- {node v20.14 → node v20.15}/child_process.d.ts +0 -0
- {node v20.14 → node v20.15}/cluster.d.ts +0 -0
- {node v20.14 → node v20.15}/console.d.ts +0 -0
- {node v20.14 → node v20.15}/constants.d.ts +0 -0
- {node v20.14 → node v20.15}/crypto.d.ts +0 -0
- {node v20.14 → node v20.15}/dgram.d.ts +0 -0
- {node v20.14 → node v20.15}/diagnostics_channel.d.ts +0 -0
- {node v20.14 → node v20.15}/dns/promises.d.ts +0 -0
- {node v20.14 → node v20.15}/dns.d.ts +0 -0
- {node v20.14 → node v20.15}/dom-events.d.ts +0 -0
- {node v20.14 → node v20.15}/domain.d.ts +0 -0
- {node v20.14 → node v20.15}/events.d.ts +0 -0
- {node v20.14 → node v20.15}/fs/promises.d.ts +0 -0
- {node v20.14 → node v20.15}/fs.d.ts +0 -0
- {node v20.14 → node v20.15}/globals.d.ts +0 -0
- {node v20.14 → node v20.15}/globals.global.d.ts +0 -0
- {node v20.14 → node v20.15}/http.d.ts +0 -0
- {node v20.14 → node v20.15}/http2.d.ts +0 -0
- {node v20.14 → node v20.15}/https.d.ts +0 -0
- {node v20.14 → node v20.15}/index.d.ts +0 -0
- {node v20.14 → node v20.15}/inspector.d.ts +0 -0
- {node v20.14 → node v20.15}/module.d.ts +0 -0
- {node v20.14 → node v20.15}/net.d.ts +0 -0
- {node v20.14 → node v20.15}/os.d.ts +0 -0
- {node v20.14 → node v20.15}/path.d.ts +0 -0
- {node v20.14 → node v20.15}/perf_hooks.d.ts +0 -0
- {node v20.14 → node v20.15}/process.d.ts +0 -0
- {node v20.14 → node v20.15}/punycode.d.ts +0 -0
- {node v20.14 → node v20.15}/querystring.d.ts +0 -0
- {node v20.14 → node v20.15}/readline/promises.d.ts +0 -0
- {node v20.14 → node v20.15}/readline.d.ts +0 -0
- {node v20.14 → node v20.15}/repl.d.ts +0 -0
- {node v20.14 → node v20.15}/sea.d.ts +0 -0
- {node v20.14 → node v20.15}/stream/consumers.d.ts +0 -0
- {node v20.14 → node v20.15}/stream/promises.d.ts +0 -0
- {node v20.14 → node v20.15}/stream/web.d.ts +0 -0
- {node v20.14 → node v20.15}/stream.d.ts +0 -0
- {node v20.14 → node v20.15}/string_decoder.d.ts +0 -0
- {node v20.14 → node v20.15}/timers/promises.d.ts +0 -0
- {node v20.14 → node v20.15}/timers.d.ts +0 -0
- {node v20.14 → node v20.15}/tls.d.ts +0 -0
- {node v20.14 → node v20.15}/trace_events.d.ts +0 -0
- {node v20.14 → node v20.15}/tty.d.ts +0 -0
- {node v20.14 → node v20.15}/url.d.ts +0 -0
- {node v20.14 → node v20.15}/util.d.ts +0 -0
- {node v20.14 → node v20.15}/v8.d.ts +0 -0
- {node v20.14 → node v20.15}/vm.d.ts +0 -0
- {node v20.14 → node v20.15}/wasi.d.ts +0 -0
- {node v20.14 → node v20.15}/worker_threads.d.ts +0 -0
@@ -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: Fri,
|
11
|
+
* Last updated: Fri, 16 Aug 2024 18:09:07 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "20.
|
3
|
+
"version": "20.15.0",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -210,8 +210,8 @@
|
|
210
210
|
},
|
211
211
|
"scripts": {},
|
212
212
|
"dependencies": {
|
213
|
-
"undici-types": "~
|
213
|
+
"undici-types": "~6.13.0"
|
214
214
|
},
|
215
|
-
"typesPublisherContentHash": "
|
215
|
+
"typesPublisherContentHash": "05c96cc6164ffac54523a987511995996b7543e44ab3bc3c65d7ee41452cae81",
|
216
216
|
"typeScriptVersion": "4.8"
|
217
217
|
}
|
@@ -452,6 +452,12 @@ declare module "node:test" {
|
|
452
452
|
* @since v18.0.0, v16.17.0
|
453
453
|
*/
|
454
454
|
class TestContext {
|
455
|
+
/**
|
456
|
+
* An object containing assertion methods bound to the test context.
|
457
|
+
* The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans.
|
458
|
+
* @since v20.15.0
|
459
|
+
*/
|
460
|
+
readonly assert: TestContextAssert;
|
455
461
|
/**
|
456
462
|
* This function is used to create a hook running before subtest of the current test.
|
457
463
|
* @param fn The hook function. If the hook uses callbacks, the callback function is passed as the second argument.
|
@@ -499,6 +505,42 @@ declare module "node:test" {
|
|
499
505
|
* @since v18.8.0, v16.18.0
|
500
506
|
*/
|
501
507
|
readonly name: string;
|
508
|
+
/**
|
509
|
+
* Used to set the number of assertions and subtests that are expected to run within the test.
|
510
|
+
* If the number of assertions and subtests that run does not match the expected count, the test will fail.
|
511
|
+
*
|
512
|
+
* To make sure assertions are tracked, the assert functions on `context.assert` must be used,
|
513
|
+
* instead of importing from the `node:assert` module.
|
514
|
+
* ```js
|
515
|
+
* test('top level test', (t) => {
|
516
|
+
* t.plan(2);
|
517
|
+
* t.assert.ok('some relevant assertion here');
|
518
|
+
* t.test('subtest', () => {});
|
519
|
+
* });
|
520
|
+
* ```
|
521
|
+
*
|
522
|
+
* When working with asynchronous code, the `plan` function can be used to ensure that the correct number of assertions are run:
|
523
|
+
* ```js
|
524
|
+
* test('planning with streams', (t, done) => {
|
525
|
+
* function* generate() {
|
526
|
+
* yield 'a';
|
527
|
+
* yield 'b';
|
528
|
+
* yield 'c';
|
529
|
+
* }
|
530
|
+
* const expected = ['a', 'b', 'c'];
|
531
|
+
* t.plan(expected.length);
|
532
|
+
* const stream = Readable.from(generate());
|
533
|
+
* stream.on('data', (chunk) => {
|
534
|
+
* t.assert.strictEqual(chunk, expected.shift());
|
535
|
+
* });
|
536
|
+
* stream.on('end', () => {
|
537
|
+
* done();
|
538
|
+
* });
|
539
|
+
* });
|
540
|
+
* ```
|
541
|
+
* @since v20.15.0
|
542
|
+
*/
|
543
|
+
plan(count: number): void;
|
502
544
|
/**
|
503
545
|
* If `shouldRunOnlyTests` is truthy, the test context will only run tests that
|
504
546
|
* have the `only` option set. Otherwise, all tests are run. If Node.js was not
|
@@ -575,6 +617,76 @@ declare module "node:test" {
|
|
575
617
|
*/
|
576
618
|
readonly mock: MockTracker;
|
577
619
|
}
|
620
|
+
interface TestContextAssert {
|
621
|
+
/**
|
622
|
+
* Identical to the `deepEqual` function from the `node:assert` module, but bound to the test context.
|
623
|
+
*/
|
624
|
+
deepEqual: typeof import("node:assert").deepEqual;
|
625
|
+
/**
|
626
|
+
* Identical to the `deepStrictEqual` function from the `node:assert` module, but bound to the test context.
|
627
|
+
*/
|
628
|
+
deepStrictEqual: typeof import("node:assert").deepStrictEqual;
|
629
|
+
/**
|
630
|
+
* Identical to the `doesNotMatch` function from the `node:assert` module, but bound to the test context.
|
631
|
+
*/
|
632
|
+
doesNotMatch: typeof import("node:assert").doesNotMatch;
|
633
|
+
/**
|
634
|
+
* Identical to the `doesNotReject` function from the `node:assert` module, but bound to the test context.
|
635
|
+
*/
|
636
|
+
doesNotReject: typeof import("node:assert").doesNotReject;
|
637
|
+
/**
|
638
|
+
* Identical to the `doesNotThrow` function from the `node:assert` module, but bound to the test context.
|
639
|
+
*/
|
640
|
+
doesNotThrow: typeof import("node:assert").doesNotThrow;
|
641
|
+
/**
|
642
|
+
* Identical to the `equal` function from the `node:assert` module, but bound to the test context.
|
643
|
+
*/
|
644
|
+
equal: typeof import("node:assert").equal;
|
645
|
+
/**
|
646
|
+
* Identical to the `fail` function from the `node:assert` module, but bound to the test context.
|
647
|
+
*/
|
648
|
+
fail: typeof import("node:assert").fail;
|
649
|
+
/**
|
650
|
+
* Identical to the `ifError` function from the `node:assert` module, but bound to the test context.
|
651
|
+
*/
|
652
|
+
ifError: typeof import("node:assert").ifError;
|
653
|
+
/**
|
654
|
+
* Identical to the `match` function from the `node:assert` module, but bound to the test context.
|
655
|
+
*/
|
656
|
+
match: typeof import("node:assert").match;
|
657
|
+
/**
|
658
|
+
* Identical to the `notDeepEqual` function from the `node:assert` module, but bound to the test context.
|
659
|
+
*/
|
660
|
+
notDeepEqual: typeof import("node:assert").notDeepEqual;
|
661
|
+
/**
|
662
|
+
* Identical to the `notDeepStrictEqual` function from the `node:assert` module, but bound to the test context.
|
663
|
+
*/
|
664
|
+
notDeepStrictEqual: typeof import("node:assert").notDeepStrictEqual;
|
665
|
+
/**
|
666
|
+
* Identical to the `notEqual` function from the `node:assert` module, but bound to the test context.
|
667
|
+
*/
|
668
|
+
notEqual: typeof import("node:assert").notEqual;
|
669
|
+
/**
|
670
|
+
* Identical to the `notStrictEqual` function from the `node:assert` module, but bound to the test context.
|
671
|
+
*/
|
672
|
+
notStrictEqual: typeof import("node:assert").notStrictEqual;
|
673
|
+
/**
|
674
|
+
* Identical to the `ok` function from the `node:assert` module, but bound to the test context.
|
675
|
+
*/
|
676
|
+
ok: typeof import("node:assert").ok;
|
677
|
+
/**
|
678
|
+
* Identical to the `rejects` function from the `node:assert` module, but bound to the test context.
|
679
|
+
*/
|
680
|
+
rejects: typeof import("node:assert").rejects;
|
681
|
+
/**
|
682
|
+
* Identical to the `strictEqual` function from the `node:assert` module, but bound to the test context.
|
683
|
+
*/
|
684
|
+
strictEqual: typeof import("node:assert").strictEqual;
|
685
|
+
/**
|
686
|
+
* Identical to the `throws` function from the `node:assert` module, but bound to the test context.
|
687
|
+
*/
|
688
|
+
throws: typeof import("node:assert").throws;
|
689
|
+
}
|
578
690
|
|
579
691
|
/**
|
580
692
|
* An instance of `SuiteContext` is passed to each suite function in order to
|
@@ -634,6 +746,14 @@ declare module "node:test" {
|
|
634
746
|
* @default false
|
635
747
|
*/
|
636
748
|
todo?: boolean | string | undefined;
|
749
|
+
/**
|
750
|
+
* The number of assertions and subtests expected to be run in the test.
|
751
|
+
* If the number of assertions run in the test does not match the number
|
752
|
+
* specified in the plan, the test will fail.
|
753
|
+
* @default undefined
|
754
|
+
* @since v20.15.0
|
755
|
+
*/
|
756
|
+
plan?: number | undefined;
|
637
757
|
}
|
638
758
|
/**
|
639
759
|
* This function creates a hook that runs before executing a suite.
|
@@ -172,6 +172,15 @@ declare module "zlib" {
|
|
172
172
|
interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
|
173
173
|
interface InflateRaw extends stream.Transform, Zlib, ZlibReset {}
|
174
174
|
interface Unzip extends stream.Transform, Zlib {}
|
175
|
+
/**
|
176
|
+
* Computes a 32-bit [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum of `data`.
|
177
|
+
* If `value` is specified, it is used as the starting value of the checksum, otherwise, 0 is used as the starting value.
|
178
|
+
* @param data When `data` is a string, it will be encoded as UTF-8 before being used for computation.
|
179
|
+
* @param value An optional starting value. It must be a 32-bit unsigned integer. @default 0
|
180
|
+
* @returns A 32-bit unsigned integer containing the checksum.
|
181
|
+
* @since v20.15.0
|
182
|
+
*/
|
183
|
+
function crc32(data: string | Buffer | NodeJS.ArrayBufferView, value?: number): number;
|
175
184
|
/**
|
176
185
|
* Creates and returns a new `BrotliCompress` object.
|
177
186
|
* @since v11.7.0, v10.16.0
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|