import type { WorkflowEvent } from '../core/types.ts'; /** Reason a workflow event tail terminated. */ export type StreamCloseReason = 'workflow-terminal' | 'client-closed' | 'reconnect-exhausted' | 'server-error'; export type WorkflowEventTailLifecycleOptions = { readonly bufferForIteration?: boolean; readonly onClose: (reason: StreamCloseReason) => void; }; /** * Shared async-iterator lifecycle for client event tails. Transports own * connection mechanics; this owns buffering, close state, and wake-up handling. */ export declare class WorkflowEventTailLifecycle implements AsyncIterable { #private; constructor(options: WorkflowEventTailLifecycleOptions); get closed(): boolean; get closeReason(): StreamCloseReason | null; emit(event: WorkflowEvent, onEvent: (event: WorkflowEvent) => void): boolean; terminate(reason: StreamCloseReason): void; close(): void; [Symbol.asyncIterator](): AsyncIterator; }