export interface OutboxEntry {
    clientMsgId: string;
    channelId: string;
    text: string;
    blocks?: unknown;
    parentId?: string | null;
    isBroadcast?: boolean;
    createdAt: string;
    attempts: number;
    status: "pending" | "failed";
}
export interface OutboxStorage {
    load(): Promise<OutboxEntry[]>;
    save(entry: OutboxEntry): Promise<void>;
    remove(clientMsgId: string): Promise<void>;
}
/** For tests and non-browser hosts. */
export declare class MemoryOutboxStorage implements OutboxStorage {
    private entries;
    load(): Promise<OutboxEntry[]>;
    save(entry: OutboxEntry): Promise<void>;
    remove(clientMsgId: string): Promise<void>;
}
/** Web/PWA persistence (§5.3 / Feature 12.5). Desktop's SQLite-backed
 * implementation lives in apps/desktop once that platform adapter is built
 * (Phase 3) — same OutboxStorage interface, different backing store. */
export declare class IndexedDbOutboxStorage implements OutboxStorage {
    private readonly dbName;
    private readonly storeName;
    private open;
    load(): Promise<OutboxEntry[]>;
    save(entry: OutboxEntry): Promise<void>;
    remove(clientMsgId: string): Promise<void>;
}
export type SendFn = (entry: OutboxEntry) => Promise<void>;
export type OutboxStatus = "pending" | "sent" | "failed";
export type StatusListener = (clientMsgId: string, status: OutboxStatus) => void;
/**
 * Optimistic send with an offline outbox (Feature 4.23 / §5.3). Every
 * mutation persists to storage *before* any network attempt — so a page
 * reload or app crash mid-send still replays it. Idempotent by
 * construction: replaying an already-delivered `clientMsgId` hits the
 * server's `UNIQUE(channel_id, client_msg_id)` and returns the original
 * message (I3) rather than creating a duplicate.
 */
export declare class Outbox {
    private readonly storage;
    private readonly send;
    private readonly onStatusChange?;
    constructor(storage: OutboxStorage, send: SendFn, onStatusChange?: StatusListener | undefined);
    enqueue(entry: Omit<OutboxEntry, "attempts" | "status">): Promise<void>;
    /** Replays every persisted entry in creation order — called on reconnect. */
    replay(): Promise<void>;
    private attempt;
}
//# sourceMappingURL=outbox.d.ts.map