import type { DocumentId, KnowledgeCapsuleId, KnowledgeSourceId, PageRecord, ParsedUnit, ParserDiagnostic, SectionRecord } from "@oscharko-dev/keiko-contracts";
import type { DatabaseSync } from "node:sqlite";
export interface DocumentInsertRow {
    readonly id: DocumentId;
    readonly capsuleId: KnowledgeCapsuleId;
    readonly sourceId: string;
    readonly documentPath: string;
    readonly sizeBytes: number;
    readonly mediaType: string;
    readonly contentHash: string;
    readonly parserId: string;
    readonly parserVersion: string;
    readonly lastExtractedAt: number;
    readonly status: string;
    readonly safeDisplayName: string;
}
export declare function insertDocumentRow(db: DatabaseSync, row: DocumentInsertRow): void;
export declare function deleteDependentRows(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId): void;
export declare function insertDocumentTextRow(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId, normalizedText: string): void;
export declare function readDocumentTextRow(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId): string | undefined;
export interface PersistedSourceDocumentRow {
    readonly id: DocumentId;
    readonly document_path: string;
}
export declare function listPersistedDocumentsForSource(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, sourceId: KnowledgeSourceId): readonly PersistedSourceDocumentRow[];
export declare function deleteDocumentRow(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId): void;
export declare function updateDocumentStatusRow(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId, status: DocumentInsertRow["status"]): void;
export declare function insertPageRow(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, page: PageRecord): void;
export declare function insertSectionRow(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, section: SectionRecord): void;
export declare function insertParsedUnitRow(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, unitId: string, unit: ParsedUnit): void;
export declare function insertDiagnosticRow(db: DatabaseSync, params: {
    readonly id: string;
    readonly capsuleId: KnowledgeCapsuleId;
    readonly diagnostic: ParserDiagnostic;
    readonly createdAt: number;
}): void;
interface ExistingDocumentRow {
    readonly content_hash: string;
    readonly status: string;
    readonly size_bytes: number;
    readonly media_type: string;
    readonly parser_id: string;
    readonly parser_version: string;
    readonly last_extracted_at: number;
    readonly safe_display_name: string;
    readonly document_path: string;
    readonly source_id: string;
}
export declare function readExistingDocumentRow(db: DatabaseSync, capsuleId: KnowledgeCapsuleId, documentId: DocumentId): ExistingDocumentRow | undefined;
export {};
//# sourceMappingURL=persist.d.ts.map