import type { WorkflowEvent } from '../core/types.ts'; import type { StreamCloseReason } from './event-stream.ts'; import type { WorkflowEventTail } from './event-tail.ts'; export type ServerSentEventFrame = { readonly id?: string; readonly event?: string; readonly data: string; }; export type ServerSentEventParseResult = { readonly frames: ReadonlyArray; readonly remainder: string; }; export type SseWorkflowEventStreamOptions = { readonly maxReconnectAttempts?: number; readonly reconnectBackoffMs?: number; readonly bufferForIteration?: boolean; }; export declare function workflowEventsSseUrl(baseUrl: string, workflowId: string): string; export declare function parseServerSentEventChunk(text: string, previousRemainder?: string): ServerSentEventParseResult; export declare class SseWorkflowEventSubscription implements WorkflowEventTail { #private; constructor(url: string, headers: Record, workflowId: string, onEvent: (event: WorkflowEvent) => void, options?: SseWorkflowEventStreamOptions); get closeReason(): StreamCloseReason | null; whenConnected(): Promise; close(): void; [Symbol.asyncIterator](): AsyncIterator; }