@types/node 18.19.98 → 18.19.100

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 v18.19/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/v18.
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
@@ -694,6 +694,19 @@ declare module "fs/promises" {
694
694
  recursive?: boolean | undefined;
695
695
  },
696
696
  ): Promise<Dirent[]>;
697
+ /**
698
+ * Asynchronous readdir(3) - read a directory.
699
+ * @param path A path to a directory. If a URL is provided, it must use the `file:` protocol.
700
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
701
+ */
702
+ function readdir(
703
+ path: PathLike,
704
+ options: {
705
+ encoding: "buffer";
706
+ withFileTypes: true;
707
+ recursive?: boolean | undefined;
708
+ },
709
+ ): Promise<Dirent<Buffer>[]>;
697
710
  /**
698
711
  * 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
699
712
  * resolved with the`linkString` upon success.
node v18.19/fs.d.ts CHANGED
@@ -176,7 +176,7 @@ declare module "fs" {
176
176
  * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.
177
177
  * @since v10.10.0
178
178
  */
179
- export class Dirent {
179
+ export class Dirent<Name extends string | Buffer = string> {
180
180
  /**
181
181
  * Returns `true` if the `fs.Dirent` object describes a regular file.
182
182
  * @since v10.10.0
@@ -219,7 +219,7 @@ declare module "fs" {
219
219
  * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}.
220
220
  * @since v10.10.0
221
221
  */
222
- name: string;
222
+ name: Name;
223
223
  /**
224
224
  * The base path that this `fs.Dirent` object refers to.
225
225
  * @since v18.20.0
@@ -2057,6 +2057,20 @@ declare module "fs" {
2057
2057
  },
2058
2058
  callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void,
2059
2059
  ): void;
2060
+ /**
2061
+ * Asynchronous readdir(3) - read a directory.
2062
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2063
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2064
+ */
2065
+ export function readdir(
2066
+ path: PathLike,
2067
+ options: {
2068
+ encoding: "buffer";
2069
+ withFileTypes: true;
2070
+ recursive?: boolean | undefined;
2071
+ },
2072
+ callback: (err: NodeJS.ErrnoException | null, files: Dirent<Buffer>[]) => void,
2073
+ ): void;
2060
2074
  export namespace readdir {
2061
2075
  /**
2062
2076
  * Asynchronous readdir(3) - read a directory.
@@ -2116,6 +2130,19 @@ declare module "fs" {
2116
2130
  recursive?: boolean | undefined;
2117
2131
  },
2118
2132
  ): Promise<Dirent[]>;
2133
+ /**
2134
+ * Asynchronous readdir(3) - read a directory.
2135
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2136
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2137
+ */
2138
+ function __promisify__(
2139
+ path: PathLike,
2140
+ options: {
2141
+ encoding: "buffer";
2142
+ withFileTypes: true;
2143
+ recursive?: boolean | undefined;
2144
+ },
2145
+ ): Promise<Dirent<Buffer>[]>;
2119
2146
  }
2120
2147
  /**
2121
2148
  * Reads the contents of the directory.
@@ -2183,6 +2210,19 @@ declare module "fs" {
2183
2210
  recursive?: boolean | undefined;
2184
2211
  },
2185
2212
  ): Dirent[];
2213
+ /**
2214
+ * Synchronous readdir(3) - read a directory.
2215
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2216
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2217
+ */
2218
+ export function readdirSync(
2219
+ path: PathLike,
2220
+ options: {
2221
+ encoding: "buffer";
2222
+ withFileTypes: true;
2223
+ recursive?: boolean | undefined;
2224
+ },
2225
+ ): Dirent<Buffer>[];
2186
2226
  /**
2187
2227
  * Closes the file descriptor. No arguments other than a possible exception are
2188
2228
  * given to the completion callback.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.19.98",
3
+ "version": "18.19.100",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  "undici-types": "~5.26.4"
221
221
  },
222
222
  "peerDependencies": {},
223
- "typesPublisherContentHash": "029c23eb928a31851c24fd26aa9e01b0366185dbe35dc87c3f500e8d7cedf869",
223
+ "typesPublisherContentHash": "c2c89277b89281701299e1bef4e65a6116787b51e9671db9ff4854ac16b14148",
224
224
  "typeScriptVersion": "5.1"
225
225
  }
node v18.19/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()` */
@@ -108,18 +108,24 @@ declare module "vm" {
108
108
  microtaskMode?: CreateContextOptions["microtaskMode"];
109
109
  }
110
110
  interface RunningCodeOptions extends RunningScriptOptions {
111
- cachedData?: ScriptOptions["cachedData"];
111
+ /**
112
+ * Provides an optional data with V8's code cache data for the supplied source.
113
+ */
114
+ cachedData?: ScriptOptions["cachedData"] | undefined;
112
115
  importModuleDynamically?: ScriptOptions["importModuleDynamically"];
113
116
  }
114
117
  interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
115
- cachedData?: ScriptOptions["cachedData"];
118
+ /**
119
+ * Provides an optional data with V8's code cache data for the supplied source.
120
+ */
121
+ cachedData?: ScriptOptions["cachedData"] | undefined;
116
122
  importModuleDynamically?: ScriptOptions["importModuleDynamically"];
117
123
  }
118
124
  interface CompileFunctionOptions extends BaseOptions {
119
125
  /**
120
126
  * Provides an optional data with V8's code cache data for the supplied source.
121
127
  */
122
- cachedData?: Buffer | undefined;
128
+ cachedData?: ScriptOptions["cachedData"] | undefined;
123
129
  /**
124
130
  * Specifies whether to produce new cache data.
125
131
  * Default: `false`,
@@ -612,6 +618,9 @@ declare module "vm" {
612
618
  * @default 'vm:module(i)' where i is a context-specific ascending index.
613
619
  */
614
620
  identifier?: string | undefined;
621
+ /**
622
+ * Provides an optional data with V8's code cache data for the supplied source.
623
+ */
615
624
  cachedData?: ScriptOptions["cachedData"] | undefined;
616
625
  context?: Context | undefined;
617
626
  lineOffset?: BaseOptions["lineOffset"] | undefined;