/** * File descriptor budget checking utility. * * Estimates the number of filesystem entries the watcher will track and * warns if the OS soft limit is too low. * * With @parcel/watcher + FSEvents (macOS), only ~1 FD per watched * directory tree is needed. On Linux (inotify) and other platforms the * per-entry cost is higher, so this budget check remains valuable there. */ export interface FdBudgetResult { /** OS soft limit for open files */ limit: number; /** Estimated number of watch entries (files + directories) */ estimated: number; /** Whether estimated entries are within 70% of the FD limit */ safe: boolean; } /** * Get the OS soft limit for open file descriptors. * * Tries `process.getrlimit('nofile')` (Node 21.7+) first, then falls * back to parsing `ulimit -n`. */ export declare function getFdLimit(): number; /** * Count files and directories under `rootPaths`, respecting ignore patterns * and a depth limit. The count is a rough estimate of watched entries, * primarily relevant on Linux/inotify where each watched directory costs * one FD. */ export declare function estimateWatchEntries(rootPaths: string[], maxDepth: number, ignorePatterns: string[]): number; /** * Check whether the OS has enough file descriptor headroom for the * estimated number of watch entries. * * Returns `{ safe: false }` when estimated entries exceed 70% of the * FD soft limit. */ export declare function checkFdBudget(watchPaths: string[], maxDepth: number, ignorePatterns: string[]): FdBudgetResult; //# sourceMappingURL=fd-safety.d.ts.map