PR-URL: https://github.com/nodejs/node/pull/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>
21 lines
803 B
TypeScript
21 lines
803 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, _: unknown, ctx: ReadFileContext): string[] | undefined;
|
|
close(_: unknown, ctx: ReadFileContext): void;
|
|
}
|
|
|
|
function opendir(path: StringOrBuffer, encoding: string, req: FSReqCallback): DirHandle;
|
|
function opendir(path: StringOrBuffer, encoding: string, _: undefined, ctx: ReadFileContext): DirHandle;
|
|
function opendirSync(path: StringOrBuffer): DirHandle;
|
|
}
|
|
|
|
export interface FsDirBinding {
|
|
opendir: typeof InternalFSDirBinding.opendir;
|
|
opendirSync: typeof InternalFSDirBinding.opendirSync;
|
|
}
|