import { Result } from "better-result"; import { CancelledError, LogStreamError } from "./errors.ts"; export type LogRecord = { type: "log"; text: string; byteStart: number; byteEnd: number; }; export type TerminalRecord = { type: "terminal"; kind: "end" | "error"; code: string; message: string; retryable: boolean; cursor: string | null; details?: Record; }; export type StreamRecord = LogRecord | TerminalRecord; export type LogStreamOptions = { baseUrl: string; token: string; versionId: string; tail?: number; fromStart?: boolean; cursor?: string; signal?: AbortSignal; }; export type StreamResult = { terminal: TerminalRecord | null; lastByteEnd: number | null; }; export type StreamLogsError = LogStreamError | CancelledError; /** * Open a WebSocket to the log-streaming endpoint and deliver records via callback. * * Returns `Ok` with the stream result on graceful close, or `Err` with a * `LogStreamError` (connection/HTTP errors) or `CancelledError` (abort signal). */ export declare function streamLogs(options: LogStreamOptions, onRecord: (record: StreamRecord) => void): Promise>; //# sourceMappingURL=log-stream.d.ts.map