import ignore from "ignore"; import type Sync from "./lib/sync"; export declare const IGNORER_VERSION = 1; export declare class Ignorer { private sync; instance: ignore.Ignore; name: string; private readonly mutex; private lastAppliedContent; constructor(sync: Sync, name?: string); fetch(): Promise; write(content: string): Promise; clearFile(): Promise; initialize(passedContent?: string): Promise; /** * Rebuild the matcher from `rawContent` and reset the filesystem ignoredCaches so the next scan * re-evaluates against the new rules. Records the content as the baseline for the unchanged-skip above. */ private applyContent; update(content?: string): Promise; clear(): void; ignores(path: string): boolean; /** * FastGlob `ignore` globs that PRUNE provably-ignored subtrees from the local directory scan, so the * walk never descends into / stats / even enumerates a `.filenignore`'d directory (e.g. `node_modules`). * * SAFETY — every returned glob matches ONLY paths this matcher actually ignores, so FastGlob can never * drop a path the matcher would keep: * - Each candidate is PROBED against the live matcher ({@link ignores}), which already incorporates every * `!negation`. A pattern re-included by a negation fails its probe and is never pruned — so we don't * need to reason about negations structurally, only consult the matcher's actual verdict. * - gitignore forbids re-including a file once its parent directory is excluded (verified against the * `ignore` package), so an ignored DIRECTORY's whole subtree is ignored: pruning it cannot hide a * re-included descendant. * - Only plain (glob-free, non-negated) path patterns become candidates; glob/negation lines are left to * the per-entry post-filter. The directory ENTRY itself is only pruned when BOTH its file and directory * forms are ignored (so a dir-only `build/` rule never prunes a file named `build`). * * The returned set is therefore a strict SUBSET of `.filenignore`'s ignored set, which the delta-level * ignore filter (`deltas.ts`) independently drops deltas for — so a pruned path can never be mis-synced or * mis-deleted. Derives from `.filenignore` ONLY, never the nameLength/pathLength/invalidPath/defaultIgnore/ * dotFile reasons (those have no delta-filter backstop and must keep flowing through `ignoredLocalPaths`). * * @public * @returns {string[]} */ globIgnorePatternsForTraversal(): string[]; } export default Ignorer;