@types/node 20.14.14 → 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.
Files changed (58) hide show
  1. {node v20.14 → node v20.15}/README.md +1 -1
  2. {node v20.14 → node v20.15}/package.json +3 -3
  3. {node v20.14 → node v20.15}/perf_hooks.d.ts +30 -1
  4. {node v20.14 → node v20.15}/test.d.ts +120 -0
  5. {node v20.14 → node v20.15}/zlib.d.ts +9 -0
  6. {node v20.14 → node v20.15}/LICENSE +0 -0
  7. {node v20.14 → node v20.15}/assert/strict.d.ts +0 -0
  8. {node v20.14 → node v20.15}/assert.d.ts +0 -0
  9. {node v20.14 → node v20.15}/async_hooks.d.ts +0 -0
  10. {node v20.14 → node v20.15}/buffer.d.ts +0 -0
  11. {node v20.14 → node v20.15}/child_process.d.ts +0 -0
  12. {node v20.14 → node v20.15}/cluster.d.ts +0 -0
  13. {node v20.14 → node v20.15}/console.d.ts +0 -0
  14. {node v20.14 → node v20.15}/constants.d.ts +0 -0
  15. {node v20.14 → node v20.15}/crypto.d.ts +0 -0
  16. {node v20.14 → node v20.15}/dgram.d.ts +0 -0
  17. {node v20.14 → node v20.15}/diagnostics_channel.d.ts +0 -0
  18. {node v20.14 → node v20.15}/dns/promises.d.ts +0 -0
  19. {node v20.14 → node v20.15}/dns.d.ts +0 -0
  20. {node v20.14 → node v20.15}/dom-events.d.ts +0 -0
  21. {node v20.14 → node v20.15}/domain.d.ts +0 -0
  22. {node v20.14 → node v20.15}/events.d.ts +0 -0
  23. {node v20.14 → node v20.15}/fs/promises.d.ts +0 -0
  24. {node v20.14 → node v20.15}/fs.d.ts +0 -0
  25. {node v20.14 → node v20.15}/globals.d.ts +0 -0
  26. {node v20.14 → node v20.15}/globals.global.d.ts +0 -0
  27. {node v20.14 → node v20.15}/http.d.ts +0 -0
  28. {node v20.14 → node v20.15}/http2.d.ts +0 -0
  29. {node v20.14 → node v20.15}/https.d.ts +0 -0
  30. {node v20.14 → node v20.15}/index.d.ts +0 -0
  31. {node v20.14 → node v20.15}/inspector.d.ts +0 -0
  32. {node v20.14 → node v20.15}/module.d.ts +0 -0
  33. {node v20.14 → node v20.15}/net.d.ts +0 -0
  34. {node v20.14 → node v20.15}/os.d.ts +0 -0
  35. {node v20.14 → node v20.15}/path.d.ts +0 -0
  36. {node v20.14 → node v20.15}/process.d.ts +0 -0
  37. {node v20.14 → node v20.15}/punycode.d.ts +0 -0
  38. {node v20.14 → node v20.15}/querystring.d.ts +0 -0
  39. {node v20.14 → node v20.15}/readline/promises.d.ts +0 -0
  40. {node v20.14 → node v20.15}/readline.d.ts +0 -0
  41. {node v20.14 → node v20.15}/repl.d.ts +0 -0
  42. {node v20.14 → node v20.15}/sea.d.ts +0 -0
  43. {node v20.14 → node v20.15}/stream/consumers.d.ts +0 -0
  44. {node v20.14 → node v20.15}/stream/promises.d.ts +0 -0
  45. {node v20.14 → node v20.15}/stream/web.d.ts +0 -0
  46. {node v20.14 → node v20.15}/stream.d.ts +0 -0
  47. {node v20.14 → node v20.15}/string_decoder.d.ts +0 -0
  48. {node v20.14 → node v20.15}/timers/promises.d.ts +0 -0
  49. {node v20.14 → node v20.15}/timers.d.ts +0 -0
  50. {node v20.14 → node v20.15}/tls.d.ts +0 -0
  51. {node v20.14 → node v20.15}/trace_events.d.ts +0 -0
  52. {node v20.14 → node v20.15}/tty.d.ts +0 -0
  53. {node v20.14 → node v20.15}/url.d.ts +0 -0
  54. {node v20.14 → node v20.15}/util.d.ts +0 -0
  55. {node v20.14 → node v20.15}/v8.d.ts +0 -0
  56. {node v20.14 → node v20.15}/vm.d.ts +0 -0
  57. {node v20.14 → node v20.15}/wasi.d.ts +0 -0
  58. {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, 02 Aug 2024 08:37:31 GMT
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.14.14",
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": "~5.26.4"
213
+ "undici-types": "~6.13.0"
214
214
  },
215
- "typesPublisherContentHash": "1fa173001f63810587670c42eca437b8d05f603117014c56df4d43d45a8b6453",
215
+ "typesPublisherContentHash": "05c96cc6164ffac54523a987511995996b7543e44ab3bc3c65d7ee41452cae81",
216
216
  "typeScriptVersion": "4.8"
217
217
  }
@@ -31,7 +31,17 @@
31
31
  */
32
32
  declare module "perf_hooks" {
33
33
  import { AsyncResource } from "node:async_hooks";
34
- type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns" | "net";
34
+ type EntryType =
35
+ | "dns" // Node.js only
36
+ | "function" // Node.js only
37
+ | "gc" // Node.js only
38
+ | "http2" // Node.js only
39
+ | "http" // Node.js only
40
+ | "mark" // available on the Web
41
+ | "measure" // available on the Web
42
+ | "net" // Node.js only
43
+ | "node" // Node.js only
44
+ | "resource"; // available on the Web
35
45
  interface NodeGCPerformanceDetail {
36
46
  /**
37
47
  * When `performanceEntry.entryType` is equal to 'gc', the `performance.kind` property identifies
@@ -270,6 +280,24 @@ declare module "perf_hooks" {
270
280
  * @param name
271
281
  */
272
282
  mark(name: string, options?: MarkOptions): PerformanceMark;
283
+ /**
284
+ * Creates a new `PerformanceResourceTiming` entry in the Resource Timeline.
285
+ * A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`.
286
+ * Performance resources are used to mark moments in the Resource Timeline.
287
+ * @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info)
288
+ * @param requestedUrl The resource url
289
+ * @param initiatorType The initiator name, e.g: 'fetch'
290
+ * @param global
291
+ * @param cacheMode The cache mode must be an empty string ('') or 'local'
292
+ * @since v18.2.0, v16.17.0
293
+ */
294
+ markResourceTiming(
295
+ timingInfo: object,
296
+ requestedUrl: string,
297
+ initiatorType: string,
298
+ global: object,
299
+ cacheMode: "" | "local",
300
+ ): PerformanceResourceTiming;
273
301
  /**
274
302
  * Creates a new PerformanceMeasure entry in the Performance Timeline.
275
303
  * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
@@ -543,6 +571,7 @@ declare module "perf_hooks" {
543
571
  * @since v18.2.0, v16.17.0
544
572
  */
545
573
  class PerformanceResourceTiming extends PerformanceEntry {
574
+ readonly entryType: "resource";
546
575
  protected constructor();
547
576
  /**
548
577
  * The high resolution millisecond timestamp at immediately before dispatching the `fetch`
@@ -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