import { WriteFileOptions } from 'fs';

type ReadFileOptions = null | BufferEncoding | {
    encoding?: null | undefined;
    flag?: string | undefined;
} | {
    encoding: BufferEncoding;
    flag?: string | undefined;
};
type ReadFileSync = (options?: ReadFileOptions) => string | Buffer;
type WriteFileSync = (data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions) => void;
type AppendFileSync = (data: string | Uint8Array, options?: WriteFileOptions) => void;
type EntryBase = {
    type: "directory" | "file" | string;
    name: string;
    level: number;
    absolute: string;
    relative: string;
    children: EntryBase[];
};
type EntryFS = EntryBase & {
    readFileSync: ReadFileSync;
    writeFileSync: WriteFileSync;
    appendFileSync: AppendFileSync;
};
type SorterEntry = (a: EntryBase, b: EntryBase) => number;
type FilterEntry = (entry: EntryBase) => boolean;
type Options = {
    cwd?: string;
    deep?: number;
    filterEntry?: FilterEntry | FilterEntry[];
    withDirectory?: boolean;
    sorter?: SorterEntry;
    relativePrefix?: string;
    useSlash?: boolean;
    asTree?: boolean;
};

export { EntryFS as E, FilterEntry as F, Options as O, SorterEntry as S, EntryBase as a };
