import type Database from 'better-sqlite3'; import type { Detection } from '../types.js'; export declare class AmbiguousDetectionIdError extends Error { readonly id: string; readonly sources: string[]; readonly code = "AMBIGUOUS_DETECTION_ID"; constructor(id: string, sources: string[]); } export declare function findDetectionRow(db: Database.Database, id: string, sourceType?: string): Record | undefined; /** Rebuild the legacy primary key inside the caller's schema transaction. */ export declare function migrateDetectionIdentity(db: Database.Database): boolean; export declare function upsertDetection(database: Database.Database, detection: Detection): void;