import type { LanguageId } from '../../types';
export interface WalkOpts {
    /** Restrict to specific extensions (e.g. `['.ts', '.tsx']`). Default:
     *  union across every registered language pack. */
    extensions?: string[];
    /** Include test files? Default: false. Test files are matched by
     *  `allTestFilePatterns()` — basename globs (`*.test.ts`) and
     *  path-anchored patterns (`tests/*.rs`). */
    includeTests?: boolean;
    /** Include auto-generated files (basename glob + 2KB header marker)?
     *  Default: false. Matches the post-D028 canonical "counted source
     *  file" predicate. */
    includeAutogen?: boolean;
    /** Apply `.gitignore` + `.dxkit-ignore` + bundled defaults? Default:
     *  true. Set false only for paths that genuinely need a raw FS view. */
    respectIgnore?: boolean;
    /** Restrict to one language pack's `sourceExtensions`. Default: all. */
    packId?: LanguageId;
}
export declare function clearWalkCache(): void;
/**
 * Walk the source tree rooted at `cwd` and return relative POSIX paths
 * (no leading `./`) sorted for determinism. Returns `[]` for non-
 * existent or non-directory roots — never throws.
 */
export declare function walkSourceFiles(cwd: string, opts?: WalkOpts): string[];
/**
 * Count directories under `cwd`, mirroring `find . -type d ${getFindExcludeFlags(cwd)}`:
 * the root counts as 1, plus every descendant directory not pruned by
 * the centralized exclusion set (`isExcludedPath`). Cross-platform,
 * pure-Node replacement for the POSIX `find -type d` shell-out — which
 * returned 0 on Windows (no `find`), zeroing the directory-count metric.
 */
export declare function countDirectories(cwd: string): number;
export interface CountOpts {
    /** 'files' = count of files with ≥1 match. 'lines' = total match
     *  count across all lines. Default: 'lines'. */
    mode?: 'files' | 'lines';
    /** Skip lines whose match falls on a comment line. Default: false.
     *  D074 closure — pre-fix, line-counters matched a commented-out
     *  occurrence of a target call the same as a live one and inflated
     *  counts 2x+ on commented-code-heavy codebases (platform: 1578
     *  reported / 733 active for the JS print-statement family).
     *
     *  Per-file comment marker chosen by extension:
     *    .ts/.tsx/.js/.jsx/.go/.rs/.java/.kt/.kts/.cs/.cpp/.c/.h/.hpp/.swift  -> slash-style
     *    .py/.rb/.sh/.yml/.yaml/.toml                                          -> hash-style
     *  Files with no known mapping are scanned as-is (no comment filter). */
    skipComments?: boolean;
    /** Return top-N (by match count) offender list. Default: 0 (skip). */
    perFileTopN?: number;
}
export interface CountResult {
    /** Sum of matches across all walked files. */
    lines: number;
    /** Count of files with ≥1 match. */
    files: number;
    /** Top-N offenders. Empty unless `perFileTopN > 0`. */
    perFile: Array<{
        file: string;
        count: number;
    }>;
}
/**
 * Read each file once, scan in-process. Pass `patterns` as compiled
 * regexes for repeated use, or as strings (compiled here with global
 * flag). Each line is tested against the alternation; multiple
 * patterns are unioned via `RegExp` `|` — pass them pre-merged for
 * best performance.
 */
export declare function countLineMatches(cwd: string, files: string[], patterns: RegExp[] | string[], opts?: CountOpts): CountResult;
export type CommentSyntax = 'slash' | 'hash' | 'none';
export declare function commentSyntaxFor(relPath: string): CommentSyntax;
export declare function isCommentLine(rawLine: string, syntax: CommentSyntax): boolean;
/** Surface the pack-aware `sourceExtensions` for a given packId. Used
 *  when callers want to walk one pack's files but bypass the registry. */
export declare function packSourceExtensions(packId: LanguageId): string[];
//# sourceMappingURL=walk-source-files.d.ts.map