import type { SanctionedEntity, SanctionSource } from './types.js'; export interface DbStats { total_active: number; total_removed: number; by_source: Record; refresh_log: Array<{ source: string; refreshed_at: string; source_count: number; ok: boolean; error: string | null; }>; } export declare class SanctionsDb { private readonly db; constructor(dbPath: string); close(): void; /** * Upsert a batch of entities for a given source. Diffs against existing * rows and writes change_log entries for `list_recent_updates`. */ upsertSource(source: SanctionSource, entities: SanctionedEntity[]): { added: number; modified: number; removed: number; }; recordRefreshFailure(source: SanctionSource, error: string): void; getById(id: string): SanctionedEntity | null; /** Look up by external ID (passport, IČO, tax_id…). Exact match. */ findByExternalId(type: string, value: string): SanctionedEntity[]; /** * Candidates for fuzzy match: returns all entities whose any alias shares * at least one token prefix with the query. Cheap pre-filter; expensive * scoring happens in search.ts. */ candidatesByTokens(tokens: string[], typeFilter?: 'person' | 'entity'): SanctionedEntity[]; /** * Recent change log for `list_recent_updates`. Reconstructs add/modify/remove buckets. */ changesSince(sinceMs: number, source?: SanctionSource): { added: SanctionedEntity[]; removed: SanctionedEntity[]; modified: Array<{ before: SanctionedEntity; after: SanctionedEntity; }>; }; stats(): DbStats; } //# sourceMappingURL=db.d.ts.map