@types/node 18.19.98 → 18.19.99

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 03:33:47 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.99",
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": "f11c3a08cb4992fd40b3bee9ba04f2354ee7ce1da17ed0476b4b0dde46174967",
224
224
  "typeScriptVersion": "5.1"
225
225
  }