import type { Database } from "bun:sqlite";
import { TODOS_LOCAL_BRIDGE_KIND, TODOS_LOCAL_BRIDGE_SCHEMA_VERSION, validateLocalBridgeBundle, type ImportLocalBridgeOptions, type LocalBridgeImportResult, type TodosLocalBridgeBundle, type TodosLocalBridgeData, type TodosLocalBridgePackageSource, type TodosLocalBridgeSource } from "./local-bridge.js";
export declare const TODOS_LOCAL_BACKUP_KIND = "hasna.todos.local-backup";
export declare const TODOS_LOCAL_BACKUP_SCHEMA_VERSION = 1;
export declare const TODOS_LOCAL_INTEGRITY_KIND = "hasna.todos.local-integrity";
export declare const TODOS_LOCAL_INTEGRITY_SCHEMA_VERSION = 1;
export declare const LOCAL_BACKUP_CHECKSUM_ALGORITHM = "sha256";
export interface CreateLocalBackupOptions {
    project_id?: string;
    generated_at?: string;
    version?: string;
    output_path?: string;
}
export interface LocalBackupSqliteIntegrity {
    quick_check: string;
    foreign_key_violations: number;
    ok: boolean;
}
export interface LocalBackupManifest {
    schema_version: typeof TODOS_LOCAL_BACKUP_SCHEMA_VERSION;
    kind: typeof TODOS_LOCAL_BACKUP_KIND;
    local_only: true;
    no_network: true;
    created_at: string;
    package: TodosLocalBridgePackageSource;
    source: TodosLocalBridgeSource;
    bridge: {
        kind: typeof TODOS_LOCAL_BRIDGE_KIND;
        schema_version: typeof TODOS_LOCAL_BRIDGE_SCHEMA_VERSION;
        exported_at: string;
        checksum: string;
        stats: Record<keyof TodosLocalBridgeData, number>;
        artifact_contents: number;
    };
    database: {
        path: string;
        integrity: LocalBackupSqliteIntegrity;
    };
    checksum_algorithm: typeof LOCAL_BACKUP_CHECKSUM_ALGORITHM;
    section_checksums: Record<keyof TodosLocalBridgeData, string>;
    warnings: string[];
}
export interface LocalBackupBundle {
    schema_version: typeof TODOS_LOCAL_BACKUP_SCHEMA_VERSION;
    kind: typeof TODOS_LOCAL_BACKUP_KIND;
    local_only: true;
    no_network: true;
    created_at: string;
    package: TodosLocalBridgePackageSource;
    manifest: LocalBackupManifest;
    bridge: TodosLocalBridgeBundle;
    checksum_algorithm: typeof LOCAL_BACKUP_CHECKSUM_ALGORITHM;
    checksum: string;
}
export interface LocalBackupVerification {
    schema_version: typeof TODOS_LOCAL_BACKUP_SCHEMA_VERSION;
    kind: "hasna.todos.local-backup-verification";
    local_only: true;
    no_network: true;
    verified_at: string;
    ok: boolean;
    checksum_algorithm: typeof LOCAL_BACKUP_CHECKSUM_ALGORITHM;
    checksum: {
        expected: string | null;
        actual: string | null;
        ok: boolean;
    };
    bridge_checksum: {
        expected: string | null;
        actual: string | null;
        ok: boolean;
    };
    bridge_validation: ReturnType<typeof validateLocalBridgeBundle>;
    sqlite: LocalBackupSqliteIntegrity | null;
    counts: {
        expected: Partial<Record<keyof TodosLocalBridgeData, number>>;
        actual: Partial<Record<keyof TodosLocalBridgeData, number>>;
        ok: boolean;
    };
    compatible: boolean;
    issues: string[];
    warnings: string[];
}
export interface RestoreLocalBackupOptions {
    apply?: boolean;
    conflict_strategy?: ImportLocalBridgeOptions["conflictStrategy"];
    verified_at?: string;
}
export interface LocalBackupRestoreResult {
    schema_version: typeof TODOS_LOCAL_BACKUP_SCHEMA_VERSION;
    kind: "hasna.todos.local-backup-restore";
    local_only: true;
    no_network: true;
    restored_at: string;
    dry_run: boolean;
    ok: boolean;
    verification: LocalBackupVerification;
    import_result: LocalBridgeImportResult | null;
    issues: string[];
}
export interface LocalIntegrityReport {
    schema_version: typeof TODOS_LOCAL_INTEGRITY_SCHEMA_VERSION;
    kind: typeof TODOS_LOCAL_INTEGRITY_KIND;
    local_only: true;
    no_network: true;
    generated_at: string;
    database_path: string;
    sqlite: LocalBackupSqliteIntegrity;
    bridge_validation: ReturnType<typeof validateLocalBridgeBundle>;
    counts: Record<keyof TodosLocalBridgeData, number>;
    orphaned_rows: Record<string, number>;
    ok: boolean;
    issues: string[];
    warnings: string[];
}
export declare function createLocalBackup(options?: CreateLocalBackupOptions, db?: Database): LocalBackupBundle;
export declare function writeLocalBackupFile(backup: LocalBackupBundle, outputPath: string): string;
export declare function readLocalBackupFile(path: string): LocalBackupBundle;
export declare function verifyLocalBackup(value: unknown, options?: {
    verified_at?: string;
    check_sqlite?: boolean;
}, db?: Database): LocalBackupVerification;
export declare function restoreLocalBackup(backup: LocalBackupBundle, options?: RestoreLocalBackupOptions, db?: Database): LocalBackupRestoreResult;
export declare function checkLocalIntegrity(options?: {
    generated_at?: string;
    project_id?: string;
    version?: string;
}, db?: Database): LocalIntegrityReport;
//# sourceMappingURL=local-backups.d.ts.map