import type { EventProtocol, FrameKind, FramePayload, Logger, Middleware } from './types'; /** The minimum a frame sink must expose for the pipeline to write to it. */ interface FrameSink { send(data: unknown): void; } /** * Outgoing frame pipeline — the single place a structured `(kind, payload)` is * turned into a wire frame and written to the socket: * * buildFrame (custom frameBuilder → default) → outgoing middleware → send * * Extracted from SharedWebSocket so the build/middleware/send logic lives in * one cohesive unit. The owner keeps the socket; it's handed in via * `setSocket()` on each leader handover (and cleared on demotion). */ export declare class FramePipeline { private readonly proto; private readonly log; private socket; private readonly middleware; constructor(proto: EventProtocol, log: Logger); /** Point the pipeline at the current leader socket (or `null` on demotion). */ setSocket(socket: FrameSink | null): void; hasSocket(): boolean; /** Register an outgoing middleware. Return `null` from it to drop a frame. */ use(fn: Middleware): void; /** Build, run middleware, and write to the socket. No-op without a socket. */ transmit(kind: FrameKind, payload: FramePayload): void; /** * Build the wire frame for a given kind. Honors custom `frameBuilder`. * Return-value contract: * - any concrete value → use as the frame * - `null` → drop the frame (intentional filter) * - `undefined` → fall back to the default builder for this kind */ private buildFrame; /** Legacy two-key builder — preserved as the default for back-compat. */ private defaultFrameBuilder; /** * Human-readable headline for log lines — picks the most relevant field * out of the structured payload so log scanners aren't reading objects. */ private frameLabel; } export {};