{"version":3,"sources":["../../src/data_streams/types.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\nimport type { DataStream_Chunk, DataStream_Header } from '@livekit/rtc-ffi-bindings';\nimport type { ByteStreamReader, TextStreamReader } from './stream_reader.js';\n\nexport interface StreamController<T extends DataStream_Chunk> {\n  header: DataStream_Header;\n  controller: ReadableStreamDefaultController<T>;\n  startTime: number;\n  endTime?: number;\n}\n\nexport interface BaseStreamInfo {\n  streamId: string;\n  mimeType: string;\n  topic: string;\n  timestamp: number;\n  /** total size in bytes for finite streams and undefined for streams of unknown size */\n  totalSize?: number;\n  attributes?: Record<string, string>;\n}\n\nexport type ByteStreamInfo = BaseStreamInfo & {\n  name: string;\n};\n\nexport type TextStreamInfo = BaseStreamInfo;\n\nexport interface DataStreamOptions {\n  topic?: string;\n  destinationIdentities?: Array<string>;\n  attributes?: Record<string, string>;\n  mimeType?: string;\n}\n\nexport interface TextStreamOptions extends DataStreamOptions {\n  // replyToMessageId?: string;\n  attachments?: [];\n}\n\nexport interface ByteStreamOptions extends DataStreamOptions {\n  name?: string;\n  onProgress?: (progress: number) => void;\n}\n\nexport type ByteStreamHandler = (\n  reader: ByteStreamReader,\n  participantInfo: { identity: string },\n) => void;\n\nexport type TextStreamHandler = (\n  reader: TextStreamReader,\n  participantInfo: { identity: string },\n) => void;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}