import type { Db } from '../storage/database.js'; import type { EventBus } from './events.js'; import type { StateEntry } from '../types.js'; export declare class StateService { private readonly db; private readonly events; constructor(db: Db, events: EventBus); set(namespace: string, key: string, value: string, updatedBy: string, ttlSeconds?: number): StateEntry; get(namespace: string, key: string): StateEntry | null; /** Lazy-delete expired entries. Cheap: hits the partial index on expires_at. * Wrap expires_at in datetime() so it works for BOTH the SQLite native format * (used when entries are created via raw SQL) AND the ISO format with 'T' and * 'Z' (used when entries are created via state.set() from JS). Without the * datetime() wrap, ISO-format entries never expire because string comparison * against "datetime('now')" fails ('T' > ' '). */ private expireSweep; list(namespace?: string, prefix?: string): StateEntry[]; namespaces(): string[]; delete(namespace: string, key: string): boolean; deleteNamespace(namespace: string): number; compareAndSwap(namespace: string, key: string, expected: string | null, newValue: string, updatedBy: string, ttlSeconds?: number): boolean; private validateKey; } //# sourceMappingURL=state.d.ts.map