0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-22 07:37:56 +01:00
nodejs/typings/internalBinding/fs_dir.d.ts
Yagiz Nizipli 307430e490
fs: improve error performance of fs.dir
PR-URL: https://github.com/nodejs/node/pull/53667
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-07-09 14:38:01 +00:00

24 lines
838 B
TypeScript

import {InternalFSBinding, ReadFileContext} from './fs';
declare namespace InternalFSDirBinding {
import FSReqCallback = InternalFSBinding.FSReqCallback;
type Buffer = Uint8Array;
type StringOrBuffer = string | Buffer;
class DirHandle {
read(encoding: string, bufferSize: number, callback: FSReqCallback): string[] | undefined;
read(encoding: string, bufferSize: number): string[] | undefined;
close(callback: FSReqCallback): void;
close(): void;
}
function opendir(path: StringOrBuffer, encoding: string, req: FSReqCallback): DirHandle;
function opendir(path: StringOrBuffer, encoding: string): DirHandle;
function opendirSync(path: StringOrBuffer): DirHandle;
}
export interface FsDirBinding {
opendir: typeof InternalFSDirBinding.opendir;
opendirSync: typeof InternalFSDirBinding.opendirSync;
}