import { z } from 'zod'; import { Schema } from 'modelfusion'; import { ErrorHandler } from 'modelfusion/internal'; declare class MediaSourceAppender { private readonly mediaSource; private readonly audioChunks; private sourceBuffer?; constructor(type: string); private tryAppendNextChunk; addBase64Data(base64Data: string): void; addData(data: ArrayBuffer): void; close(): void; get mediaSourceUrl(): string; } declare function convertAudioChunksToBase64({ audioChunks, mimeType, }: { audioChunks: Blob[]; mimeType: string; }): Promise; declare function convertBlobToBase64(blob: Blob): Promise; interface FlowSchema { input: z.ZodType; events: z.ZodType; } declare function invokeFlow({ url, input, schema, onEvent, onStop, }: { url: string; input: INPUT; schema: FlowSchema; onEvent: (event: EVENT, eventSource: EventSource) => void; onStop?: (eventSource: EventSource) => void; }): Promise; declare function readEventSource({ url, schema, onEvent, onError, onStop, isStopEvent, }: { url: string; schema: Schema; onEvent: (event: T, eventSource: EventSource) => void; onError?: (error: unknown, eventSource: EventSource) => void; onStop?: (eventSource: EventSource) => void; isStopEvent?: (event: MessageEvent) => boolean; }): void; declare function readEventSourceStream({ stream, schema, errorHandler, }: { stream: ReadableStream; schema: Schema; errorHandler?: ErrorHandler; }): AsyncIterable; export { MediaSourceAppender, convertAudioChunksToBase64, convertBlobToBase64, invokeFlow, readEventSource, readEventSourceStream };