/// import type { FSWatcher, BigIntStats } from 'node:fs'; import type { FSTargetEvent, TargetEvent } from './enums.js'; import type WatcherStats from './watcher_stats.js'; type ResultDirectory = { directories: string[]; directoriesNames: Set; directoriesNamesToPaths: Record; files: string[]; filesNames: Set; filesNamesToPaths: Record; symlinks: string[]; symlinksNames: Set; symlinksNamesToPaths: Record; }; type ResultDirectories = { [path: string]: ResultDirectory; }; type Callback = () => void; type Disposer = () => void; type Event = [TargetEvent, Path, Path?]; type FSHandler = (event?: FSTargetEvent, targetName?: string) => void; type Handler = (event: TargetEvent, targetPath: Path, targetPathNext?: Path) => void; type HandlerBatched = (event?: FSTargetEvent, targetPath?: Path, isInitial?: boolean) => Promise; type Ignore = ((targetPath: Path) => boolean) | RegExp; type INO = bigint | number; type Path = string; type ReaddirMap = ResultDirectories; type Stats = BigIntStats; type LocksAdd = Map void>; type LocksUnlink = Map Path>; type LocksPair = { add: LocksAdd; unlink: LocksUnlink; }; type LockConfig = { ino?: INO; targetPath: Path; locks: LocksPair; events: { add: TargetEvent.ADD | TargetEvent.ADD_DIR; change?: TargetEvent.CHANGE; rename: TargetEvent.RENAME | TargetEvent.RENAME_DIR; unlink: TargetEvent.UNLINK | TargetEvent.UNLINK_DIR; }; }; type PollerConfig = { options: WatcherOptions; targetPath: Path; }; type SubwatcherConfig = { options: WatcherOptions; targetPath: Path; }; type WatcherConfig = { handler: Handler; watcher: FSWatcher; options: WatcherOptions; folderPath: Path; filePath?: Path; }; type WatcherOptions = { debounce?: number; depth?: number; limit?: number; ignore?: Ignore; ignoreInitial?: boolean; native?: boolean; persistent?: boolean; pollingInterval?: number; pollingTimeout?: number; readdirMap?: ReaddirMap; recursive?: boolean; renameDetection?: boolean; renameTimeout?: number; }; export type { Callback, Disposer, Event, FSHandler, FSWatcher, Handler, HandlerBatched, Ignore, INO, Path, ReaddirMap, Stats, LocksAdd, LocksUnlink, LocksPair, LockConfig, PollerConfig, SubwatcherConfig, WatcherConfig, WatcherOptions, WatcherStats };