Skip to content

Commit af2294a

Browse files
1 parent 5da81d8 commit af2294a

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

types/node/v18/fs.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ declare module 'fs' {
220220
* @since v10.10.0
221221
*/
222222
name: string;
223+
/**
224+
* The base path that this `fs.Dirent` object refers to.
225+
* @since v18.17.0
226+
*/
227+
path: string;
223228
}
224229
/**
225230
* A class representing a directory stream.

types/node/v18/test/fs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ async function testPromisify() {
434434
{
435435
fs.opendir('test', async (err, dir) => {
436436
const dirEnt: fs.Dirent | null = await dir.read();
437+
dirEnt?.path; // $ExpectType string | undefined
437438
});
438439

439440
fs.opendir(Buffer.from('test'), async (err, dir) => {

types/node/v18/ts4.8/fs.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ declare module 'fs' {
220220
* @since v10.10.0
221221
*/
222222
name: string;
223+
/**
224+
* The base path that this `fs.Dirent` object refers to.
225+
* @since v18.17.0
226+
*/
227+
path: string;
223228
}
224229
/**
225230
* A class representing a directory stream.

types/node/v18/ts4.8/test/fs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ async function testPromisify() {
434434
{
435435
fs.opendir('test', async (err, dir) => {
436436
const dirEnt: fs.Dirent | null = await dir.read();
437+
dirEnt?.path; // $ExpectType string | undefined
437438
});
438439

439440
fs.opendir(Buffer.from('test'), async (err, dir) => {

0 commit comments

Comments
 (0)