{"version":3,"sources":["../../src/streaming/types.ts"],"sourcesContent":["export type StreamChunk = string | Uint8Array | ArrayBuffer;\r\n\r\n/** Server-side: where the writer sends text chunks. */\r\nexport interface IOStreamTransport {\r\n  send(chunk: string | Uint8Array): void | Promise<void>;\r\n}\r\n\r\n/**\r\n * Client-side: a source of bytes/text chunks.\r\n *\r\n * Supported shapes:\r\n * - string\r\n * - Iterable<StreamChunk>\r\n * - AsyncIterable<StreamChunk>\r\n * - Web ReadableStream<Uint8Array>\r\n * - Node.js Readable (AsyncIterable<Uint8Array|string>)\r\n */\r\nexport type IOStreamSource =\r\n  | string\r\n  | Iterable<StreamChunk>\r\n  | AsyncIterable<StreamChunk>\r\n  | ReadableStream<Uint8Array>\r\n  | AsyncIterable<Uint8Array | string>;\r\n\r\nexport interface StreamItem<T = any> {\r\n  data: T;\r\n  schemaName: string;\r\n  index: number;\r\n  error?: Error;\r\n}\r\n\r\nexport interface StreamReaderOptions {\r\n  /** Optional default schema name if header does not provide $schema. */\r\n  defaultSchema?: string;\r\n\r\n  /**\r\n   * Soft guardrails for streaming buffers.\r\n   * This is not a security boundary, but prevents accidental unbounded growth.\r\n   */\r\n  maxBufferedChars?: number;\r\n}\r\n\r\nexport interface StreamWriterOptions {\r\n  /** Default: true. If false, schemas are not written into the header. */\r\n  includeSchemas?: boolean;\r\n\r\n  /** If set, inserts a stable hash/id into header metadata (design hook). */\r\n  defsId?: string;\r\n\r\n  /**\r\n   * How to handle validation/serialization errors during write().\r\n   * - 'throw': Throw the error (default).\r\n   * - 'ignore': Return empty string (skip the record).\r\n   * - 'emit': Emit an error record (e.g. `!error { ... }`).\r\n   */\r\n  onError?: 'throw' | 'ignore' | 'emit';\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}