@types/node 22.0.0 → 22.0.1

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 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: Sun, 28 Jul 2024 10:07:16 GMT
11
+ * Last updated: Wed, 31 Jul 2024 17:36:20 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/dns/promises.d.ts CHANGED
@@ -346,20 +346,20 @@ declare module "dns/promises" {
346
346
  */
347
347
  function setServers(servers: readonly string[]): void;
348
348
  /**
349
- * Set the default value of `order` in `dns.lookup()` and `{@link lookup}`. The value could be:
349
+ * Set the default value of `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
350
+ * The value could be:
350
351
  *
351
- * * `ipv4first`: sets default `order` to `ipv4first`.
352
- * * `ipv6first`: sets default `order` to `ipv6first`.
353
- * * `verbatim`: sets default `order` to `verbatim`.
352
+ * * `ipv4first`: sets default `verbatim` to `false`.
353
+ * * `verbatim`: sets default `verbatim` to `true`.
354
354
  *
355
- * The default is `verbatim` and [dnsPromises.setDefaultResultOrder()](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
356
- * have higher priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v20.x/api/cli.html#--dns-result-orderorder).
357
- * When using [worker threads](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html), [`dnsPromises.setDefaultResultOrder()`](https://nodejs.org/docs/latest-v20.x/api/dns.html#dnspromisessetdefaultresultorderorder)
358
- * from the main thread won't affect the default dns orders in workers.
355
+ * The default is `verbatim` and {@link setDefaultResultOrder} have higher
356
+ * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder). When using
357
+ * [worker threads](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
358
+ * thread won't affect the default dns orders in workers.
359
359
  * @since v16.4.0, v14.18.0
360
- * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
360
+ * @param order must be `'ipv4first'` or `'verbatim'`.
361
361
  */
362
- function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void;
362
+ function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
363
363
  // Error codes
364
364
  const NODATA: "ENODATA";
365
365
  const FORMERR: "EFORMERR";
node/dns.d.ts CHANGED
@@ -80,20 +80,11 @@ declare module "dns" {
80
80
  * @default false
81
81
  */
82
82
  all?: boolean | undefined;
83
- /**
84
- * When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted
85
- * by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
86
- * addresses before IPv4 addresses. Default value is configurable using
87
- * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder).
88
- * @default `verbatim` (addresses are not reordered)
89
- */
90
- order?: "ipv4first" | "ipv6first" | "verbatim" | undefined;
91
83
  /**
92
84
  * When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4
93
- * addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified,
94
- * `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder}
85
+ * addresses are placed before IPv6 addresses. Default value is configurable using {@link setDefaultResultOrder}
95
86
  * or [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder).
96
- * @default true (addresses are not reordered)
87
+ * @default true
97
88
  */
98
89
  verbatim?: boolean | undefined;
99
90
  }
@@ -672,15 +663,14 @@ declare module "dns" {
672
663
  callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
673
664
  ): void;
674
665
  /**
675
- * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
666
+ * Get the default value for `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
676
667
  * The value could be:
677
668
  *
678
- * * `ipv4first`: for `order` defaulting to `ipv4first`.
679
- * * `ipv6first`: for `order` defaulting to `ipv6first`.
680
- * * `verbatim`: for `order` defaulting to `verbatim`.
669
+ * * `ipv4first`: for `verbatim` defaulting to `false`.
670
+ * * `verbatim`: for `verbatim` defaulting to `true`.
681
671
  * @since v18.17.0
682
672
  */
683
- export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim";
673
+ export function getDefaultResultOrder(): "ipv4first" | "verbatim";
684
674
  /**
685
675
  * Sets the IP address and port of servers to be used when performing DNS
686
676
  * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
@@ -727,21 +717,19 @@ declare module "dns" {
727
717
  */
728
718
  export function getServers(): string[];
729
719
  /**
730
- * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
720
+ * Set the default value of `verbatim` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
731
721
  * The value could be:
732
722
  *
733
- * * `ipv4first`: sets default `order` to `ipv4first`.
734
- * * `ipv6first`: sets default `order` to `ipv6first`.
735
- * * `verbatim`: sets default `order` to `verbatim`.
723
+ * * `ipv4first`: sets default `verbatim` to `false`.
724
+ * * `verbatim`: sets default `verbatim` to `true`.
736
725
  *
737
726
  * The default is `verbatim` and {@link setDefaultResultOrder} have higher
738
727
  * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder). When using
739
728
  * [worker threads](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
740
729
  * thread won't affect the default dns orders in workers.
741
730
  * @since v16.4.0, v14.18.0
742
- * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
743
731
  */
744
- export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void;
732
+ export function setDefaultResultOrder(order: "ipv4first" | "verbatim"): void;
745
733
  // Error codes
746
734
  export const NODATA: "ENODATA";
747
735
  export const FORMERR: "EFORMERR";
node/fs/promises.d.ts CHANGED
@@ -21,8 +21,6 @@ declare module "fs/promises" {
21
21
  Dir,
22
22
  Dirent,
23
23
  GlobOptions,
24
- GlobOptionsWithFileTypes,
25
- GlobOptionsWithoutFileTypes,
26
24
  MakeDirectoryOptions,
27
25
  Mode,
28
26
  ObjectEncodingOptions,
@@ -1245,16 +1243,7 @@ declare module "fs/promises" {
1245
1243
  /**
1246
1244
  * Retrieves the files matching the specified pattern.
1247
1245
  */
1248
- function glob(pattern: string | string[]): AsyncIterableIterator<string>;
1249
- /**
1250
- * Retrieves the files matching the specified pattern.
1251
- */
1252
- function glob<Options extends GlobOptions>(
1253
- pattern: string | string[],
1254
- opt: Options,
1255
- ): Options extends GlobOptionsWithFileTypes ? AsyncIterableIterator<Dirent>
1256
- : Options extends GlobOptionsWithoutFileTypes ? AsyncIterableIterator<string>
1257
- : AsyncIterableIterator<Dirent> | AsyncIterableIterator<string>;
1246
+ function glob(pattern: string | string[], options?: GlobOptions): AsyncIterableIterator<string>;
1258
1247
  }
1259
1248
  declare module "node:fs/promises" {
1260
1249
  export * from "fs/promises";
node/fs.d.ts CHANGED
@@ -4324,17 +4324,6 @@ declare module "fs" {
4324
4324
  * Function to filter out files/directories. Return true to exclude the item, false to include it.
4325
4325
  */
4326
4326
  exclude?: ((fileName: string) => boolean) | undefined;
4327
- /**
4328
- * `true` if the glob should return paths as `Dirent`s, `false` otherwise.
4329
- * @default false
4330
- */
4331
- withFileTypes?: boolean | undefined;
4332
- }
4333
- export interface GlobOptionsWithFileTypes extends GlobOptions {
4334
- withFileTypes: true;
4335
- }
4336
- export interface GlobOptionsWithoutFileTypes extends GlobOptions {
4337
- withFileTypes?: false | undefined;
4338
4327
  }
4339
4328
  /**
4340
4329
  * Retrieves the files matching the specified pattern.
@@ -4343,32 +4332,15 @@ declare module "fs" {
4343
4332
  pattern: string | string[],
4344
4333
  callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void,
4345
4334
  ): void;
4346
- /**
4347
- * Retrieves the files matching the specified pattern.
4348
- */
4349
- export function glob<Options extends GlobOptions>(
4335
+ export function glob(
4350
4336
  pattern: string | string[],
4351
- options: Options,
4352
- callback: (
4353
- err: NodeJS.ErrnoException | null,
4354
- matches: Options extends GlobOptionsWithFileTypes ? Dirent[]
4355
- : Options extends GlobOptionsWithoutFileTypes ? string[]
4356
- : Dirent[] | string[],
4357
- ) => void,
4337
+ options: GlobOptions,
4338
+ callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void,
4358
4339
  ): void;
4359
4340
  /**
4360
4341
  * Retrieves the files matching the specified pattern.
4361
4342
  */
4362
- export function globSync(pattern: string | string[]): string[];
4363
- /**
4364
- * Retrieves the files matching the specified pattern.
4365
- */
4366
- export function globSync<Options extends GlobOptions>(
4367
- pattern: string | string[],
4368
- options: Options,
4369
- ): Options extends GlobOptionsWithFileTypes ? Dirent[]
4370
- : Options extends GlobOptionsWithoutFileTypes ? string[]
4371
- : Dirent[] | string[];
4343
+ export function globSync(pattern: string | string[], options?: GlobOptions): string[];
4372
4344
  }
4373
4345
  declare module "node:fs" {
4374
4346
  export * from "fs";
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "22.0.0",
3
+ "version": "22.0.1",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -212,6 +212,6 @@
212
212
  "dependencies": {
213
213
  "undici-types": "~6.11.1"
214
214
  },
215
- "typesPublisherContentHash": "14d7e2fcf1f884d0f55bb00df1951b1b7f2ad5995765756491fdd7dca5fd256f",
215
+ "typesPublisherContentHash": "812418de0c8a4d6f3dd51da81aeba50ecf77191b22dd1bb7c8f56be32e512105",
216
216
  "typeScriptVersion": "4.8"
217
217
  }
node/test.d.ts CHANGED
@@ -941,17 +941,6 @@ declare module "node:test" {
941
941
  * @since v19.1.0, v18.13.0
942
942
  */
943
943
  restoreAll(): void;
944
- /**
945
- * This function is used to mock the exports of ECMAScript modules,
946
- * CommonJS modules, and Node.js builtin modules. Any references to
947
- * the original module prior to mocking are not impacted
948
- * @since v22.3.0
949
- */
950
- module(speficier: string, options?: {
951
- cache?: boolean;
952
- defaultExport?: any;
953
- namedExports?: object;
954
- }): { restore: () => void };
955
944
  timers: MockTimers;
956
945
  }
957
946
  const mock: MockTracker;
node/url.d.ts CHANGED
@@ -46,14 +46,6 @@ declare module "url" {
46
46
  interface UrlWithStringQuery extends Url {
47
47
  query: string | null;
48
48
  }
49
- interface FileUrlToPathOptions {
50
- /**
51
- * `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default.
52
- * @default undefined
53
- */
54
- windows?: boolean | undefined;
55
- }
56
- interface PathToFileUrlOptions extends FileUrlToPathOptions {}
57
49
  /**
58
50
  * The `url.parse()` method takes a URL string, parses it, and returns a URL
59
51
  * object.
@@ -306,7 +298,7 @@ declare module "url" {
306
298
  * @param url The file URL string or URL object to convert to a path.
307
299
  * @return The fully-resolved platform-specific Node.js file path.
308
300
  */
309
- function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string;
301
+ function fileURLToPath(url: string | URL): string;
310
302
  /**
311
303
  * This function ensures that `path` is resolved absolutely, and that the URL
312
304
  * control characters are correctly encoded when converting into a File URL.
@@ -324,7 +316,7 @@ declare module "url" {
324
316
  * @param path The path to convert to a File URL.
325
317
  * @return The file URL object.
326
318
  */
327
- function pathToFileURL(path: string, options?: PathToFileUrlOptions): URL;
319
+ function pathToFileURL(path: string): URL;
328
320
  /**
329
321
  * This utility function converts a URL object into an ordinary options object as
330
322
  * expected by the `http.request()` and `https.request()` APIs.