import type { ChunkId, DocumentId, KnowledgeCapsuleId, KnowledgeSourceId } from "@oscharko-dev/keiko-contracts";
import type { DatabaseSync } from "node:sqlite";
export interface ChunkInsertRow {
    readonly id: ChunkId;
    readonly capsuleId: KnowledgeCapsuleId;
    readonly sourceId: KnowledgeSourceId;
    readonly documentId: DocumentId;
    readonly parsedUnitId: string;
    readonly orderIndex: number;
    readonly tokenCount: number;
    readonly safeExcerptHash: string;
    readonly chunkingStrategyVersion: string;
}
export declare function insertChunkRow(db: DatabaseSync, row: ChunkInsertRow): void;
export declare function deleteChunksForDocument(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId): void;
export declare function countChunksForDocument(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId): number;
export declare function hasStaleChunksForDocument(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId): boolean;
export declare function selectDocumentSourceId(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId): KnowledgeSourceId | undefined;
export interface ParsedUnitRow {
    readonly id: string;
    readonly kind: string;
    readonly page_number: number | null;
    readonly page_label: string | null;
    readonly section_path_json: string | null;
    readonly json_pointer: string | null;
    readonly table_name: string | null;
    readonly row_index: number | null;
    readonly heading_path_json: string | null;
    readonly unsupported_reason: string | null;
    readonly character_start: number | null;
    readonly character_end: number | null;
}
export declare function selectParsedUnitsForDocument(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId): readonly ParsedUnitRow[];
//# sourceMappingURL=chunker-persist.d.ts.map