import Event from "../Event.js"; import File from "./File.js"; import FileClass from "../FileClass.js"; import Result from "./Result.js"; interface FinderEvents { onError: (error: Error) => void; onHidden: (info: File, finder: Finder) => void; onFinish: (result: Result, totals: TotalInterface, finder: Finder) => void; } interface DefaultSettingsInterface { recurse?: boolean; depth?: number; seeHidden?: boolean; match?: RegExp | string | null; exclude?: string | RegExp | null; excludeFile?: string | RegExp | null; excludeDir?: string | RegExp | null; followSymLink?: boolean; matchFile?: string; matchDir?: string; } interface TotalInterface { Directory: number; File: number; BlockDevice: number; CharacterDevice: number; symbolicLink: number; Fifo: number; Socket: number; hidden: number; [key: string]: number; } declare class Finder extends Event { settings: DefaultSettingsInterface; totals: TotalInterface; constructor(settings?: DefaultSettingsInterface); clean(): void; checkPath(Path: string | FileClass | string[]): Result; /** * Variante **async** de {@link checkPath} — résout la (les) racine(s) via * `File.from()` (pas de `lstatSync`). Utilisée par `in()` pour ne pas bloquer * l'event-loop dès la résolution du point d'entrée. * * @param Path - string, array de strings, ou FileClass. * @returns `Result` contenant les `File` racines hydratés. */ checkPathAsync(Path: string | FileClass | string[]): Promise; in(Path: string | FileClass | string[], settings?: {}): Promise; } export default Finder; export type { TotalInterface, FinderEvents };