typings: add `fs_dir` types · nodejs/node@0e25fae · GitHub
Skip to content

Commit 0e25fae

Browse files
anonrigaduh95
authored andcommitted
typings: add fs_dir types
PR-URL: #53631 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent bac2867 commit 0e25fae

3 files changed

Lines changed: 36 additions & 13 deletions

File tree

typings/globals.d.ts

Lines changed: 2 additions & 0 deletions

typings/internalBinding/fs.d.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import { ConstantsBinding } from './constants';
22

3+
interface ReadFileContext {
4+
fd: number | undefined;
5+
isUserFd: boolean | undefined;
6+
size: number;
7+
callback: (err?: Error, data?: string | Uint8Array) => unknown;
8+
buffers: Uint8Array[];
9+
buffer: Uint8Array;
10+
pos: number;
11+
encoding: string;
12+
err: Error | null;
13+
signal: unknown /* AbortSignal | undefined */;
14+
}
15+
316
declare namespace InternalFSBinding {
417
class FSReqCallback<ResultType = unknown> {
518
constructor(bigint?: boolean);
619
oncomplete: ((error: Error) => void) | ((error: null, result: ResultType) => void);
720
context: ReadFileContext;
821
}
922

10-
interface ReadFileContext {
11-
fd: number | undefined;
12-
isUserFd: boolean | undefined;
13-
size: number;
14-
callback: (err?: Error, data?: string | Buffer) => unknown;
15-
buffers: Buffer[];
16-
buffer: Buffer;
17-
pos: number;
18-
encoding: string;
19-
err: Error | null;
20-
signal: unknown /* AbortSignal | undefined */;
21-
}
22-
2323
interface FSSyncContext {
2424
fd?: number;
2525
path?: string;
Lines changed: 21 additions & 0 deletions

0 commit comments

Comments
 (0)