import type { Database } from "bun:sqlite";
import { type ExportedArtifactContent } from "./artifact-store.js";
import type { LocalCalendarItem, Project, Plan, Task, TaskBoard, TaskComment, TaskDependency, TaskList } from "../types/index.js";
import type { TaskCommit, TaskGitRef, TaskVerification } from "../db/task-commits.js";
import type { TaskFile } from "../db/task-files.js";
import type { TaskRun, TaskRunArtifact, TaskRunCommand, TaskRunEvent } from "../db/task-runs.js";
import type { SavedSearchView } from "./saved-search-views.js";
export declare const TODOS_LOCAL_BRIDGE_KIND = "hasna.todos.local-bridge";
export declare const TODOS_LOCAL_BRIDGE_SCHEMA_VERSION = 1;
export interface TodosLocalBridgePackageSource {
    packageName: "@hasna/todos";
    repository: "hasna/todos";
    version: string;
}
export interface TodosLocalBridgeSource {
    project_id: string | null;
    project_path: string | null;
}
export interface TodosLocalBridgeData {
    projects: Project[];
    task_lists: TaskList[];
    plans: Plan[];
    tasks: Task[];
    task_dependencies: TaskDependency[];
    comments: TaskComment[];
    runs: TaskRun[];
    run_events: TaskRunEvent[];
    run_commands: TaskRunCommand[];
    run_artifacts: TaskRunArtifact[];
    task_files: TaskFile[];
    task_commits: TaskCommit[];
    task_git_refs: TaskGitRef[];
    task_verifications: TaskVerification[];
    saved_views: SavedSearchView[];
    task_boards: TaskBoard[];
    local_calendar_items: LocalCalendarItem[];
}
export interface TodosLocalBridgeBundle {
    schemaVersion: typeof TODOS_LOCAL_BRIDGE_SCHEMA_VERSION;
    kind: typeof TODOS_LOCAL_BRIDGE_KIND;
    exportedAt: string;
    package: TodosLocalBridgePackageSource;
    source: TodosLocalBridgeSource;
    data: TodosLocalBridgeData;
    artifact_contents?: ExportedArtifactContent[];
    stats: Record<keyof TodosLocalBridgeData, number>;
}
export interface ExportLocalBridgeOptions {
    project_id?: string;
    generatedAt?: string;
    version?: string;
}
export interface LocalBridgeValidationResult {
    ok: boolean;
    issues: string[];
}
export interface LocalBridgeImportConflict {
    table: string;
    id: string;
    reason: "already_exists" | "missing_dependency" | "diverged";
    fields?: string[];
    resolution?: "skipped" | "safe_merged" | "manual_required";
}
export interface LocalBridgeImportResult {
    ok: boolean;
    dry_run: boolean;
    inserted: Record<keyof TodosLocalBridgeData, number>;
    merged: Record<keyof TodosLocalBridgeData, number>;
    skipped: Record<keyof TodosLocalBridgeData, number>;
    conflicts: LocalBridgeImportConflict[];
    issues: string[];
}
export type LocalBridgeConflictStrategy = "skip" | "safe_merge";
export interface ImportLocalBridgeOptions {
    dryRun?: boolean;
    conflictStrategy?: LocalBridgeConflictStrategy;
}
export declare function createLocalBridgeBundle(options?: ExportLocalBridgeOptions, db?: Database): TodosLocalBridgeBundle;
export declare function validateLocalBridgeBundle(value: unknown): LocalBridgeValidationResult;
export declare function importLocalBridgeBundle(bundle: TodosLocalBridgeBundle, options?: ImportLocalBridgeOptions, db?: Database): LocalBridgeImportResult;
//# sourceMappingURL=local-bridge.d.ts.map