/** * CogmemAi local SQLite database — schema, initialization, and query helpers. */ import Database from 'better-sqlite3'; /** * Get or create the SQLite database connection. */ export declare function getDb(): Database.Database; /** * Close the database connection. */ export declare function closeDb(): void; /** * Sync a memory row to the FTS5 index. Safe to call even if FTS5 is unavailable. */ export declare function ftsUpsert(id: number, subject: string, content: string, category: string, tags: string): void; /** * Remove a memory from the FTS5 index. Safe to call even if FTS5 is unavailable. */ export declare function ftsDelete(id: number): void; /** * Search the FTS5 index. Returns row IDs ranked by relevance, or null if FTS5 unavailable. */ export declare function ftsSearch(query: string, limit: number): Array<{ id: number; rank: number; }> | null; /** * Compute expires_at from a TTL string like "7d", "24h", "30d". */ export declare function computeExpiresAt(ttl: string): string | null;