/**
 * Local SQLite event store — gateway-native event persistence.
 *
 * Uses node:sqlite (DatabaseSync) with WAL mode for crash safety and
 * concurrent read support. This is the canonical data layer: all events
 * are written here first, then synced to Turso write-behind.
 *
 * @module
 */
import { requireNodeSqlite } from "../memory/sqlite.js";
import type { EventInput, EventQueryOptions, EventRecord, EventStoreConfig, EventSummary, TimelineBucket } from "./types.js";
type DatabaseSync = InstanceType<ReturnType<typeof requireNodeSqlite>["DatabaseSync"]>;
export interface EventStore {
    /** Insert an event, return the auto-assigned local ID. */
    insert(input: EventInput): number;
    /** Query events with filters, pagination, and pattern matching. */
    query(opts: EventQueryOptions): EventRecord[];
    /** Get a single event by local ID. */
    get(id: number): EventRecord | null;
    /** Aggregated counts by category and severity. */
    summary(opts?: {
        since?: number;
    }): EventSummary;
    /** Time-bucketed event counts for charts. Auto-bucket based on range. */
    timeline(opts: {
        since: number;
        until: number;
    }): TimelineBucket[];
    /** Delete events older than retention. Returns total deleted count. */
    cleanup(retention: Record<string, number>): number;
    /** Return events with id > sinceId for sync. */
    getUnsyncedEvents(sinceId: number, batchSize: number): EventRecord[];
    /** Approximate DB file size in bytes. */
    dbSizeBytes(): number;
    /** Close the SQLite connection. */
    close(): void;
    /** Expose raw DB for testing (pragma verification etc.). */
    _db(): DatabaseSync;
}
export declare function createEventStore(config: EventStoreConfig): EventStore;
export {};
