export interface TextBlock {
    text: string;
    paragraphs: string[];
    headingLine: string | null;
}
export interface ChunkedSection {
    title: string;
    chunks: Array<{
        id: number;
        preview: string;
        content: string;
    }>;
}
export type EmbedFn = (texts: string[]) => Promise<number[][]>;
export declare function splitIntoParagraphs(text: string): string[];
export declare function aggregateBlocks(paragraphs: string[], minBytes?: number): TextBlock[];
export declare function cosine(a: number[], b: number[]): number;
/**
 * Compute cosine similarity between each consecutive pair of embeddings.
 * Returns array of length (embeddings.length - 1).
 */
export declare function similarityCurve(embeddings: number[][]): number[];
/**
 * Compute valley depth at each position in the similarity curve.
 *
 * depth(i) = (left_peak - curve[i]) + (right_peak - curve[i])
 * where left_peak and right_peak are the nearest local maxima on each side.
 *
 * Deep valleys indicate strong topic transitions.
 */
export declare function valleyDepths(curve: number[]): number[];
/**
 * Select the top N deepest valleys, sorted by position.
 * Skips positions with zero depth (no valley).
 */
export declare function selectBoundaries(depths: number[], n: number): number[];
/**
 * Snap valley-based boundaries to nearby markdown headings.
 * Boundary values represent the first block index of the new section.
 */
export declare function snapToHeadings(boundaries: number[], blocks: TextBlock[], window?: number): number[];
/**
 * Semantic document chunking using embedding-based topic boundary detection.
 *
 * Replaces heading-regex chunking. Works on plain text, PDF output, and
 * markdown. Headings are used as tiebreakers for boundary placement, not
 * as the primary segmentation signal.
 *
 * @param text - Document text to chunk
 * @param embedFn - Batch embedding function (injected for testability)
 * @returns ChunkedSection[] — same shape as the previous heading-regex chunker
 */
export declare function chunkText(text: string, embedFn: EmbedFn): Promise<ChunkedSection[]>;
/**
 * Build ChunkedSection[] from blocks and section boundary positions.
 * Each boundary is a block index where a new section starts.
 * Within each section, paragraphs are grouped into chunks respecting
 * MIN_CHUNK_SIZE (200) and MAX_CHUNK_SIZE (2000) byte constraints.
 */
export declare function buildSections(blocks: TextBlock[], boundaries: number[]): ChunkedSection[];
//# sourceMappingURL=semantic-chunker.d.ts.map