import { type Ignore } from 'ignore';
/**
 * Load every `.gitignore` reachable from `workspaceRoot` AND the
 * workspace-root `.rothunterignore` (gitignore-syntax extension, only
 * for rothunter). Returns a unified matcher.
 *
 * The matcher answers "is this workspace-relative path ignored?" — used
 * by the parser + by any detector that walks the filesystem on its own.
 *
 * Rules:
 *   - Top-level `.gitignore` always loads (when present).
 *   - Nested `.gitignore`s load too, prefixed with their relative dir so
 *     a pattern like `dist/` inside `packages/foo/.gitignore` matches
 *     `packages/foo/dist/...` and not the root `dist/`.
 *   - `.rothunterignore` at the workspace root loads with the same
 *     syntax — use this for files that ARE in git but should be hidden
 *     from rothunter (fixtures, vendored SDKs, generated test data).
 *   - `node_modules/` and `.git/` are always ignored regardless of
 *     what the operator's files say — the cost of scanning them is
 *     prohibitive on every repo and never produces useful findings.
 *
 * Always returns a non-null matcher; the always-on rules (`node_modules`
 * + `.git`) ensure callers get sensible defaults even when no ignore
 * file exists.
 */
export declare function loadGitignore(workspaceRoot: string): Ignore;
/**
 * Filter a workspace-relative path list through the gitignore matcher,
 * preserving order.
 */
export declare function filterGitignored(matcher: Ignore, files: ReadonlyArray<string>): string[];
/**
 * Walk the workspace and return every workspace-relative file whose
 * extension matches one of `extensions` AND whose path is not ignored
 * by the gitignore matcher. Used as a pre-load pass before ts-morph
 * `addSourceFilesAtPaths` — ts-morph's own glob match would load
 * every file before any filter runs, OOM'ing on a host repo that
 * carries a populated `node_modules/`.
 *
 * `extensions` MUST start with a dot (`.ts`, `.tsx`, …).
 *
 * The walk skips ignored directories without descending into them
 * (~10x less syscalls vs. walk-and-filter on a 50 k file monorepo).
 */
export declare function enumerateSourceFiles(workspaceRoot: string, matcher: Ignore, extensions: ReadonlyArray<string>): string[];
//# sourceMappingURL=gitignore.d.ts.map