import type { CodebaseIndex } from './types.js';
import { type BuildCodebaseOptions } from './build.js';
import type { CodebaseIndexSlim } from './slim.js';
import { type Yielder } from '../utils.js';
import type { OnProgress } from '../progress-event.js';
export interface CodeChunk {
    filePath: string;
    relativePath: string;
    language: string;
    chunkIndex: number;
    title: string;
    content: string;
    symbolNames: string[];
    symbolTypes: string[];
    startLine: number;
    endLine: number;
    hasExports: boolean;
}
export interface CodeChunkOptions {
    maxChunkWords?: number;
    overlapWords?: number;
    maxTokens?: number;
    overlapTokens?: number;
    countTokens?: (text: string) => number;
    /**
     * Restrict chunking to these files. Entries may be repo-relative or absolute
     * paths; each is normalized to `ParsedFile.relativePath` form (forward
     * slashes, no leading `./`). Unknown or missing paths are silently ignored
     * (e.g. files deleted since the index was built). Chunk indexes are per-file,
     * so chunk IDs for retained files are identical to an unscoped run —
     * consumers can dedupe by `(relativePath, chunkIndex)`. `[]` chunks nothing;
     * `undefined` chunks every file (unchanged behavior).
     */
    files?: string[];
}
export interface CodeChunkStreamingOptions {
    signal?: AbortSignal;
    yielder?: Yielder;
    readFile?: (filePath: string) => Promise<string>;
}
type ChunkableIndex = CodebaseIndex | CodebaseIndexSlim;
/** Chunk files from an already-built CodebaseIndex (avoids double-parsing) */
export declare function chunkFromIndex(index: CodebaseIndex, options?: CodeChunkOptions): CodeChunk[];
export declare function chunkFromIndexCooperative(index: CodebaseIndex, options: CodeChunkOptions | undefined, yielder: Yielder): Promise<CodeChunk[]>;
export declare function chunkFromIndexStreaming(index: ChunkableIndex, options?: CodeChunkOptions, streaming?: CodeChunkStreamingOptions): Promise<CodeChunk[]>;
/** Discover, parse, and chunk an entire codebase */
export declare function chunkCodebase(options: BuildCodebaseOptions & CodeChunkOptions, onProgress?: OnProgress): Promise<CodeChunk[]>;
export {};
