@types/node 20.17.44 → 20.17.46

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: Wed, 07 May 2025 15:38:50 GMT
11
+ * Last updated: Thu, 08 May 2025 14:02:18 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -710,6 +710,19 @@ declare module "fs/promises" {
710
710
  recursive?: boolean | undefined;
711
711
  },
712
712
  ): Promise<Dirent[]>;
713
+ /**
714
+ * Asynchronous readdir(3) - read a directory.
715
+ * @param path A path to a directory. If a URL is provided, it must use the `file:` protocol.
716
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
717
+ */
718
+ function readdir(
719
+ path: PathLike,
720
+ options: {
721
+ encoding: "buffer";
722
+ withFileTypes: true;
723
+ recursive?: boolean | undefined;
724
+ },
725
+ ): Promise<Dirent<Buffer>[]>;
713
726
  /**
714
727
  * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
715
728
  * fulfilled with the`linkString` upon success.
node v20.17/fs.d.ts CHANGED
@@ -196,7 +196,7 @@ declare module "fs" {
196
196
  * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.
197
197
  * @since v10.10.0
198
198
  */
199
- export class Dirent {
199
+ export class Dirent<Name extends string | Buffer = string> {
200
200
  /**
201
201
  * Returns `true` if the `fs.Dirent` object describes a regular file.
202
202
  * @since v10.10.0
@@ -239,7 +239,7 @@ declare module "fs" {
239
239
  * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}.
240
240
  * @since v10.10.0
241
241
  */
242
- name: string;
242
+ name: Name;
243
243
  /**
244
244
  * The base path that this `fs.Dirent` object refers to.
245
245
  * @since v20.12.0
@@ -2038,6 +2038,20 @@ declare module "fs" {
2038
2038
  },
2039
2039
  callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void,
2040
2040
  ): void;
2041
+ /**
2042
+ * Asynchronous readdir(3) - read a directory.
2043
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2044
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2045
+ */
2046
+ export function readdir(
2047
+ path: PathLike,
2048
+ options: {
2049
+ encoding: "buffer";
2050
+ withFileTypes: true;
2051
+ recursive?: boolean | undefined;
2052
+ },
2053
+ callback: (err: NodeJS.ErrnoException | null, files: Dirent<Buffer>[]) => void,
2054
+ ): void;
2041
2055
  export namespace readdir {
2042
2056
  /**
2043
2057
  * Asynchronous readdir(3) - read a directory.
@@ -2097,6 +2111,19 @@ declare module "fs" {
2097
2111
  recursive?: boolean | undefined;
2098
2112
  },
2099
2113
  ): Promise<Dirent[]>;
2114
+ /**
2115
+ * Asynchronous readdir(3) - read a directory.
2116
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2117
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2118
+ */
2119
+ function __promisify__(
2120
+ path: PathLike,
2121
+ options: {
2122
+ encoding: "buffer";
2123
+ withFileTypes: true;
2124
+ recursive?: boolean | undefined;
2125
+ },
2126
+ ): Promise<Dirent<Buffer>[]>;
2100
2127
  }
2101
2128
  /**
2102
2129
  * Reads the contents of the directory.
@@ -2164,6 +2191,19 @@ declare module "fs" {
2164
2191
  recursive?: boolean | undefined;
2165
2192
  },
2166
2193
  ): Dirent[];
2194
+ /**
2195
+ * Synchronous readdir(3) - read a directory.
2196
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2197
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2198
+ */
2199
+ export function readdirSync(
2200
+ path: PathLike,
2201
+ options: {
2202
+ encoding: "buffer";
2203
+ withFileTypes: true;
2204
+ recursive?: boolean | undefined;
2205
+ },
2206
+ ): Dirent<Buffer>[];
2167
2207
  /**
2168
2208
  * Closes the file descriptor. No arguments other than a possible exception are
2169
2209
  * given to the completion callback.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.17.44",
3
+ "version": "20.17.46",
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": "900a8c271fd24b350144089d8e9cf45e24621097252d1f952b88dd2aef4c17aa",
218
+ "typesPublisherContentHash": "254b6abbad575f913cc04add19b967cb738b6a5e8de645e2a14b635ed10c40fa",
219
219
  "typeScriptVersion": "5.1"
220
220
  }
node v20.17/vm.d.ts CHANGED
@@ -58,7 +58,7 @@ declare module "vm" {
58
58
  }
59
59
  interface ScriptOptions extends BaseOptions {
60
60
  /**
61
- * V8's code cache data for the supplied source.
61
+ * Provides an optional data with V8's code cache data for the supplied source.
62
62
  */
63
63
  cachedData?: Buffer | NodeJS.ArrayBufferView | undefined;
64
64
  /** @deprecated in favor of `script.createCachedData()` */
@@ -110,18 +110,24 @@ declare module "vm" {
110
110
  microtaskMode?: CreateContextOptions["microtaskMode"];
111
111
  }
112
112
  interface RunningCodeOptions extends RunningScriptOptions {
113
- cachedData?: ScriptOptions["cachedData"];
113
+ /**
114
+ * Provides an optional data with V8's code cache data for the supplied source.
115
+ */
116
+ cachedData?: ScriptOptions["cachedData"] | undefined;
114
117
  importModuleDynamically?: ScriptOptions["importModuleDynamically"];
115
118
  }
116
119
  interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
117
- cachedData?: ScriptOptions["cachedData"];
120
+ /**
121
+ * Provides an optional data with V8's code cache data for the supplied source.
122
+ */
123
+ cachedData?: ScriptOptions["cachedData"] | undefined;
118
124
  importModuleDynamically?: ScriptOptions["importModuleDynamically"];
119
125
  }
120
126
  interface CompileFunctionOptions extends BaseOptions {
121
127
  /**
122
128
  * Provides an optional data with V8's code cache data for the supplied source.
123
129
  */
124
- cachedData?: Buffer | undefined;
130
+ cachedData?: ScriptOptions["cachedData"] | undefined;
125
131
  /**
126
132
  * Specifies whether to produce new cache data.
127
133
  * @default false
@@ -807,6 +813,9 @@ declare module "vm" {
807
813
  * @default 'vm:module(i)' where i is a context-specific ascending index.
808
814
  */
809
815
  identifier?: string | undefined;
816
+ /**
817
+ * Provides an optional data with V8's code cache data for the supplied source.
818
+ */
810
819
  cachedData?: ScriptOptions["cachedData"] | undefined;
811
820
  context?: Context | undefined;
812
821
  lineOffset?: BaseOptions["lineOffset"] | undefined;