import type { Dialect } from '@enbox/dwn-sql-store'; /** * The SqlTtlCache is responsible for storing and retrieving cache data with TTL (Time-to-Live). */ export declare class SqlTtlCache { private static readonly cacheTableName; private static readonly cleanupIntervalInSeconds; private readonly db; private cleanupTimer; private constructor(); /** * Creates a new SqlTtlCache instance. */ static create(sqlDialect: Dialect): Promise; /** * Verifies that the required table exists and starts the cleanup timer. * Throws a clear error directing the caller to run server migrations first. */ private initialize; /** * Starts a timer to periodically clean up expired cache entries. */ private startCleanupTimer; /** * Inserts a cache entry. * @param ttl The time-to-live in seconds. */ insert(key: string, value: object, ttl: number): Promise; /** * Retrieves a cache entry if it is not expired and cleans up expired entries. */ get(key: string): Promise; /** * Deletes a cache entry. */ delete(key: string): Promise; /** * Cleans up expired cache entries. */ cleanUpExpiredEntries(): Promise; /** * Stops the background cleanup timer. The underlying database connection is * NOT destroyed here because the dialect is shared with other components * (e.g. DWN stores, registration store) and its lifecycle is managed by the * dialect owner. */ close(): void; } //# sourceMappingURL=sql-ttl-cache.d.ts.map