import type Database from 'better-sqlite3';
export type MediaTaskStatus = 'queued' | 'running' | 'done' | 'failed' | 'interrupted';
export interface MediaTaskError {
    message: string;
    status?: number;
    code?: string;
}
export interface MediaTaskRow {
    id: string;
    projectId: string;
    status: MediaTaskStatus;
    surface?: string;
    model?: string;
    progress: string[];
    file: unknown | null;
    error: MediaTaskError | null;
    startedAt: number;
    endedAt: number | null;
    createdAt: number;
    updatedAt: number;
}
export interface MediaTaskInsert {
    id: string;
    projectId: string;
    status?: MediaTaskStatus;
    surface?: string;
    model?: string;
    progress?: string[];
    file?: unknown | null;
    error?: MediaTaskError | null;
    startedAt?: number;
    endedAt?: number | null;
    createdAt?: number;
    updatedAt?: number;
}
export interface MediaTaskPatch {
    status?: MediaTaskStatus;
    surface?: string | null;
    model?: string | null;
    progress?: string[];
    file?: unknown | null;
    error?: MediaTaskError | null;
    startedAt?: number;
    endedAt?: number | null;
    updatedAt?: number;
}
export declare function migrateMediaTasks(db: Database.Database): void;
export declare function insertMediaTask(db: Database.Database, input: MediaTaskInsert): MediaTaskRow;
export declare function getMediaTask(db: Database.Database, id: string): MediaTaskRow | null;
export declare function updateMediaTask(db: Database.Database, id: string, patch: MediaTaskPatch): MediaTaskRow | null;
export declare function listMediaTasksByProject(db: Database.Database, projectId: string, options?: {
    includeTerminal?: boolean;
}): MediaTaskRow[];
export declare function listRecentMediaTasks(db: Database.Database, options: {
    terminalTtlMs: number;
    now?: number;
}): MediaTaskRow[];
export declare function deleteMediaTask(db: Database.Database, id: string): void;
export declare function reconcileMediaTasksOnBoot(db: Database.Database, options: {
    terminalTtlMs: number;
    now?: number;
}): {
    interrupted: number;
    deleted: number;
};
