UNPKG

705 BTypeScriptView Raw
1import type * as fsStat from '@nodelib/fs.stat';
2import type { Dirent, ErrnoException } from '../types';
3export type ReaddirAsynchronousMethod = (filepath: string, options: {
4 withFileTypes: true;
5}, callback: (error: ErrnoException | null, files: Dirent[]) => void) => void;
6export type ReaddirSynchronousMethod = (filepath: string, options: {
7 withFileTypes: true;
8}) => Dirent[];
9export type FileSystemAdapter = fsStat.FileSystemAdapter & {
10 readdir: ReaddirAsynchronousMethod;
11 readdirSync: ReaddirSynchronousMethod;
12};
13export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
14export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;