2024-07-30 05:19:58 +08:00
|
|
|
import { InternalFSBinding } from './fs';
|
2024-07-01 00:39:06 +08:00
|
|
|
|
|
|
|
declare namespace InternalFSDirBinding {
|
|
|
|
import FSReqCallback = InternalFSBinding.FSReqCallback;
|
|
|
|
type Buffer = Uint8Array;
|
|
|
|
type StringOrBuffer = string | Buffer;
|
|
|
|
|
|
|
|
class DirHandle {
|
2024-07-09 22:38:01 +08:00
|
|
|
read(encoding: string, bufferSize: number, callback: FSReqCallback): string[] | undefined;
|
|
|
|
read(encoding: string, bufferSize: number): string[] | undefined;
|
|
|
|
close(callback: FSReqCallback): void;
|
|
|
|
close(): void;
|
2024-07-01 00:39:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function opendir(path: StringOrBuffer, encoding: string, req: FSReqCallback): DirHandle;
|
2024-07-09 22:38:01 +08:00
|
|
|
function opendir(path: StringOrBuffer, encoding: string): DirHandle;
|
2024-07-01 00:39:06 +08:00
|
|
|
function opendirSync(path: StringOrBuffer): DirHandle;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FsDirBinding {
|
|
|
|
opendir: typeof InternalFSDirBinding.opendir;
|
|
|
|
opendirSync: typeof InternalFSDirBinding.opendirSync;
|
|
|
|
}
|