export type OutputFormat = 'count_only' | 'files_only' | 'locations' | 'matches' | 'context' | 'with_stats' | 'with_preview' | 'signatures' | 'full';
export type SymbolKind = 'function' | 'class' | 'interface' | 'type' | 'variable' | 'constant' | 'enum';
export interface QueryBase {
    id: string;
    mode: 'files' | 'content' | 'symbols' | 'references' | 'structural';
    path?: string | undefined;
}
export interface FilesQuery extends QueryBase {
    mode: 'files';
    patterns?: string[] | undefined;
    exclude?: string[] | undefined;
    min_size?: number | undefined;
    max_size?: number | undefined;
    modified_after?: string | undefined;
    modified_before?: string | undefined;
    respect_gitignore?: boolean | undefined;
    sort_by?: 'name' | 'size' | 'modified' | undefined;
    sort_order?: 'asc' | 'desc' | undefined;
    has_content?: string | undefined;
    is_empty?: boolean | undefined;
    follow_symlinks?: boolean | undefined;
    include_hidden?: boolean | undefined;
}
export interface ContentQuery extends QueryBase {
    mode: 'content';
    pattern?: string | undefined;
    pattern_base64?: string | undefined;
    glob?: string | undefined;
    case_sensitive?: boolean | undefined;
    whole_word?: boolean | undefined;
    multiline?: boolean | undefined;
    negate?: boolean | undefined;
    ranked?: boolean | undefined;
    preview_replace?: string | undefined;
    relationships?: boolean | undefined;
}
export interface SymbolsQuery extends QueryBase {
    mode: 'symbols';
    query?: string | undefined;
    kinds?: SymbolKind[] | undefined;
    exported_only?: boolean | undefined;
    include_private?: boolean | undefined;
    group_by?: 'file' | 'kind' | 'none' | undefined;
}
export interface ReferencesQuery extends QueryBase {
    mode: 'references';
    symbol: string;
    file: string;
    line: number;
    column: number;
}
export interface StructuralQuery extends QueryBase {
    mode: 'structural';
    pattern: string;
    lang?: 'ts' | 'tsx' | 'js' | 'jsx' | 'css' | 'html' | undefined;
    glob?: string | undefined;
}
export type FindQuery = FilesQuery | ContentQuery | SymbolsQuery | ReferencesQuery | StructuralQuery;
export interface OutputOptions {
    format?: OutputFormat | undefined;
    context_before?: number | undefined;
    context_after?: number | undefined;
    expand_to?: 'line' | 'block' | 'function' | 'class' | undefined;
    max_results?: number | undefined;
    max_per_item?: number | undefined;
    max_total_matches?: number | undefined;
    max_tokens?: number | undefined;
    preview_lines?: number | undefined;
    max_line_length?: number | undefined;
}
export interface FindInput {
    queries: FindQuery[];
    output?: OutputOptions | undefined;
    parallel?: boolean | undefined;
}
type CountResult = {
    count: number;
    file_count?: number;
    source?: string;
};
type FilesResult = {
    files: string[];
    count: number;
    source?: string;
};
type LocationsResult<TLocation> = {
    locations: TLocation[];
    count: number;
    source?: string;
};
interface CacheKey {
    pattern: string;
    glob: string;
    path: string;
    flags: string;
}
interface CacheValue {
    files: string[];
    matchedFiles: Map<string, {
        content: string;
        matches: ContentMatch[];
    }>;
    totalMatches: number;
    fileMtimes: Map<string, number>;
}
export interface FindDiagnostics {
    warnings: string[];
}
export interface ContentMatch {
    file: string;
    line: number;
    text: string;
    startLine?: number | undefined;
    endLine?: number | undefined;
    context_before?: string[] | undefined;
    context_after?: string[] | undefined;
}
export declare function createFindDiagnostics(): FindDiagnostics;
export declare function addFindWarning(diagnostics: FindDiagnostics | undefined, warning: string): void;
export declare function withFindWarnings<T extends Record<string, unknown>>(result: T, warnings: readonly string[]): T;
export declare function makeCountResult(count: number, source?: string, fileCount?: number): CountResult;
export declare function makeFilesResult(files: string[], count: number, source?: string): FilesResult;
export declare function makeLocationsResult<TLocation>(locations: TLocation[], count: number, source?: string): LocationsResult<TLocation>;
export declare const VALID_SYMBOL_KINDS: Set<string>;
export declare function isHiddenOrSkippedSegment(segment: string, includeHidden: boolean): boolean;
export declare function shouldSkipRelativePath(relativePath: string, includeHidden: boolean): boolean;
export declare function isBinary(filePath: string, diagnostics?: FindDiagnostics): Promise<boolean>;
export declare function collectTextFiles(dirPath: string, diagnostics?: FindDiagnostics): Promise<string[]>;
export declare function readTextFile(filePath: string, diagnostics?: FindDiagnostics): Promise<string | null>;
export declare function collectGlobFiles(basePath: string, patterns: string[], includeHidden: boolean, followSymlinks: boolean, diagnostics?: FindDiagnostics): Promise<Set<string>>;
export declare function matchesGlob(glob: InstanceType<typeof Bun.Glob>, filePath: string, basePath: string): boolean;
export declare function toSymbolKind(kind: string | undefined): SymbolKind;
export declare function matchesSymbolQuery(name: string, queryRegex: RegExp | null): boolean;
export declare function loadFileLines(filePath: string): Promise<string[]>;
export declare function groupByKey<T extends {
    file: string;
    kind: string;
}>(items: T[], groupBy: 'file' | 'kind' | 'none'): Record<string, T[]> | null;
export declare function validateSearchPath(path: string | undefined, projectRoot: string): string | {
    error: string;
};
export declare function buildGitignoreMatcher(gitignorePath: string, diagnostics?: FindDiagnostics): ((rel: string) => boolean) | null;
export declare function findNestedGitignoreFiles(basePath: string, rootGitignorePath: string): string[];
export declare function collectFilesForSearch(basePath: string, queryGlob: string | undefined, diagnostics?: FindDiagnostics): Promise<string[]>;
export interface ImportGraphLike {
    findImports(file: string): string[];
    findDependents(file: string): string[];
    getWarnings?(): string[];
}
export declare class FindRuntimeService {
    private readonly searchCache;
    private importGraph;
    private importGraphBuiltAt;
    searchCacheGet(key: CacheKey): CacheValue | null;
    searchCacheSet(key: CacheKey, value: CacheValue): void;
    searchCacheIsValid(cached: CacheValue): Promise<boolean>;
    getImportGraph(projectRoot: string): Promise<ImportGraphLike>;
}
export {};
//# sourceMappingURL=shared.d.ts.map