import { BaselineBarrier } from "./socket-baseline-barrier.ts";
import { type QueueEntry, type RecoveryEntry, type SocketEventQueue } from "./socket-event-queue.ts";
import type { ResyncCut, ResyncReason } from "./socket-peer-recovery.ts";
/**
 * What a shed does with the records produced while its recovery is pending. `drop` is today's path (the
 * compact-updates flag off): they are dropped and the cut is read when the gap is delivered. `capture` (the
 * flag on) freezes the cut at the shed and delivers the captured suffix after it.
 */
export type ShedMode = "drop" | "capture";
export type ResyncSnapshot = (reason: ResyncReason, carried?: readonly string[]) => ResyncCut;
/** One peer's pending cut: which records it keeps, where a reply goes, and when the cut is read. */
export declare class SocketPeerShed {
    private pending?;
    private readonly queue;
    private readonly mode;
    constructor(queue: SocketEventQueue, mode: ShedMode);
    get isPending(): boolean;
    /** True while the pending recovery drops the records it does not capture: today's path, or a capture gone stale. */
    get dropsRecords(): boolean;
    /**
     * Freeze the cut C now: keep the replies, release every record and baseline the cut covers, and queue the
     * recovery (gap, then C's frames). With `capture`, the records that follow are kept behind it.
     */
    cut(reason: ResyncReason, snapshot: ResyncSnapshot, live: () => boolean): void;
    /**
     * The captured suffix overflowed: release it and the cut at C, and read one fresh cut when the gap is
     * delivered. Until then records are dropped like today's path, one freeze instead of one per overflowing record.
     */
    supersede(): void;
    /** A reply keeps today's place ahead of the gap while records are dropped; a captured one follows the cut. */
    admitReply(entry: QueueEntry): void;
    /** The recovery reaches delivery: a stale one reads its fresh cut now, carrying the sessions of the cut it replaces. */
    take(entry: RecoveryEntry, snapshot: ResyncSnapshot | undefined, live: () => boolean): BaselineBarrier;
    clear(): void;
}
//# sourceMappingURL=socket-peer-shed.d.ts.map