/**
 * Turso write-behind sync engine — batches local events to remote Turso DB.
 *
 * Reads unsyncedEvents from the local EventStore and upserts them into
 * the hub's `unified_events` table via `INSERT OR IGNORE` (dedup on
 * serverId + localEventId). Uses exponential backoff on failures
 * (max 30 minutes).
 *
 * Pattern follows the Turso client init approach used by the gateway.
 *
 * @module
 */
import type { EventStore } from "./store.js";
export type HeartbeatPayload = {
    uptimeMs: number;
    activeSessions: number;
    activeAgents: number;
    memoryRssMb: number;
    capturedAt: number;
    channelStatusJson?: string;
    credentialSummaryJson?: string;
};
export type TursoSyncEngine = {
    /** Force immediate sync, await completion. */
    flush: () => Promise<void>;
    /** Stop sync interval and close Turso client. */
    stop: () => void;
    /** Queue a heartbeat for the next sync cycle. Only latest is kept. */
    pushHeartbeat: (heartbeat: HeartbeatPayload) => void;
    /** Current backoff interval in ms (exposed for testing). */
    currentBackoffMs: number;
};
export type TursoSyncOptions = {
    store: EventStore;
    tursoUrl: string;
    tursoAuthToken?: string;
    serverId: string;
    syncIntervalMs: number;
    syncBatchSize: number;
};
/**
 * Create a Turso sync engine. Returns null if Turso init fails
 * (e.g. serverId not in servers table, network error).
 */
export declare function createTursoSync(opts: TursoSyncOptions): Promise<TursoSyncEngine | null>;
