diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..a34b23041e --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.api.md text eol=crlf diff --git a/.github/workflows/smoke.yaml b/.github/workflows/smoke.yaml index 1d4a96cd7a..d0973bba16 100644 --- a/.github/workflows/smoke.yaml +++ b/.github/workflows/smoke.yaml @@ -34,6 +34,9 @@ jobs: - name: Build SDK run: pnpm build + - name: Check main and core API reports + run: pnpm api-report:check + - name: Pack SDK into smoke-tests tarball working-directory: smoke-tests run: node scripts/prepare-package.mjs diff --git a/.gitignore b/.gitignore index e335113fd8..ba7ab19cca 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,6 @@ examples/**/build/ # scratch dir of scripts/check-core-types.mjs .tmp-core-types-* + +# API Extractor comparison output +/temp/ diff --git a/api-extractor.core.json b/api-extractor.core.json new file mode 100644 index 0000000000..c8c315d2b9 --- /dev/null +++ b/api-extractor.core.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "/dist/core/types/src/core.d.ts", + "apiReport": { + "enabled": true, + "reportFileName": "livekit-client-core", + "reportFolder": "/etc", + "reportTempFolder": "/temp/api-extractor" + }, + "docModel": { + "enabled": false + }, + "dtsRollup": { + "enabled": false + }, + "tsdocMetadata": { + "enabled": false + }, + "messages": { + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-setter-with-docs": { + "logLevel": "none" + }, + "ae-unresolved-import-path": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + } + } +} diff --git a/api-extractor.main.json b/api-extractor.main.json new file mode 100644 index 0000000000..9d1c89c2a2 --- /dev/null +++ b/api-extractor.main.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "/dist/src/index.d.ts", + "apiReport": { + "enabled": true, + "reportFileName": "livekit-client", + "reportFolder": "/etc", + "reportTempFolder": "/temp/api-extractor" + }, + "docModel": { + "enabled": false + }, + "dtsRollup": { + "enabled": false + }, + "tsdocMetadata": { + "enabled": false + }, + "messages": { + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-setter-with-docs": { + "logLevel": "none" + }, + "ae-unresolved-import-path": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + } + } +} diff --git a/etc/livekit-client-core.api.md b/etc/livekit-client-core.api.md new file mode 100644 index 0000000000..da2a6075b4 --- /dev/null +++ b/etc/livekit-client-core.api.md @@ -0,0 +1,3465 @@ +## API Report File for "livekit-client" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AddTrackRequest } from '@livekit/protocol'; +import { AudioTrackFeature } from '@livekit/protocol'; +import { ClientInfo_Capability } from '@livekit/protocol'; +import { ConnectionQualityUpdate } from '@livekit/protocol'; +import { DataPacket } from '@livekit/protocol'; +import { DataPacket_Kind } from '@livekit/protocol'; +import type { DataStream_Chunk } from '@livekit/protocol'; +import { DataTrackInfo as DataTrackInfo_2 } from '@livekit/protocol'; +import { DataTrackSubscriberHandles } from '@livekit/protocol'; +import { DisconnectReason } from '@livekit/protocol'; +import { EncryptedPacketPayload } from '@livekit/protocol'; +import { Encryption_Type } from '@livekit/protocol'; +import { JoinResponse } from '@livekit/protocol'; +import type { JWTPayload } from 'jose'; +import log from 'loglevel'; +import type { MediaAttributes } from 'sdp-transform'; +import { MetricsBatch } from '@livekit/protocol'; +import { Mutex } from '@livekit/mutex'; +import { ParticipantInfo } from '@livekit/protocol'; +import { ParticipantInfo_Kind as ParticipantKind } from '@livekit/protocol'; +import { ParticipantPermission } from '@livekit/protocol'; +import { PublishDataTrackResponse } from '@livekit/protocol'; +import { RegionSettings } from '@livekit/protocol'; +import { RequestResponse } from '@livekit/protocol'; +import { RequestResponse_Reason } from '@livekit/protocol'; +import { Room } from '@livekit/protocol'; +import { RoomConfiguration } from '@livekit/protocol'; +import { RoomMovedResponse } from '@livekit/protocol'; +import { ServerInfo } from '@livekit/protocol'; +import { SignalTarget } from '@livekit/protocol'; +import { SipDTMF } from '@livekit/protocol'; +import { SpeakerInfo } from '@livekit/protocol'; +import { StreamStateUpdate } from '@livekit/protocol'; +import { SubscribedQualityUpdate } from '@livekit/protocol'; +import { SubscriptionError } from '@livekit/protocol'; +import { SubscriptionPermissionUpdate } from '@livekit/protocol'; +import { SubscriptionResponse } from '@livekit/protocol'; +import { Throws } from '@livekit/throws-transformer/throws'; +import { TokenSourceRequest } from '@livekit/protocol'; +import { TokenSourceResponse } from '@livekit/protocol'; +import { TrackInfo } from '@livekit/protocol'; +import { TrackType } from '@livekit/protocol'; +import { TrackUnpublishedResponse } from '@livekit/protocol'; +import { Transcription } from '@livekit/protocol'; +import { TranscriptionSegment as TranscriptionSegment_2 } from '@livekit/protocol'; +import type TypedEmitter from 'typed-emitter'; +import type TypedEventEmitter from 'typed-emitter'; +import { UnpublishDataTrackResponse } from '@livekit/protocol'; +import type { UpdateSubscription } from '@livekit/protocol'; +import type { UpdateTrackSettings } from '@livekit/protocol'; + +// @public (undocumented) +export type AdaptiveStreamSettings = { + pixelDensity?: number | 'screen'; + pauseVideoInBackground?: boolean; +}; + +// @public (undocumented) +interface AgentAttributes { + // (undocumented) + 'lk.agent.inputs'?: AgentInput[]; + // (undocumented) + 'lk.agent.outputs'?: AgentOutput[]; + // (undocumented) + 'lk.agent.state'?: AgentState; + // (undocumented) + 'lk.publish_on_behalf'?: string; + // (undocumented) + [property: string]: any; +} + +// @public (undocumented) +type AgentInput = 'audio' | 'video' | 'text'; + +// @public (undocumented) +type AgentOutput = 'transcription' | 'audio'; + +// @public (undocumented) +type AgentState = 'idle' | 'initializing' | 'listening' | 'thinking' | 'speaking'; + +// @public +export function areTokenSourceFetchOptionsEqual(a: TokenSourceFetchOptions, b: TokenSourceFetchOptions): boolean; + +// @public (undocumented) +export function asEncryptablePacket(packet: DataPacket): EncryptedPacketPayload | undefined; + +// @public (undocumented) +export function attachToElement(track: MediaStreamTrack, element: HTMLMediaElement): void; + +declare namespace attributes { + export { + AgentAttributes, + AgentInput, + AgentOutput, + AgentState, + TranscriptionAttributes, + Convert + } +} +export { attributes } + +// @public (undocumented) +export type AudioAnalyserOptions = { + cloneTrack?: boolean; + fftSize?: number; + smoothingTimeConstant?: number; + minDecibels?: number; + maxDecibels?: number; +}; + +// @public (undocumented) +export interface AudioCaptureOptions { + autoGainControl?: ConstrainBoolean; + channelCount?: ConstrainULong; + deviceId?: ConstrainDOMString; + echoCancellation?: ConstrainBoolean; + latency?: ConstrainDouble; + noiseSuppression?: ConstrainBoolean; + processor?: TrackProcessor; + restrictOwnAudio?: ConstrainBoolean; + sampleRate?: ConstrainULong; + sampleSize?: ConstrainULong; + voiceIsolation?: ConstrainBoolean; +} + +// @public (undocumented) +export type AudioCodec = (typeof audioCodecs)[number]; + +// @public (undocumented) +export const audioCodecs: readonly ["opus", "red"]; + +// @public (undocumented) +export interface AudioOutputOptions { + deviceId?: string; +} + +// @public (undocumented) +export interface AudioPreset { + // (undocumented) + maxBitrate: number; + // (undocumented) + priority?: RTCPriorityType; +} + +// @public (undocumented) +export namespace AudioPresets { + const // (undocumented) + telephone: AudioPreset; + const // (undocumented) + speech: AudioPreset; + const // (undocumented) + music: AudioPreset; + const // (undocumented) + musicStereo: AudioPreset; + const // (undocumented) + musicHighQuality: AudioPreset; + const // (undocumented) + musicHighQualityStereo: AudioPreset; +} + +// @public (undocumented) +export interface AudioProcessorOptions extends ProcessorOptions { + // (undocumented) + audioContext: AudioContext; +} + +// Warning: (ae-forgotten-export) The symbol "ReceiverStats" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export interface AudioReceiverStats extends ReceiverStats { + // (undocumented) + concealedSamples?: number; + // (undocumented) + concealmentEvents?: number; + // (undocumented) + silentConcealedSamples?: number; + // (undocumented) + silentConcealmentEvents?: number; + // (undocumented) + totalAudioEnergy?: number; + // (undocumented) + totalSamplesDuration?: number; + // (undocumented) + type: 'audio'; +} + +// Warning: (ae-forgotten-export) The symbol "SenderStats" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export interface AudioSenderStats extends SenderStats { + // (undocumented) + type: 'audio'; +} + +// @public (undocumented) +export type AudioTrack = RemoteAudioTrack | LocalAudioTrack; + +// @public (undocumented) +export enum BackupCodecPolicy { + // (undocumented) + PREFER_REGRESSION = 0, + // (undocumented) + REGRESSION = 2, + // (undocumented) + SIMULCAST = 1 +} + +// Warning: (ae-forgotten-export) The symbol "backupVideoCodecs" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export type BackupVideoCodec = (typeof backupVideoCodecs)[number]; + +// @public (undocumented) +export interface BaseE2EEManager { + // (undocumented) + dispose?(): void; + // Warning: (ae-forgotten-export) The symbol "NonSharedUint8Array" needs to be exported by the entry point core.d.ts + // + // (undocumented) + encryptData(data: NonSharedUint8Array): Promise; + // (undocumented) + handleEncryptedData(payload: NonSharedUint8Array, iv: NonSharedUint8Array, participantIdentity: string, keyIndex: number): Promise; + // (undocumented) + isDataChannelEncryptionEnabled: boolean; + // (undocumented) + isEnabled: boolean; + // (undocumented) + off(event: E, listener: E2EEManagerCallbacks[E]): this; + // (undocumented) + on(event: E, listener: E2EEManagerCallbacks[E]): this; + // Warning: (ae-forgotten-export) The symbol "RTCEngine" needs to be exported by the entry point core.d.ts + // + // (undocumented) + setupEngine(engine: RTCEngine): void; +} + +// Warning: (ae-forgotten-export) The symbol "BaseKeyProvider_base" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class BaseKeyProvider extends BaseKeyProvider_base { + constructor(options?: Partial); + // (undocumented) + getKeys(): KeyInfo[]; + // (undocumented) + getLatestManuallySetKeyIndex(): number; + // (undocumented) + getOptions(): KeyProviderOptions; + protected onKeyRatcheted: (ratchetResult: RatchetResult, participantId?: string, keyIndex?: number) => void; + protected onSetEncryptionKey(key: CryptoKey, participantIdentity?: string, keyIndex?: number): void; + // (undocumented) + ratchetKey(participantIdentity?: string, keyIndex?: number): void; +} + +// @public (undocumented) +export interface BaseMessage { + // (undocumented) + data?: unknown; + // (undocumented) + kind: string; +} + +// @public (undocumented) +export type BaseStreamReaderReadAllOpts = { + signal?: AbortSignal; +}; + +// @public (undocumented) +export type ByteStreamHandler = (reader: ByteStreamReader, participantInfo: { + identity: string; +}) => void; + +// Warning: (ae-forgotten-export) The symbol "BaseStreamInfo" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export interface ByteStreamInfo extends BaseStreamInfo { + // (undocumented) + name: string; +} + +// Warning: (ae-forgotten-export) The symbol "BaseStreamReader" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class ByteStreamReader extends BaseStreamReader { + // (undocumented) + [Symbol.asyncIterator](): { + next: () => Promise>; + return(): Promise>; + }; + // (undocumented) + readAll(opts?: BaseStreamReaderReadAllOpts): Promise>; + // (undocumented) + signal?: AbortSignal; + withAbortSignal(signal: AbortSignal): this; +} + +// Warning: (ae-forgotten-export) The symbol "BaseStreamWriter" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class ByteStreamWriter extends BaseStreamWriter { +} + +// @public +export function canFailOverToAnotherRegion(error: ConnectionError): boolean; + +// @public +export interface ChatLocalParticipantApi { + // @deprecated (undocumented) + editChatMessage(editText: string, originalMessage: ChatMessage): Promise; + // @deprecated (undocumented) + sendChatMessage(text: string, options?: SendTextOptions): Promise; +} + +// @public (undocumented) +export interface ChatMessage { + // (undocumented) + attachedFiles?: Array; + // (undocumented) + editTimestamp?: number; + // (undocumented) + id: string; + // (undocumented) + message: string; + // (undocumented) + timestamp: number; +} + +// Warning: (ae-forgotten-export) The symbol "Checker_base" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export abstract class Checker extends Checker_base { + constructor(url: string, token: string, options?: CheckerOptions); + // (undocumented) + protected appendError(message: string): void; + // (undocumented) + protected appendMessage(message: string): void; + // (undocumented) + protected appendWarning(message: string): void; + // (undocumented) + protected connect(url?: string): Promise; + // (undocumented) + connectOptions?: RoomConnectOptions; + // (undocumented) + abstract get description(): string; + // (undocumented) + protected disconnect(): Promise; + // (undocumented) + protected get engine(): RTCEngine | undefined; + // (undocumented) + getInfo(): CheckInfo; + // (undocumented) + protected isSuccess(): boolean; + // Warning: (ae-forgotten-export) The symbol "LogMessage_2" needs to be exported by the entry point core.d.ts + // + // (undocumented) + logs: Array; + // (undocumented) + name: string; + // (undocumented) + options: CheckerOptions; + // (undocumented) + protected abstract perform(): Promise; + // Warning: (ae-forgotten-export) The symbol "CheckRoom" needs to be exported by the entry point core.d.ts + // + // (undocumented) + room: CheckRoom; + // (undocumented) + run(onComplete?: () => void): Promise; + // (undocumented) + protected setStatus(status: CheckStatus): void; + // (undocumented) + protected skip(): void; + // (undocumented) + status: CheckStatus; + // (undocumented) + protected switchProtocol(protocol: 'udp' | 'tcp' | 'tls'): Promise; + // (undocumented) + protected token: string; + // (undocumented) + protected url: string; +} + +// @public (undocumented) +export interface CheckerOptions { + // (undocumented) + connectOptions?: RoomConnectOptions; + // (undocumented) + errorsAsWarnings?: boolean; + // (undocumented) + protocol?: 'udp' | 'tcp'; + // (undocumented) + roomOptions?: RoomOptions; +} + +// @public (undocumented) +export type CheckInfo = { + name: string; + logs: Array; + status: CheckStatus; + description: string; + data?: any; +}; + +// @public (undocumented) +export enum CheckStatus { + // (undocumented) + FAILED = 4, + // (undocumented) + IDLE = 0, + // (undocumented) + RUNNING = 1, + // (undocumented) + SKIPPED = 2, + // (undocumented) + SUCCESS = 3 +} + +// @public +export const CLIENT_PROTOCOL_DATA_STREAM_RPC = 1; + +// @public +export const CLIENT_PROTOCOL_DATA_STREAM_V2 = 2; + +// @public +export const CLIENT_PROTOCOL_DEFAULT = 0; + +// @public +export const clientProtocol = 2; + +// @public (undocumented) +export function compareVersions(v1: string, v2: string): number; + +// @public +export type ConfigurableExtension, Options, Requires extends readonly RoomExtension[]> = ConfiguredExtension & ((options: Options | (() => Options)) => ConfiguredExtension); + +// @public +export type ConfiguredExtension, Requires extends readonly RoomExtension[]> = { + readonly key: symbol; + readonly requires: Requires; + install(room: CoreRoom, ctx: ExtensionContext): Result; +}; + +// Warning: (ae-forgotten-export) The symbol "ConnectionCheck_base" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class ConnectionCheck extends ConnectionCheck_base { + constructor(url: string, token: string, options?: CheckerOptions); + // (undocumented) + checkCloudRegion(): Promise; + // (undocumented) + checkConnectionProtocol(): Promise; + // (undocumented) + checkPublishAudio(): Promise; + // (undocumented) + checkPublishVideo(): Promise; + // (undocumented) + checkReconnect(): Promise; + // (undocumented) + checkTURN(): Promise; + // (undocumented) + checkWebRTC(): Promise; + // (undocumented) + checkWebsocket(): Promise; + // (undocumented) + createAndRunCheck(check: InstantiableCheck): Promise; + // (undocumented) + getResults(): CheckInfo[]; + // (undocumented) + isSuccess(): boolean; + // (undocumented) + options: CheckerOptions; + // (undocumented) + token: string; + // (undocumented) + url: string; +} + +// Warning: (ae-forgotten-export) The symbol "ConnectionErrorVariants" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class ConnectionError extends LivekitReasonedError { + protected constructor(message: string, reason: Variant['reason'], status?: Variant['status'], context?: Variant['context']); + // Warning: (ae-forgotten-export) The symbol "Cancelled" needs to be exported by the entry point core.d.ts + // + // (undocumented) + static cancelled(message: string): ConnectionError; + // (undocumented) + context: Variant['context']; + // Warning: (ae-forgotten-export) The symbol "InternalError" needs to be exported by the entry point core.d.ts + // + // (undocumented) + static internal(message: string, context?: { + status?: number; + statusText?: string; + }): ConnectionError; + // Warning: (ae-forgotten-export) The symbol "LeaveRequest" needs to be exported by the entry point core.d.ts + // + // (undocumented) + static leaveRequest(message: string, context: DisconnectReason): ConnectionError; + // (undocumented) + readonly name = "ConnectionError"; + // Warning: (ae-forgotten-export) The symbol "NotAllowed" needs to be exported by the entry point core.d.ts + // + // (undocumented) + static notAllowed(message: string, status: number, context?: unknown): ConnectionError; + // (undocumented) + reason: Variant['reason']; + // (undocumented) + reasonName: string; + // Warning: (ae-forgotten-export) The symbol "ServerUnreachable" needs to be exported by the entry point core.d.ts + // + // (undocumented) + static serverUnreachable(message: string, status?: number): ConnectionError; + // Warning: (ae-forgotten-export) The symbol "ServiceNotFound" needs to be exported by the entry point core.d.ts + // + // (undocumented) + static serviceNotFound(message: string, serviceName: 'v0-rtc'): ConnectionError; + // (undocumented) + status?: Variant['status']; + // Warning: (ae-forgotten-export) The symbol "ConnectionTimeout" needs to be exported by the entry point core.d.ts + // + // (undocumented) + static timeout(message: string): ConnectionError; + // Warning: (ae-forgotten-export) The symbol "WebSocket_2" needs to be exported by the entry point core.d.ts + // + // (undocumented) + static websocket(message: string, status?: number, reason?: string): ConnectionError; +} + +// @public (undocumented) +export enum ConnectionErrorReason { + // (undocumented) + Cancelled = 3, + // (undocumented) + InternalError = 2, + // (undocumented) + LeaveRequest = 4, + // (undocumented) + NotAllowed = 0, + // (undocumented) + ServerUnreachable = 1, + // (undocumented) + ServiceNotFound = 7, + // (undocumented) + Timeout = 5, + // (undocumented) + WebSocket = 6 +} + +// @public +export interface ConnectionHooks { + onDisconnect?(): void; +} + +// @public (undocumented) +export enum ConnectionQuality { + // (undocumented) + Excellent = "excellent", + // (undocumented) + Good = "good", + Lost = "lost", + // (undocumented) + Poor = "poor", + // (undocumented) + Unknown = "unknown" +} + +// @public (undocumented) +export enum ConnectionState { + // (undocumented) + Connected = "connected", + // (undocumented) + Connecting = "connecting", + // (undocumented) + Disconnected = "disconnected", + // (undocumented) + Reconnecting = "reconnecting", + // (undocumented) + SignalReconnecting = "signalReconnecting" +} + +// @public (undocumented) +class Convert { + // (undocumented) + static agentAttributesToJson(value: AgentAttributes): string; + // (undocumented) + static toAgentAttributes(json: string): AgentAttributes; + // (undocumented) + static toTranscriptionAttributes(json: string): TranscriptionAttributes; + // (undocumented) + static transcriptionAttributesToJson(value: TranscriptionAttributes): string; +} + +// Warning: (ae-forgotten-export) The symbol "CoreRoom_base" needs to be exported by the entry point core.d.ts +// +// @public +export class CoreRoom extends CoreRoom_base { + constructor(options?: CoreRoomOptions); + activeSpeakers: Participant[]; + // (undocumented) + bufferedSegments: Map; + get canPlaybackAudio(): boolean; + get canPlaybackVideo(): boolean; + // (undocumented) + static cleanupRegistry: false | FinalizationRegistry<() => void>; + // (undocumented) + connect: (url: string, token: string, opts?: RoomConnectOptions) => Promise; + disconnect: (stopTracks?: boolean) => Promise; + dispose(): Promise; + // (undocumented) + getActiveDevice(kind: MediaDeviceKind): string | undefined; + static getLocalDevices(kind?: MediaDeviceKind, requestPermissions?: boolean): Promise; + getParticipantByIdentity(identity: string): Participant | undefined; + // Warning: (ae-forgotten-export) The symbol "TypedPromise" needs to be exported by the entry point core.d.ts + getSid(): TypedPromise; + // (undocumented) + get hasE2EESetup(): boolean; + isE2EEEnabled: boolean; + get isRecording(): boolean; + localParticipant: LocalParticipant; + get metadata(): string | undefined; + get name(): string; + // (undocumented) + get numParticipants(): number; + // (undocumented) + get numPublishers(): number; + options: InternalRoomOptions; + prepareConnection(url: string, token?: string): Promise; + remoteParticipants: Map; + // (undocumented) + serverInfo?: Partial; + startAudio: () => Promise; + // (undocumented) + startVideo: () => Promise; + // (undocumented) + state: ConnectionState; + switchActiveDevice(kind: MediaDeviceKind, deviceId: string, exact?: boolean): Promise; +} + +// @public +export type CoreRoomOptions = Omit; + +// @public +export function createAudioAnalyser(track: LocalAudioTrack | RemoteAudioTrack, options?: AudioAnalyserOptions): { + calculateVolume: () => number; + analyser: AnalyserNode; + cleanup: () => Promise; +}; + +// @public (undocumented) +export function createE2EEKey(): NonSharedUint8Array; + +// @public (undocumented) +export function createKeyMaterialFromBuffer(cryptoBuffer: ArrayBuffer): Promise; + +// @public (undocumented) +export function createKeyMaterialFromString(password: string): Promise; + +// @public (undocumented) +export function createLocalAudioTrack(options?: AudioCaptureOptions): Promise; + +// @public +export function createLocalScreenTracks(options?: ScreenShareCaptureOptions): Promise>; + +// Warning: (ae-forgotten-export) The symbol "LoggerOptions" needs to be exported by the entry point core.d.ts +// +// @public +export function createLocalTracks(options?: CreateLocalTracksOptions, loggerOptions?: LoggerOptions): Promise>; + +// @public (undocumented) +export interface CreateLocalTracksOptions { + audio?: boolean | AudioCaptureOptions; + video?: boolean | VideoCaptureOptions; +} + +// @public +export function createLocalVideoTrack(options?: VideoCaptureOptions): Promise; + +// @public +export function createRoom[] = []>(options?: CoreRoomOptions, extensions?: E): CoreRoom & ExtensionApis; + +// @public +export class CriticalTimers { + // (undocumented) + static clearInterval: (...args: Parameters) => ReturnType; + // (undocumented) + static clearTimeout: (...args: Parameters) => ReturnType; + // (undocumented) + static setInterval: (...args: Parameters) => ReturnType; + // (undocumented) + static setTimeout: (...args: Parameters) => ReturnType; +} + +// @public (undocumented) +export type CryptorCallbacks = { + [CryptorEvent.Error]: (error: CryptorError) => void; +}; + +// @public (undocumented) +export class CryptorError extends LivekitError { + constructor(message?: string, reason?: CryptorErrorReason, participantIdentity?: string); + // (undocumented) + participantIdentity?: string; + // (undocumented) + reason: CryptorErrorReason; +} + +// @public (undocumented) +export enum CryptorErrorReason { + // (undocumented) + InternalError = 2, + // (undocumented) + InvalidKey = 0, + // (undocumented) + MissingKey = 1 +} + +// @public (undocumented) +export enum CryptorEvent { + // (undocumented) + Error = "cryptorError" +} + +// @public (undocumented) +export enum DataChannelKind { + // (undocumented) + DATA_TRACK_LOSSY = 2, + // (undocumented) + LOSSY = 1, + // (undocumented) + RELIABLE = 0 +} + +export { DataPacket_Kind } + +// @public +export interface DataPacketOwner { + // Warning: (ae-forgotten-export) The symbol "DataPacketCase" needs to be exported by the entry point core.d.ts + // Warning: (ae-forgotten-export) The symbol "DataPacketHandler" needs to be exported by the entry point core.d.ts + // + // (undocumented) + dataPackets?: { + [C in DataPacketCase]?: DataPacketHandler; + }; +} + +// @public (undocumented) +export type DataPublishOptions = { + reliable?: boolean; + destinationIdentities?: string[]; + topic?: string; +}; + +// @public (undocumented) +export class DataStreamError extends LivekitReasonedError { + constructor(message: string, reason: DataStreamErrorReason); + // (undocumented) + readonly name = "DataStreamError"; + // (undocumented) + reason: DataStreamErrorReason; + // (undocumented) + reasonName: string; +} + +// @public (undocumented) +export enum DataStreamErrorReason { + // (undocumented) + AbnormalEnd = 1, + // (undocumented) + AlreadyOpened = 0, + // (undocumented) + DecodeFailed = 2, + // (undocumented) + EncryptionTypeMismatch = 8, + // (undocumented) + HandlerAlreadyRegistered = 7, + // (undocumented) + HeaderTooLarge = 9, + // (undocumented) + Incomplete = 4, + // (undocumented) + LengthExceeded = 3, + // (undocumented) + PayloadTooLarge = 10 +} + +// @public +export interface DataStreamLocalParticipantApi { + sendBytes(bytes: Uint8Array, options?: SendBytesOptions): Promise; + // Warning: (ae-forgotten-export) The symbol "SendFileOptions" needs to be exported by the entry point core.d.ts + sendFile(file: File, options?: SendFileOptions): Promise<{ + id: string; + }>; + sendText(text: string, options?: SendTextOptions): Promise; + // Warning: (ae-forgotten-export) The symbol "StreamBytesOptions" needs to be exported by the entry point core.d.ts + streamBytes(options?: StreamBytesOptions): Promise; +} + +// @public +export interface DataStreamRoomApi { + // (undocumented) + registerByteStreamHandler(topic: string, callback: ByteStreamHandler): void; + // (undocumented) + registerTextStreamHandler(topic: string, callback: TextStreamHandler): void; + // (undocumented) + unregisterByteStreamHandler(topic: string): void; + // (undocumented) + unregisterTextStreamHandler(topic: string): void; +} + +// @public +export const dataStreams: ConfigurableExtension & LocalParticipantApiProvider & SlotProvider<"byteStreamOpener"> & DataPacketOwner & EngineHooks & ConnectionHooks & { +incoming: IncomingDataStreamManager; +outgoing: OutgoingDataStreamManager; +}, RoomDataStreamOptions, readonly []>; + +// Warning: (ae-forgotten-export) The symbol "DataTrackExtension" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class DataTrackE2eeExtension extends DataTrackExtension { + constructor(keyIndex: number, iv: NonSharedUint8Array); + // (undocumented) + iv: NonSharedUint8Array; + // (undocumented) + keyIndex: number; + // (undocumented) + static lengthBytes: number; + // Warning: (ae-forgotten-export) The symbol "DataTrackExtensionTag" needs to be exported by the entry point core.d.ts + // + // (undocumented) + static tag: DataTrackExtensionTag; + // (undocumented) + toBinaryInto(dataView: DataView): Throws; + // (undocumented) + toBinaryLengthBytes(): number; + // (undocumented) + toJSON(): { + tag: number; + lengthBytes: number; + keyIndex: number; + iv: Uint8Array; + }; +} + +// Warning: (ae-forgotten-export) The symbol "Serializable" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class DataTrackExtensions extends Serializable { + constructor(opts?: { + userTimestamp?: DataTrackUserTimestampExtension; + e2ee?: DataTrackE2eeExtension; + }); + // (undocumented) + e2ee?: DataTrackE2eeExtension; + // Warning: (ae-forgotten-export) The symbol "DataTrackDeserializeError" needs to be exported by the entry point core.d.ts + // Warning: (ae-forgotten-export) The symbol "DataTrackDeserializeErrorReason" needs to be exported by the entry point core.d.ts + // + // (undocumented) + static fromBinary(input: Input): Throws<[ + extensions: DataTrackExtensions, + byteLength: number + ], DataTrackDeserializeError>; + // (undocumented) + toBinaryInto(dataView: DataView): Throws; + // (undocumented) + toBinaryLengthBytes(): number; + // (undocumented) + toJSON(): { + userTimestamp: { + tag: number; + lengthBytes: number; + timestamp: bigint; + } | null; + e2ee: { + tag: number; + lengthBytes: number; + keyIndex: number; + iv: Uint8Array; + } | null; + }; + // (undocumented) + userTimestamp?: DataTrackUserTimestampExtension; +} + +// @public +export type DataTrackFrame = { + payload: NonSharedUint8Array; + userTimestamp?: bigint; +}; + +// @public +export interface DataTrackLocalParticipantApi { + // Warning: (ae-forgotten-export) The symbol "DataTrackOptions" needs to be exported by the entry point core.d.ts + publishDataTrack(options: DataTrackOptions): Promise; +} + +// @public +export class DataTrackPacket extends Serializable { + constructor(header: DataTrackPacketHeader, payload: NonSharedUint8Array); + // (undocumented) + static fromBinary(input: Input): Throws<[packet: DataTrackPacket, byteLength: number], DataTrackDeserializeError>; + // (undocumented) + header: DataTrackPacketHeader; + // (undocumented) + payload: NonSharedUint8Array; + // Warning: (ae-forgotten-export) The symbol "DataTrackSerializeError" needs to be exported by the entry point core.d.ts + // + // (undocumented) + toBinaryInto(dataView: DataView): Throws; + // (undocumented) + toBinaryLengthBytes(): number; + // (undocumented) + toJSON(): { + header: { + marker: FrameMarker; + trackHandle: number; + sequence: number; + frameNumber: number; + timestamp: number; + extensions: { + userTimestamp: { + tag: number; + lengthBytes: number; + timestamp: bigint; + } | null; + e2ee: { + tag: number; + lengthBytes: number; + keyIndex: number; + iv: Uint8Array; + } | null; + }; + }; + payload: Uint8Array; + }; +} + +// @public +export class DataTrackPacketHeader extends Serializable { + constructor(opts: { + marker: FrameMarker; + trackHandle: DataTrackHandle; + sequence: WrapAroundUnsignedInt; + frameNumber: WrapAroundUnsignedInt; + timestamp: DataTrackTimestamp<90000>; + extensions?: DataTrackExtensions; + }); + // (undocumented) + extensions: DataTrackExtensions; + // (undocumented) + frameNumber: WrapAroundUnsignedInt; + // (undocumented) + static fromBinary(input: Input): Throws<[header: DataTrackPacketHeader, byteLength: number], DataTrackDeserializeError>; + // (undocumented) + marker: FrameMarker; + // Warning: (ae-forgotten-export) The symbol "WrapAroundUnsignedInt" needs to be exported by the entry point core.d.ts + // Warning: (ae-forgotten-export) The symbol "U16_MAX_SIZE" needs to be exported by the entry point core.d.ts + // + // (undocumented) + sequence: WrapAroundUnsignedInt; + // Warning: (ae-forgotten-export) The symbol "DataTrackTimestamp" needs to be exported by the entry point core.d.ts + // + // (undocumented) + timestamp: DataTrackTimestamp<90000>; + // Warning: (ae-forgotten-export) The symbol "DataTrackSerializeErrorReason" needs to be exported by the entry point core.d.ts + // + // (undocumented) + toBinaryInto(dataView: DataView): Throws>; + // (undocumented) + toBinaryLengthBytes(): number; + // (undocumented) + toJSON(): { + marker: FrameMarker; + trackHandle: number; + sequence: number; + frameNumber: number; + timestamp: number; + extensions: { + userTimestamp: { + tag: number; + lengthBytes: number; + timestamp: bigint; + } | null; + e2ee: { + tag: number; + lengthBytes: number; + keyIndex: number; + iv: Uint8Array; + } | null; + }; + }; + // Warning: (ae-forgotten-export) The symbol "DataTrackHandle" needs to be exported by the entry point core.d.ts + // + // (undocumented) + trackHandle: DataTrackHandle; +} + +// @public +export const dataTracks: { + key: symbol; + install(room: CoreRoom, ctx: ExtensionContext): LocalParticipantApiProvider & EngineHooks & ConnectionHooks & ParticipantHooks & SyncStateProvider & { + incoming: IncomingDataTrackManager; + outgoing: OutgoingDataTrackManager; + }; +}; + +// @public (undocumented) +export type DataTrackSubscribeOptions = { + signal?: AbortSignal; + bufferSize?: number; +}; + +// @public (undocumented) +export class DataTrackUserTimestampExtension extends DataTrackExtension { + constructor(timestamp: bigint); + // (undocumented) + static lengthBytes: number; + // (undocumented) + static tag: DataTrackExtensionTag; + // (undocumented) + timestamp: bigint; + // (undocumented) + toBinaryInto(dataView: DataView): Throws; + // (undocumented) + toBinaryLengthBytes(): number; + // (undocumented) + toJSON(): { + tag: number; + lengthBytes: number; + timestamp: bigint; + }; +} + +// @public (undocumented) +export type DecodeRatchetOptions = { + ratchetCount: number; + encryptionKey?: CryptoKey; +}; + +// @public +export function decodeTokenPayload(token: string): TokenPayload; + +// @public (undocumented) +export interface DecryptDataRequestMessage extends BaseMessage { + // (undocumented) + data: { + uuid: string; + payload: NonSharedUint8Array; + iv: NonSharedUint8Array; + participantIdentity: string; + keyIndex: number; + }; + // (undocumented) + kind: 'decryptDataRequest'; +} + +// @public (undocumented) +export interface DecryptDataResponseMessage extends BaseMessage { + // (undocumented) + data: { + uuid: string; + payload: NonSharedUint8Array; + }; + // (undocumented) + kind: 'decryptDataResponse'; +} + +// @public (undocumented) +export class DefaultReconnectPolicy implements ReconnectPolicy { + constructor(retryDelays?: number[]); + // (undocumented) + nextRetryDelayInMs(context: ReconnectContext): number | null; +} + +// @public +export function defineExtension, Options, const Requires extends readonly RoomExtension[] = []>(name: string, requires: Requires, install: (room: CoreRoom, ctx: ExtensionContext, options: Options | undefined) => Result): ConfigurableExtension; + +// @public +export function deriveKeys(material: CryptoKey, options: KeyProviderOptions): Promise<{ + material: CryptoKey; + encryptionKey: CryptoKey; +}>; + +// @public (undocumented) +export type DevelopmentTokenServerOptions = { + baseUrl?: string; +}; + +// @public (undocumented) +export class DeviceUnsupportedError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "DeviceUnsupportedError"; +} + +export { DisconnectReason } + +// @public +export interface Disposable { + dispose(): void; +} + +// @public (undocumented) +export const e2ee: ConfigurableExtension & Partial> & Disposable & { +manager: BaseE2EEManager | undefined; +}, E2EEManagerOptions | { +e2eeManager: BaseE2EEManager; +}, readonly []>; + +// @public (undocumented) +export type E2EEManagerCallbacks = { + [EncryptionEvent.ParticipantEncryptionStatusChanged]: (enabled: boolean, participant: Participant) => void; + [EncryptionEvent.EncryptionError]: (error: Error, participantIdentity?: string) => void; +}; + +// @public (undocumented) +export type E2EEManagerOptions = { + keyProvider: BaseKeyProvider; + worker: Worker; +}; + +// @public (undocumented) +export type E2EEOptions = E2EEManagerOptions | { + e2eeManager: BaseE2EEManager; +}; + +// @public +export interface E2eeRoomApi { + // (undocumented) + setE2EEEnabled(enabled: boolean): Promise; +} + +// @public (undocumented) +export type E2EEWorkerMessage = InitMessage | SetKeyMessage | EncodeMessage | ErrorMessage | EnableMessage | RemoveTransformMessage | RTPVideoMapMessage | UpdateCodecMessage | RatchetRequestMessage | RatchetMessage | SifTrailerMessage | InitAck | DecryptDataRequestMessage | DecryptDataResponseMessage | EncryptDataRequestMessage | EncryptDataResponseMessage | PTMetadataFromE2EEMessage | LogMessage | SetLogLevelMessage; + +// @public (undocumented) +export interface ElementInfo { + // (undocumented) + element: object; + // (undocumented) + handleResize?: () => void; + // (undocumented) + handleVisibilityChanged?: () => void; + // (undocumented) + height(): number; + // (undocumented) + observe(): void; + // (undocumented) + pictureInPicture: boolean; + // (undocumented) + stopObserving(): void; + // (undocumented) + visibilityChangedAt: number | undefined; + // (undocumented) + visible: boolean; + // (undocumented) + width(): number; +} + +// @public (undocumented) +export interface EnableMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity: string; + enabled: boolean; + }; + // (undocumented) + kind: 'enable'; +} + +// @public (undocumented) +export interface EncodeMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity: string; + readableStream: ReadableStream; + writableStream: WritableStream; + trackId: string; + codec?: VideoCodec; + hasPacketTrailer: boolean; + packetTrailer?: FrameMetadataPublishOptions; + }; + // (undocumented) + kind: 'decode' | 'encode'; +} + +// @public (undocumented) +export interface EncryptDataRequestMessage extends BaseMessage { + // (undocumented) + data: { + uuid: string; + payload: NonSharedUint8Array; + participantIdentity: string; + }; + // (undocumented) + kind: 'encryptDataRequest'; +} + +// @public (undocumented) +export interface EncryptDataResponseMessage extends BaseMessage { + // (undocumented) + data: { + uuid: string; + payload: NonSharedUint8Array; + iv: NonSharedUint8Array; + keyIndex: number; + }; + // (undocumented) + kind: 'encryptDataResponse'; +} + +export { Encryption_Type } + +// @public (undocumented) +export enum EncryptionEvent { + // (undocumented) + EncryptionError = "encryptionError", + // (undocumented) + ParticipantEncryptionStatusChanged = "participantEncryptionStatusChanged" +} + +// @public (undocumented) +export type EndpointOptions = Omit; + +// @public +export interface EngineHooks { + onEngineCreated?(engine: RTCEngine): void; +} + +// @public (undocumented) +export interface ErrorMessage extends BaseMessage { + // (undocumented) + data: { + error: Error; + participantIdentity?: string; + uuid?: string; + }; + // (undocumented) + kind: 'error'; +} + +// Warning: (ae-forgotten-export) The symbol "UnionToIntersection" needs to be exported by the entry point core.d.ts +// Warning: (ae-forgotten-export) The symbol "ApiOf" needs to be exported by the entry point core.d.ts +// Warning: (ae-forgotten-export) The symbol "All" needs to be exported by the entry point core.d.ts +// +// @public +export type ExtensionApis = UnionToIntersection>> & { + localParticipant: UnionToIntersection>>; +}; + +// @public +export interface ExtensionContext { + acquireEmptyAudioStreamTrack(): MediaStreamTrack; + get>(ext: E): ReturnType; + getOrCreateParticipant(identity: string, info: ParticipantInfo): RemoteParticipant; + // Warning: (ae-forgotten-export) The symbol "StructuredLogger" needs to be exported by the entry point core.d.ts + // + // (undocumented) + log: StructuredLogger; + simulateConnected(roomInfo: Room, localParticipantInfo: ParticipantInfo): void; + // Warning: (ae-forgotten-export) The symbol "CoreSlots" needs to be exported by the entry point core.d.ts + slot(slot: K): CoreSlots[K] | undefined; +} + +// @public +export type ExtensionResult = Partial & LocalParticipantApiProvider & Disposable> & EngineHooks & ConnectionHooks & ParticipantHooks & DataPacketOwner & Partial & SyncStateProvider; + +// @public +export class ExternalE2EEKeyProvider extends BaseKeyProvider { + constructor(options?: Partial>); + // (undocumented) + ratchetInterval: number | undefined; + setKey(key: string | ArrayBuffer): Promise; +} + +// Warning: (ae-forgotten-export) The symbol "FacingModeFromLocalTrackReturnValue" needs to be exported by the entry point core.d.ts +// +// @public +export function facingModeFromDeviceLabel(deviceLabel: string): FacingModeFromLocalTrackReturnValue | undefined; + +// Warning: (ae-forgotten-export) The symbol "FacingModeFromLocalTrackOptions" needs to be exported by the entry point core.d.ts +// +// @public +export function facingModeFromLocalTrack(localTrack: LocalTrack | MediaStreamTrack, options?: FacingModeFromLocalTrackOptions): FacingModeFromLocalTrackReturnValue; + +// @public (undocumented) +export interface FrameMetadata { + // (undocumented) + frameId: number; + // (undocumented) + userData?: Uint8Array; + // (undocumented) + userTimestamp: bigint; +} + +// @public +export const frameMetadata: ConfigurableExtension> & Disposable & { +manager: FrameMetadataManager; +}, FrameMetadataOptions, readonly []>; + +// @public +export class FrameMetadataManager { + constructor(options?: FrameMetadataOptions); + dispose(): void; +} + +// @public (undocumented) +export interface FrameMetadataOptions { + worker: Worker; +} + +// @public (undocumented) +export interface FrameMetadataPublishOptions { + // (undocumented) + frameId?: boolean; + // (undocumented) + timestamp?: boolean; +} + +// Warning: (ae-forgotten-export) The symbol "BrowserDetails" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export function getBrowser(userAgent?: string, force?: boolean): BrowserDetails | undefined; + +// @public +export function getEmptyAudioStreamTrack(): MediaStreamTrack; + +// @public (undocumented) +export function getEmptyVideoStreamTrack(): MediaStreamTrack; + +// Warning: (ae-forgotten-export) The symbol "ContextProvider" needs to be exported by the entry point core.d.ts +// +// @public +export function getLogger(name: string, ctxFn?: ContextProvider): StructuredLogger; + +// @public (undocumented) +export function importKey(keyBytes: NonSharedUint8Array | ArrayBuffer, algorithm?: string | { + name: string; +}, usage?: 'derive' | 'encrypt'): Promise; + +// @public (undocumented) +export interface InitAck extends BaseMessage { + // (undocumented) + data: { + enabled: boolean; + }; + // (undocumented) + kind: 'initAck'; +} + +// @public (undocumented) +export interface InitMessage extends BaseMessage { + // (undocumented) + data: { + keyProviderOptions: KeyProviderOptions; + loglevel: LogLevel; + }; + // (undocumented) + kind: 'init'; +} + +// @public +export function installExtensions(room: CoreRoom, extensions: readonly RoomExtension[]): void; + +// @public (undocumented) +export type InstantiableCheck = { + new (url: string, token: string, options?: CheckerOptions): T; +}; + +// @public +export interface InternalRoomConnectOptions { + autoSubscribe: boolean; + disableIceLite: boolean; + maxRetries: number; + peerConnectionTimeout: number; + rtcConfig?: RTCConfiguration; + subscriberAllowPause?: boolean; + websocketTimeout: number; +} + +// @public +export interface InternalRoomOptions { + adaptiveStream: AdaptiveStreamSettings | boolean; + audioCaptureDefaults?: AudioCaptureOptions; + audioOutput?: AudioOutputOptions; + dataStream?: RoomDataStreamOptions; + disconnectOnPageLeave: boolean; + dynacast: boolean; + // @deprecated (undocumented) + e2ee?: E2EEOptions; + encryption?: E2EEOptions; + frameMetadata?: FrameMetadataOptions; + // (undocumented) + loggerName?: string; + // @deprecated (undocumented) + packetTrailer?: FrameMetadataOptions; + publishDefaults?: TrackPublishDefaults; + reconnectPolicy: ReconnectPolicy; + singlePeerConnection: boolean; + stopLocalTrackOnUnpublish: boolean; + videoCaptureDefaults?: VideoCaptureOptions; + webAudioMix: boolean | WebAudioSettings; +} + +// @public (undocumented) +export function isAudioCodec(maybeCodec: string): maybeCodec is AudioCodec; + +// @public (undocumented) +export function isAudioTrack(track: Track | undefined): track is LocalAudioTrack | RemoteAudioTrack; + +// @public (undocumented) +export function isBackupVideoCodec(codec: string): codec is BackupVideoCodec; + +// @public (undocumented) +export function isBrowserSupported(): boolean; + +// @public (undocumented) +export function isE2EESupported(): boolean; + +// @public (undocumented) +export function isInsertableStreamSupported(): boolean; + +// @public (undocumented) +export function isLocalParticipant(p: Participant): p is LocalParticipant; + +// @public (undocumented) +export function isLocalTrack(track: Track | MediaStreamTrack | undefined): track is LocalTrack; + +// @public (undocumented) +export function isRemoteParticipant(p: Participant): p is RemoteParticipant; + +// @public (undocumented) +export function isRemoteTrack(track: Track | undefined): track is RemoteTrack; + +// @public (undocumented) +export function isScriptTransformSupported(): boolean; + +// Warning: (ae-incompatible-release-tags) The symbol "isSerializer" is marked as @public, but its signature references "Serializer" which is marked as @beta +// +// @public (undocumented) +export function isSerializer(v: unknown): v is Serializer; + +// @public (undocumented) +export function isSVCCodec(codec?: string): boolean; + +// @public (undocumented) +export function isVideoCodec(maybeCodec: string): maybeCodec is VideoCodec; + +// @public (undocumented) +export function isVideoFrame(frame: RTCEncodedAudioFrame | RTCEncodedVideoFrame): frame is RTCEncodedVideoFrame; + +// @public (undocumented) +export function isVideoTrack(track: Track | undefined): track is LocalVideoTrack | RemoteVideoTrack; + +// @public (undocumented) +export enum KeyHandlerEvent { + KeyRatcheted = "keyRatcheted" +} + +// @public (undocumented) +export type KeyInfo = { + key: CryptoKey; + participantIdentity?: string; + keyIndex?: number; +}; + +// @public (undocumented) +export type KeyProviderCallbacks = { + [KeyProviderEvent.SetKey]: (keyInfo: KeyInfo, updateCurrentKeyIndex: boolean) => void; + [KeyProviderEvent.RatchetRequest]: (participantIdentity?: string, keyIndex?: number) => void; + [KeyProviderEvent.KeyRatcheted]: (ratchetedResult: RatchetResult, participantIdentity?: string, keyIndex?: number) => void; +}; + +// @public (undocumented) +export enum KeyProviderEvent { + KeyRatcheted = "keyRatcheted", + RatchetRequest = "ratchetRequest", + // (undocumented) + SetKey = "setKey" +} + +// @public (undocumented) +export type KeyProviderOptions = { + sharedKey: boolean; + ratchetSalt: string; + ratchetWindowSize: number; + failureTolerance: number; + keyringSize: number; + keySize: 128 | 256; +}; + +// @public (undocumented) +export type KeySet = { + material: CryptoKey; + encryptionKey: CryptoKey; +}; + +// @public +export class LivekitError extends Error { + constructor(code: number, message?: string, options?: { + cause?: unknown; + }); + // (undocumented) + cause?: unknown; + // (undocumented) + code: number; +} + +// @public (undocumented) +export type LiveKitReactNativeInfo = { + platform: 'ios' | 'android' | 'windows' | 'macos' | 'web' | 'native'; + devicePixelRatio: number; +}; + +// @public +export abstract class LivekitReasonedError extends LivekitError { + // (undocumented) + abstract reason: Reason; + // (undocumented) + abstract reasonName: string; +} + +// @public (undocumented) +export class LocalAudioTrack extends LocalTrack { + constructor(mediaTrack: MediaStreamTrack, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, audioContext?: AudioContext, loggerOptions?: LoggerOptions); + // (undocumented) + applyConstraints(constraints: Pick): Promise; + // (undocumented) + checkForSilence(): Promise; + get enhancedNoiseCancellation(): boolean; + // (undocumented) + getSenderStats(): Promise; + // (undocumented) + protected internalStopProcessor(keepElement?: boolean): Promise; + // (undocumented) + protected monitorSender: () => Promise; + // (undocumented) + mute(): Promise; + // (undocumented) + protected onMediaStreamTrackChanged(): Promise; + // (undocumented) + protected processor?: TrackProcessor | undefined; + // (undocumented) + protected restart(constraints?: MediaTrackConstraints, isUnmuting?: boolean): Promise; + // (undocumented) + restartTrack(options?: AudioCaptureOptions): Promise; + setProcessor(processor: TrackProcessor): Promise; + // (undocumented) + stop(): void; + // (undocumented) + unmute(): Promise; +} + +// Warning: (ae-forgotten-export) The symbol "ILocalTrack" needs to be exported by the entry point core.d.ts +// Warning: (ae-forgotten-export) The symbol "IDataTrack" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class LocalDataTrack implements ILocalTrack, IDataTrack { + // Warning: (ae-forgotten-export) The symbol "Descriptor" needs to be exported by the entry point core.d.ts + protected get descriptor(): Descriptor | null; + flush(): Promise; + // Warning: (ae-forgotten-export) The symbol "Future" needs to be exported by the entry point core.d.ts + protected flushedFuture: Future; + protected handle: DataTrackHandle | null; + // Warning: (ae-forgotten-export) The symbol "DataTrackInfo" needs to be exported by the entry point core.d.ts + get info(): DataTrackInfo | undefined; + // (undocumented) + protected isFlushed: boolean; + // (undocumented) + readonly isLocal = true; + // (undocumented) + isPublished(): this is { + info: DataTrackInfo; + }; + // (undocumented) + protected log: StructuredLogger; + // (undocumented) + protected manager: OutgoingDataTrackManager; + // (undocumented) + protected options: DataTrackOptions; + // (undocumented) + readonly trackSymbol: symbol; + // Warning: (ae-forgotten-export) The symbol "DataTrackPushFrameError" needs to be exported by the entry point core.d.ts + // Warning: (ae-forgotten-export) The symbol "DataTrackPushFrameErrorReason" needs to be exported by the entry point core.d.ts + // Warning: (ae-forgotten-export) The symbol "DataTrackPushFrameErrorReason" needs to be exported by the entry point core.d.ts + tryPush(frame: DataTrackFrame): Promise | DataTrackPushFrameError>>; + // (undocumented) + readonly typeSymbol: symbol; + unpublish(): Promise; +} + +// @public (undocumented) +export class LocalParticipant extends Participant { + // (undocumented) + audioTrackPublications: Map; + createTracks(options?: CreateLocalTracksOptions): Promise; + // (undocumented) + getTrackPublication(source: Track.Source): LocalTrackPublication | undefined; + // (undocumented) + getTrackPublicationByName(name: string): LocalTrackPublication | undefined; + // (undocumented) + get isE2EEEnabled(): boolean; + // (undocumented) + get isLocal(): boolean; + // (undocumented) + get lastCameraError(): Error | undefined; + // (undocumented) + get lastMicrophoneError(): Error | undefined; + publishData(data: NonSharedUint8Array, options?: DataPublishOptions): Promise; + publishDtmf(code: number, digit: string): Promise; + publishTrack(track: LocalTrack | MediaStreamTrack, options?: TrackPublishOptions): Promise; + // (undocumented) + republishAllTracks(options?: TrackPublishOptions, restartTracks?: boolean): Promise; + setAttributes(attributes: Record): Promise; + setMetadata(metadata: string): Promise; + setMicrophoneEnabled(enabled: boolean, options?: AudioCaptureOptions, publishOptions?: TrackPublishOptions): Promise; + setName(name: string): Promise; + // (undocumented) + setTrackEnabled(source: Extract, enabled: boolean, options?: AudioCaptureOptions, publishOptions?: TrackPublishOptions): Promise; + // (undocumented) + setTrackEnabled(source: Extract, enabled: boolean, options?: ScreenShareCaptureOptions, publishOptions?: TrackPublishOptions): Promise; + setTrackSubscriptionPermissions(allParticipantsAllowed: boolean, participantTrackPermissions?: ParticipantTrackPermission[]): void; + trackPublications: Map; + // (undocumented) + unpublishTrack(track: LocalTrack | MediaStreamTrack, stopOnUnpublish?: boolean): Promise; + // (undocumented) + unpublishTracks(tracks: LocalTrack[] | MediaStreamTrack[]): Promise; + // (undocumented) + videoTrackPublications: Map; +} + +// @public +export interface LocalParticipantApiProvider { + // (undocumented) + localParticipant: LocalParticipantApi; +} + +// @public (undocumented) +export abstract class LocalTrack extends Track { + protected constructor(mediaTrack: MediaStreamTrack, kind: TrackKind, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, loggerOptions?: LoggerOptions); + // (undocumented) + protected audioContext?: AudioContext; + // (undocumented) + get constraints(): MediaTrackConstraints; + // (undocumented) + protected _constraints: MediaTrackConstraints; + // (undocumented) + get dimensions(): Track.Dimensions | undefined; + // (undocumented) + getDeviceId(normalize?: boolean): Promise; + // (undocumented) + getPreConnectBufferMimeType(): string | undefined; + getProcessor(): TrackProcessor | undefined; + getRTCStatsReport(): Promise; + // (undocumented) + protected handleAppVisibilityChanged(): Promise; + // (undocumented) + get hasPreConnectBuffer(): boolean; + // (undocumented) + get id(): string; + // (undocumented) + get isLocal(): boolean; + // (undocumented) + get isStopped(): boolean; + // (undocumented) + get isUpstreamPaused(): boolean; + // (undocumented) + get isUserProvided(): boolean; + // (undocumented) + protected localTrackRecorder: LocalTrackRecorder | undefined; + // (undocumented) + protected manuallyStopped: boolean; + // (undocumented) + get mediaStreamTrack(): MediaStreamTrack; + // (undocumented) + protected abstract monitorSender(): void; + // (undocumented) + mute(): Promise; + // (undocumented) + protected muteLock: Mutex; + // (undocumented) + protected get needsReAcquisition(): boolean; + protected onMediaStreamTrackChanged(): Promise; + protected onSenderTrackSwapped(): Promise; + pauseUpstream(): Promise; + // (undocumented) + protected pauseUpstreamLock: Mutex; + // (undocumented) + protected pendingDeviceChange: boolean; + // (undocumented) + protected processor?: TrackProcessor; + // (undocumented) + protected processorElement?: HTMLMediaElement; + // (undocumented) + protected providedByUser: boolean; + // (undocumented) + protected reacquireTrack: boolean; + // (undocumented) + replaceTrack(track: MediaStreamTrack, options?: ReplaceTrackOptions): Promise; + // (undocumented) + replaceTrack(track: MediaStreamTrack, userProvidedTrack?: boolean): Promise; + // (undocumented) + protected restart(constraints?: MediaTrackConstraints, isUnmuting?: boolean): Promise; + // (undocumented) + abstract restartTrack(constraints?: unknown): Promise; + // (undocumented) + resumeUpstream(): Promise; + // (undocumented) + protected _sender?: RTCRtpSender; + // (undocumented) + setDeviceId(deviceId: ConstrainDOMString): Promise; + setProcessor(processor: TrackProcessor, showProcessedStreamLocally?: boolean): Promise; + // (undocumented) + protected setTrackMuted(muted: boolean): void; + // (undocumented) + stop(): void; + stopProcessor(keepElement?: boolean): Promise; + // (undocumented) + protected trackChangeLock: Mutex; + // (undocumented) + unmute(): Promise; + // (undocumented) + waitForDimensions(timeout?: number): Promise; +} + +// @public (undocumented) +export class LocalTrackPublication extends TrackPublication { + constructor(kind: Track.Kind, ti: TrackInfo, track?: LocalTrack, loggerOptions?: LoggerOptions); + // (undocumented) + get audioTrack(): LocalAudioTrack | undefined; + // (undocumented) + getTrackFeatures(): AudioTrackFeature[]; + // (undocumented) + handleTrackEnded: () => void; + // (undocumented) + get isLocal(): boolean; + // (undocumented) + get isMuted(): boolean; + // (undocumented) + get isUpstreamPaused(): boolean | undefined; + mute(): Promise | undefined>; + // (undocumented) + options?: TrackPublishOptions; + pauseUpstream(): Promise; + resumeUpstream(): Promise; + // (undocumented) + setTrack(track?: Track): void; + // (undocumented) + track?: LocalTrack; + unmute(): Promise | undefined>; + // (undocumented) + get videoTrack(): LocalVideoTrack | undefined; +} + +// Warning: (ae-forgotten-export) The symbol "RecorderBase" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class LocalTrackRecorder extends RecorderBase { + constructor(track: T, options?: MediaRecorderOptions); + // (undocumented) + byteStream: ReadableStream; +} + +// @public (undocumented) +export class LocalVideoTrack extends LocalTrack { + constructor(mediaTrack: MediaStreamTrack, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, loggerOptions?: LoggerOptions); + // Warning: (ae-forgotten-export) The symbol "SimulcastTrackInfo" needs to be exported by the entry point core.d.ts + // + // (undocumented) + addSimulcastTrack(codec: VideoCodec, encodings?: RTCRtpEncodingParameters[]): SimulcastTrackInfo | undefined; + // (undocumented) + getSenderStats(): Promise; + // (undocumented) + protected handleAppVisibilityChanged(): Promise; + // (undocumented) + get isSimulcast(): boolean; + // (undocumented) + protected monitorSender: () => Promise; + // (undocumented) + mute(): Promise; + // (undocumented) + protected onSenderTrackSwapped(): Promise; + // (undocumented) + pauseUpstream(): Promise; + prioritizePerformance(): Promise; + // (undocumented) + refreshSubscribedCodecs(): Promise; + // (undocumented) + restartTrack(options?: VideoCaptureOptions): Promise; + // (undocumented) + resumeUpstream(): Promise; + // (undocumented) + get sender(): RTCRtpSender | undefined; + set sender(sender: RTCRtpSender | undefined); + // (undocumented) + setDegradationPreference(preference: RTCDegradationPreference): Promise; + setProcessor(processor: TrackProcessor, showProcessedStreamLocally?: boolean): Promise; + // (undocumented) + setPublishingQuality(maxQuality: VideoQuality): void; + // (undocumented) + setSimulcastTrackSender(codec: VideoCodec, sender: RTCRtpSender): Promise; + // (undocumented) + protected setTrackMuted(muted: boolean): void; + // (undocumented) + stop(): void; + // (undocumented) + unmute(): Promise; +} + +// @public (undocumented) +export enum LoggerNames { + // (undocumented) + DataTracks = "livekit-data-tracks", + // (undocumented) + Default = "livekit", + // (undocumented) + E2EE = "lk-e2ee", + // (undocumented) + Engine = "livekit-engine", + // (undocumented) + ICE = "livekit-ice", + // (undocumented) + Participant = "livekit-participant", + // (undocumented) + PCManager = "livekit-pc-manager", + // (undocumented) + PCTransport = "livekit-pc-transport", + // (undocumented) + Publication = "livekit-track-publication", + // (undocumented) + Region = "livekit-region", + // (undocumented) + Room = "livekit-room", + // (undocumented) + Signal = "livekit-signal", + // (undocumented) + Stats = "livekit-stats", + // (undocumented) + TokenSource = "livekit-token-source", + // (undocumented) + Track = "livekit-track" +} + +// @public (undocumented) +export enum LogLevel { + // (undocumented) + debug = 1, + // (undocumented) + error = 4, + // (undocumented) + info = 2, + // (undocumented) + silent = 5, + // (undocumented) + trace = 0, + // (undocumented) + warn = 3 +} + +// @public (undocumented) +export interface LogMessage extends BaseMessage { + // (undocumented) + data: { + level: 'trace' | 'debug' | 'info' | 'warn' | 'error'; + msg: string; + context?: object; + }; + // (undocumented) + kind: 'log'; +} + +// @public (undocumented) +export enum MediaDeviceFailure { + // (undocumented) + DeviceInUse = "DeviceInUse", + // (undocumented) + NotFound = "NotFound", + // (undocumented) + Other = "Other", + // (undocumented) + PermissionDenied = "PermissionDenied" +} + +// @public (undocumented) +export namespace MediaDeviceFailure { + // (undocumented) + export function getFailure(error: any): MediaDeviceFailure | undefined; +} + +export { Mutex } + +// @public (undocumented) +export function needsRbspUnescaping(frameData: NonSharedUint8Array): boolean; + +// @public (undocumented) +export class NegotiationError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "NegotiationError"; +} + +// @public (undocumented) +export function parseRbsp(stream: NonSharedUint8Array): NonSharedUint8Array; + +// Warning: (ae-forgotten-export) The symbol "Participant_base" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class Participant extends Participant_base { + // (undocumented) + protected activeFuture?: Future; + // (undocumented) + protected addTrackPublication(publication: TrackPublication): void; + get attributes(): Readonly>; + audioLevel: number; + // (undocumented) + audioTrackPublications: Map; + // (undocumented) + get connectionQuality(): ConnectionQuality; + getTrackPublication(source: Track.Source): TrackPublication | undefined; + getTrackPublicationByName(name: string): TrackPublication | undefined; + // (undocumented) + getTrackPublications(): TrackPublication[]; + identity: string; + // (undocumented) + get isActive(): boolean; + // (undocumented) + get isAgent(): boolean; + // (undocumented) + get isCameraEnabled(): boolean; + // (undocumented) + get isEncrypted(): boolean; + // (undocumented) + get isLocal(): boolean; + // (undocumented) + get isMicrophoneEnabled(): boolean; + // (undocumented) + get isScreenShareEnabled(): boolean; + isSpeaking: boolean; + get joinedAt(): Date | undefined; + // (undocumented) + get kind(): ParticipantKind; + // (undocumented) + protected _kind: ParticipantKind; + // (undocumented) + lastSpokeAt?: Date | undefined; + // (undocumented) + protected log: StructuredLogger; + // (undocumented) + protected get logContext(): { + [x: string]: unknown; + }; + // (undocumented) + protected loggerOptions?: LoggerOptions; + metadata?: string; + name?: string; + // (undocumented) + protected participantInfo?: ParticipantInfo; + // (undocumented) + permissions?: ParticipantPermission; + sid: string; + trackPublications: Map; + // (undocumented) + videoTrackPublications: Map; + waitUntilActive(): Promise; +} + +// @public (undocumented) +export enum ParticipantEvent { + Active = "active", + AttributesChanged = "attributesChanged", + ChatMessage = "chatMessage", + ConnectionQualityChanged = "connectionQualityChanged", + DataReceived = "dataReceived", + IsSpeakingChanged = "isSpeakingChanged", + LocalTrackCpuConstrained = "localTrackCpuConstrained", + LocalTrackPublished = "localTrackPublished", + LocalTrackSubscribed = "localTrackSubscribed", + LocalTrackUnpublished = "localTrackUnpublished", + ParticipantMetadataChanged = "participantMetadataChanged", + ParticipantNameChanged = "participantNameChanged", + ParticipantPermissionsChanged = "participantPermissionsChanged", + SipDTMFReceived = "sipDTMFReceived", + TrackCpuConstrained = "trackCpuConstrained", + TrackMuted = "trackMuted", + TrackPublished = "trackPublished", + TrackStreamStateChanged = "trackStreamStateChanged", + TrackSubscribed = "trackSubscribed", + TrackSubscriptionFailed = "trackSubscriptionFailed", + TrackSubscriptionPermissionChanged = "trackSubscriptionPermissionChanged", + TrackSubscriptionStatusChanged = "trackSubscriptionStatusChanged", + TrackUnmuted = "trackUnmuted", + TrackUnpublished = "trackUnpublished", + TrackUnsubscribed = "trackUnsubscribed", + // @beta + TranscriptionReceived = "transcriptionReceived" +} + +// @public (undocumented) +export type ParticipantEventCallbacks = { + trackPublished: (publication: RemoteTrackPublication) => void; + trackSubscribed: (track: RemoteTrack, publication: RemoteTrackPublication) => void; + trackSubscriptionFailed: (trackSid: string, reason?: SubscriptionError) => void; + trackUnpublished: (publication: RemoteTrackPublication) => void; + trackUnsubscribed: (track: RemoteTrack, publication: RemoteTrackPublication) => void; + trackMuted: (publication: TrackPublication) => void; + trackUnmuted: (publication: TrackPublication) => void; + localTrackPublished: (publication: LocalTrackPublication) => void; + localTrackUnpublished: (publication: LocalTrackPublication) => void; + localTrackCpuConstrained: (track: LocalVideoTrack, publication: LocalTrackPublication) => void; + localSenderCreated: (sender: RTCRtpSender, track: Track) => void; + participantMetadataChanged: (prevMetadata: string | undefined, participant?: any) => void; + participantNameChanged: (name: string) => void; + dataReceived: (payload: NonSharedUint8Array, kind: DataPacket_Kind, encryptionType?: Encryption_Type) => void; + sipDTMFReceived: (dtmf: SipDTMF) => void; + transcriptionReceived: (transcription: TranscriptionSegment[], publication?: TrackPublication) => void; + isSpeakingChanged: (speaking: boolean) => void; + connectionQualityChanged: (connectionQuality: ConnectionQuality) => void; + trackStreamStateChanged: (publication: RemoteTrackPublication, streamState: Track.StreamState) => void; + trackSubscriptionPermissionChanged: (publication: RemoteTrackPublication, status: TrackPublication.PermissionStatus) => void; + mediaDevicesError: (error: Error, kind?: MediaDeviceKind) => void; + audioStreamAcquired: () => void; + participantPermissionsChanged: (prevPermissions?: ParticipantPermission) => void; + trackSubscriptionStatusChanged: (publication: RemoteTrackPublication, status: TrackPublication.SubscriptionStatus) => void; + attributesChanged: (changedAttributes: Record) => void; + localTrackSubscribed: (trackPublication: LocalTrackPublication) => void; + chatMessage: (msg: ChatMessage) => void; + active: () => void; +}; + +// @public +export interface ParticipantHooks { + onParticipantCreated?(participant: RemoteParticipant, info: ParticipantInfo): void; + onParticipantUpdates?(infos: ParticipantInfo[]): void; +} + +// @public (undocumented) +export type ParticipantKeyHandlerCallbacks = { + [KeyHandlerEvent.KeyRatcheted]: (ratchetResult: RatchetResult, participantIdentity: string, keyIndex?: number) => void; +}; + +export { ParticipantKind } + +// @public (undocumented) +export interface ParticipantTrackPermission { + allowAll?: boolean; + allowedTrackSids?: string[]; + participantIdentity?: string; + participantSid?: string; +} + +// @public +export interface PerformRpcParams { + destinationIdentity: string; + method: string; + payload: string; + responseTimeout?: number; +} + +// @public (undocumented) +export type ProcessorOptions = { + kind: T; + track: MediaStreamTrack; + element?: HTMLMediaElement; + audioContext?: AudioContext; + localTrack?: LocalTrack; +}; + +// @public (undocumented) +export const protocolVersion = 17; + +// @public (undocumented) +export interface PTMetadataFromE2EEMessage extends BaseMessage { + // Warning: (ae-forgotten-export) The symbol "FrameMetadataPayload" needs to be exported by the entry point core.d.ts + // + // (undocumented) + data: FrameMetadataPayload; + // (undocumented) + kind: 'packetTrailerMetadata'; +} + +// @public (undocumented) +export type PublicationEventCallbacks = { + muted: () => void; + unmuted: () => void; + ended: (track?: Track) => void; + updateSettings: (settings: UpdateTrackSettings) => void; + subscriptionPermissionChanged: (status: TrackPublication.PermissionStatus, prevStatus: TrackPublication.PermissionStatus) => void; + updateSubscription: (sub: UpdateSubscription) => void; + subscribed: (track: RemoteTrack) => void; + unsubscribed: (track: RemoteTrack) => void; + subscriptionStatusChanged: (status: TrackPublication.SubscriptionStatus, prevStatus: TrackPublication.SubscriptionStatus) => void; + subscriptionFailed: (error: SubscriptionError) => void; + transcriptionReceived: (transcription: TranscriptionSegment[]) => void; + timeSyncUpdate: (timestamp: number) => void; + cpuConstrained: (track: LocalVideoTrack) => void; +}; + +// @public (undocumented) +export class PublishDataError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "PublishDataError"; +} + +// @public (undocumented) +export class PublishTrackError extends LivekitError { + constructor(message: string, status: number); + // (undocumented) + readonly name = "PublishTrackError"; + // (undocumented) + status: number; +} + +// @public +export function ratchet(material: CryptoKey, salt: string): Promise; + +// @public (undocumented) +export interface RatchetMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity: string; + keyIndex?: number; + ratchetResult: RatchetResult; + }; + // (undocumented) + kind: 'ratchetKey'; +} + +// @public (undocumented) +export interface RatchetRequestMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity?: string; + keyIndex?: number; + }; + // (undocumented) + kind: 'ratchetRequest'; +} + +// @public (undocumented) +export type RatchetResult = { + chainKey: ArrayBuffer; + cryptoKey: CryptoKey; +}; + +// @public (undocumented) +export interface ReconnectContext { + readonly elapsedMs: number; + readonly retryCount: number; + readonly retryReason?: Error; + // (undocumented) + readonly serverUrl?: string; +} + +// @public +export interface ReconnectPolicy { + nextRetryDelayInMs(context: ReconnectContext): number | null; +} + +// @public +export function registerVideoCapture(): void; + +// @public +export function releaseEmptyAudioStreamTrack(track: MediaStreamTrack): Promise; + +// @public (undocumented) +export class RemoteAudioTrack extends RemoteTrack { + constructor(mediaTrack: MediaStreamTrack, sid: string, receiver: RTCRtpReceiver, audioContext?: AudioContext, audioOutput?: AudioOutputOptions, loggerOptions?: LoggerOptions); + // (undocumented) + attach(): HTMLMediaElement; + // (undocumented) + attach(element: HTMLMediaElement): HTMLMediaElement; + detach(): HTMLMediaElement[]; + detach(element: HTMLMediaElement): HTMLMediaElement; + // (undocumented) + getReceiverStats(): Promise; + getVolume(): number; + // (undocumented) + protected monitorReceiver: () => Promise; + setSinkId(deviceId: string): Promise; + setVolume(volume: number): void; +} + +// Warning: (ae-forgotten-export) The symbol "IRemoteTrack" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class RemoteDataTrack implements IRemoteTrack, IDataTrack { + // (undocumented) + info: DataTrackInfo; + // (undocumented) + readonly isLocal = false; + // (undocumented) + protected manager: IncomingDataTrackManager; + // (undocumented) + publisherIdentity: Participant['identity']; + setPipelineOptions(options: RemoteDataTrackPipelineOptions): void; + subscribe(options?: DataTrackSubscribeOptions): ReadableStream; + // (undocumented) + readonly trackSymbol: symbol; + // (undocumented) + readonly typeSymbol: symbol; +} + +// @public (undocumented) +export type RemoteDataTrackPipelineOptions = { + maxPartialFrames?: number; +}; + +// @public (undocumented) +export class RemoteParticipant extends Participant { + // (undocumented) + protected addTrackPublication(publication: RemoteTrackPublication): void; + // (undocumented) + audioTrackPublications: Map; + // Warning: (ae-forgotten-export) The symbol "DeferrableMap" needs to be exported by the entry point core.d.ts + dataTracks: DeferrableMap; + // (undocumented) + getTrackPublication(source: Track.Source): RemoteTrackPublication | undefined; + // (undocumented) + getTrackPublicationByName(name: string): RemoteTrackPublication | undefined; + getVolume(source?: Track.Source.Microphone | Track.Source.ScreenShareAudio): number | undefined; + // (undocumented) + protected get logContext(): { + remoteParticipantID: string; + remoteParticipant: string; + }; + setVolume(volume: number, source?: Track.Source.Microphone | Track.Source.ScreenShareAudio): void; + // (undocumented) + trackPublications: Map; + // (undocumented) + videoTrackPublications: Map; +} + +// @public (undocumented) +export abstract class RemoteTrack extends Track { + constructor(mediaTrack: MediaStreamTrack, sid: string, kind: TrackKind, receiver: RTCRtpReceiver, loggerOptions?: LoggerOptions); + getPlayoutDelay(): number; + getRTCStatsReport(): Promise; + // (undocumented) + get isLocal(): boolean; + // (undocumented) + protected abstract monitorReceiver(): void; + // (undocumented) + registerTimeSyncUpdate(): void; + setPlayoutDelay(delayInSeconds: number): void; + // (undocumented) + start(): void; + // (undocumented) + stop(): void; +} + +// @public (undocumented) +export class RemoteTrackPublication extends TrackPublication { + constructor(kind: Track.Kind, ti: TrackInfo, autoSubscribe: boolean | undefined, loggerOptions?: LoggerOptions); + // (undocumented) + protected fps?: number; + // (undocumented) + protected handleEnded: (track: RemoteTrack) => void; + // (undocumented) + protected handleVideoDimensionsChange: (dimensions: Track.Dimensions) => void; + // (undocumented) + protected handleVisibilityChange: (visible: boolean) => void; + // (undocumented) + protected get isAdaptiveStream(): boolean; + // (undocumented) + get isDesired(): boolean; + // (undocumented) + get isEnabled(): boolean; + // (undocumented) + get isLocal(): boolean; + get isSubscribed(): boolean; + // (undocumented) + get permissionStatus(): TrackPublication.PermissionStatus; + // (undocumented) + protected requestedDisabled: boolean | undefined; + // (undocumented) + protected requestedMaxQuality?: VideoQuality; + // (undocumented) + protected requestedVideoDimensions?: Track.Dimensions; + setEnabled(enabled: boolean): void; + setSubscribed(subscribed: boolean): void; + setVideoDimensions(dimensions: Track.Dimensions): void; + // (undocumented) + setVideoFPS(fps: number): void; + setVideoQuality(quality: VideoQuality): void; + // (undocumented) + protected subscribed?: boolean; + // (undocumented) + protected subscriptionError?: SubscriptionError; + // (undocumented) + get subscriptionStatus(): TrackPublication.SubscriptionStatus; + // (undocumented) + track?: RemoteTrack; + // (undocumented) + protected videoDimensionsAdaptiveStream?: Track.Dimensions; + // (undocumented) + get videoQuality(): VideoQuality | undefined; + // (undocumented) + protected visible: boolean; +} + +// @public (undocumented) +export class RemoteVideoTrack extends RemoteTrack { + constructor(mediaTrack: MediaStreamTrack, sid: string, receiver: RTCRtpReceiver, adaptiveStreamSettings?: AdaptiveStreamSettings, loggerOptions?: LoggerOptions); + // (undocumented) + attach(): HTMLMediaElement; + // (undocumented) + attach(element: HTMLMediaElement): HTMLMediaElement; + // (undocumented) + detach(): HTMLMediaElement[]; + // (undocumented) + detach(element: HTMLMediaElement): HTMLMediaElement; + // (undocumented) + getReceiverStats(): Promise; + // (undocumented) + protected handleAppVisibilityChanged(): Promise; + // (undocumented) + get isAdaptiveStream(): boolean; + lookupFrameMetadata(input: { + rtpTimestamp: number; + }): FrameMetadata | undefined; + get mediaStreamTrack(): MediaStreamTrack; + // (undocumented) + protected monitorReceiver: () => Promise; + // (undocumented) + setStreamState(value: Track.StreamState): void; +} + +// @public (undocumented) +export interface RemoveTransformMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity: string; + trackId: string; + }; + // (undocumented) + kind: 'removeTransform'; +} + +// @public (undocumented) +export interface ReplaceTrackOptions { + // (undocumented) + stopProcessor?: boolean; + // (undocumented) + userProvidedTrack?: boolean; +} + +// @public (undocumented) +export type RequestErrorReason = Exclude | 'TimeoutError'; + +// @public +export interface RoomApiProvider { + // (undocumented) + room: RoomApi; +} + +// @public (undocumented) +export type RoomConfigurationObject = NonNullable[0]>; + +// @public +export interface RoomConnectOptions extends Partial { +} + +// @public +export interface RoomDataStreamOptions { + maxPayloadByteLength?: number; +} + +// @public +export enum RoomEvent { + ActiveDeviceChanged = "activeDeviceChanged", + ActiveSpeakersChanged = "activeSpeakersChanged", + AudioPlaybackStatusChanged = "audioPlaybackChanged", + // (undocumented) + ChatMessage = "chatMessage", + Connected = "connected", + ConnectionQualityChanged = "connectionQualityChanged", + ConnectionStateChanged = "connectionStateChanged", + DataReceived = "dataReceived", + DataTrackPublished = "dataTrackPublished", + DataTrackUnpublished = "dataTrackUnpublished", + DCBufferStatusChanged = "dcBufferStatusChanged", + Disconnected = "disconnected", + // (undocumented) + EncryptionError = "encryptionError", + LocalAudioSilenceDetected = "localAudioSilenceDetected", + LocalDataTrackPublished = "localDataTrackPublished", + LocalDataTrackUnpublished = "localDataTrackUnpublished", + LocalTrackPublished = "localTrackPublished", + LocalTrackSubscribed = "localTrackSubscribed", + LocalTrackUnpublished = "localTrackUnpublished", + MediaDevicesChanged = "mediaDevicesChanged", + MediaDevicesError = "mediaDevicesError", + MetricsReceived = "metricsReceived", + Moved = "moved", + ParticipantActive = "participantActive", + ParticipantAttributesChanged = "participantAttributesChanged", + ParticipantConnected = "participantConnected", + ParticipantDisconnected = "participantDisconnected", + // (undocumented) + ParticipantEncryptionStatusChanged = "participantEncryptionStatusChanged", + ParticipantMetadataChanged = "participantMetadataChanged", + ParticipantNameChanged = "participantNameChanged", + ParticipantPermissionsChanged = "participantPermissionsChanged", + Reconnected = "reconnected", + Reconnecting = "reconnecting", + RecordingStatusChanged = "recordingStatusChanged", + RoomMetadataChanged = "roomMetadataChanged", + SignalConnected = "signalConnected", + SignalReconnecting = "signalReconnecting", + SipDTMFReceived = "sipDTMFReceived", + TrackMuted = "trackMuted", + TrackPublished = "trackPublished", + TrackStreamStateChanged = "trackStreamStateChanged", + TrackSubscribed = "trackSubscribed", + TrackSubscriptionFailed = "trackSubscriptionFailed", + TrackSubscriptionPermissionChanged = "trackSubscriptionPermissionChanged", + TrackSubscriptionStatusChanged = "trackSubscriptionStatusChanged", + TrackUnmuted = "trackUnmuted", + TrackUnpublished = "trackUnpublished", + TrackUnsubscribed = "trackUnsubscribed", + // @beta + TranscriptionReceived = "transcriptionReceived", + VideoPlaybackStatusChanged = "videoPlaybackChanged" +} + +// @public (undocumented) +export type RoomEventCallbacks = { + connected: () => void; + reconnecting: () => void; + signalReconnecting: () => void; + reconnected: () => void; + disconnected: (reason?: DisconnectReason) => void; + connectionStateChanged: (state: ConnectionState) => void; + moved: (name: string) => void; + mediaDevicesChanged: () => void; + participantConnected: (participant: RemoteParticipant) => void; + participantDisconnected: (participant: RemoteParticipant, disconnectReason?: DisconnectReason) => void; + trackPublished: (publication: RemoteTrackPublication, participant: RemoteParticipant) => void; + trackSubscribed: (track: RemoteTrack, publication: RemoteTrackPublication, participant: RemoteParticipant) => void; + trackSubscriptionFailed: (trackSid: string, participant: RemoteParticipant, reason?: SubscriptionError) => void; + trackUnpublished: (publication: RemoteTrackPublication, participant: RemoteParticipant) => void; + trackUnsubscribed: (track: RemoteTrack, publication: RemoteTrackPublication, participant: RemoteParticipant) => void; + trackMuted: (publication: TrackPublication, participant: Participant) => void; + trackUnmuted: (publication: TrackPublication, participant: Participant) => void; + localTrackPublished: (publication: LocalTrackPublication, participant: LocalParticipant) => void; + localTrackUnpublished: (publication: LocalTrackPublication, participant: LocalParticipant) => void; + localAudioSilenceDetected: (publication: LocalTrackPublication) => void; + participantMetadataChanged: (metadata: string | undefined, participant: RemoteParticipant | LocalParticipant) => void; + participantNameChanged: (name: string, participant: RemoteParticipant | LocalParticipant) => void; + participantPermissionsChanged: (prevPermissions: ParticipantPermission | undefined, participant: RemoteParticipant | LocalParticipant) => void; + participantAttributesChanged: (changedAttributes: Record, participant: RemoteParticipant | LocalParticipant) => void; + activeSpeakersChanged: (speakers: Array) => void; + roomMetadataChanged: (metadata: string) => void; + dataReceived: (payload: NonSharedUint8Array, participant?: RemoteParticipant, kind?: DataPacket_Kind, topic?: string, encryptionType?: Encryption_Type, participantIdentity?: string) => void; + sipDTMFReceived: (dtmf: SipDTMF, participant?: RemoteParticipant) => void; + transcriptionReceived: (transcription: TranscriptionSegment[], participant?: Participant, publication?: TrackPublication) => void; + connectionQualityChanged: (quality: ConnectionQuality, participant: Participant) => void; + mediaDevicesError: (error: Error, kind?: MediaDeviceKind) => void; + trackStreamStateChanged: (publication: RemoteTrackPublication, streamState: Track.StreamState, participant: RemoteParticipant) => void; + trackSubscriptionPermissionChanged: (publication: RemoteTrackPublication, status: TrackPublication.PermissionStatus, participant: RemoteParticipant) => void; + trackSubscriptionStatusChanged: (publication: RemoteTrackPublication, status: TrackPublication.SubscriptionStatus, participant: RemoteParticipant) => void; + audioPlaybackChanged: (playing: boolean) => void; + videoPlaybackChanged: (playing: boolean) => void; + signalConnected: () => void; + recordingStatusChanged: (recording: boolean) => void; + participantEncryptionStatusChanged: (encrypted: boolean, participant?: Participant) => void; + encryptionError: (error: Error, participant?: Participant) => void; + dcBufferStatusChanged: (isLow: boolean, kind: DataChannelKind) => void; + activeDeviceChanged: (kind: MediaDeviceKind, deviceId: string) => void; + chatMessage: (message: ChatMessage, participant?: RemoteParticipant | LocalParticipant) => void; + localTrackSubscribed: (publication: LocalTrackPublication, participant: LocalParticipant) => void; + metricsReceived: (metrics: MetricsBatch, participant?: Participant) => void; + participantActive: (participant: Participant) => void; + dataTrackPublished: (track: RemoteDataTrack) => void; + dataTrackUnpublished: (sid: DataTrackSid) => void; + localDataTrackPublished: (track: LocalDataTrack) => void; + localDataTrackUnpublished: (sid: DataTrackSid) => void; +}; + +// @public +export interface RoomExtension { + // (undocumented) + install(room: CoreRoom, ctx: ExtensionContext): ExtensionResult; + // (undocumented) + readonly key: symbol; + readonly requires?: readonly RoomExtension[]; +} + +// @public +export interface RoomOptions extends Partial { +} + +// @public +export const rpc: { + key: symbol; + requires: readonly [ConfigurableExtension & LocalParticipantApiProvider & SlotProvider<"byteStreamOpener"> & DataPacketOwner & EngineHooks & ConnectionHooks & { + incoming: IncomingDataStreamManager; + outgoing: OutgoingDataStreamManager; + }, RoomDataStreamOptions, readonly []>]; + install(room: CoreRoom, ctx: ExtensionContext): RoomApiProvider & LocalParticipantApiProvider & DataPacketOwner; +}; + +// @public +export class RpcError extends Error { + constructor(code: number, message: string, data?: string, options?: { + cause?: unknown; + }); + // (undocumented) + cause?: unknown; + // (undocumented) + code: number; + // (undocumented) + data?: string; + // (undocumented) + static ErrorCode: { + readonly APPLICATION_ERROR: 1500; + readonly CONNECTION_TIMEOUT: 1501; + readonly RESPONSE_TIMEOUT: 1502; + readonly RECIPIENT_DISCONNECTED: 1503; + readonly RESPONSE_PAYLOAD_TOO_LARGE: 1504; + readonly SEND_FAILED: 1505; + readonly UNSUPPORTED_METHOD: 1400; + readonly RECIPIENT_NOT_FOUND: 1401; + readonly REQUEST_PAYLOAD_TOO_LARGE: 1402; + readonly UNSUPPORTED_SERVER: 1403; + readonly UNSUPPORTED_VERSION: 1404; + }; + // (undocumented) + static MAX_DATA_BYTES: number; + // (undocumented) + static MAX_MESSAGE_BYTES: number; +} + +// @public +export interface RpcInvocationData { + callerIdentity: string; + payload: string; + requestId: string; + responseTimeout: number; +} + +// @public +export interface RpcLocalParticipantApi { + performRpc(params: PerformRpcParams): TypedPromise; +} + +// @public +export interface RpcRoomApi { + registerRpcMethod(method: string, handler: (data: RpcInvocationData) => Promise): void; + unregisterRpcMethod(method: string): void; +} + +// @public (undocumented) +export interface RTPVideoMapMessage extends BaseMessage { + // (undocumented) + data: { + map: Map; + participantIdentity: string; + }; + // (undocumented) + kind: 'setRTPMap'; +} + +// @public @deprecated (undocumented) +export type SandboxTokenServerOptions = DevelopmentTokenServerOptions; + +// @public +export type ScalabilityMode = 'L1T1' | 'L1T2' | 'L1T3' | 'L2T1' | 'L2T1h' | 'L2T1_KEY' | 'L2T2' | 'L2T2h' | 'L2T2_KEY' | 'L2T3' | 'L2T3h' | 'L2T3_KEY' | 'L3T1' | 'L3T1h' | 'L3T1_KEY' | 'L3T2' | 'L3T2h' | 'L3T2_KEY' | 'L3T3' | 'L3T3h' | 'L3T3_KEY'; + +// @public (undocumented) +export interface ScreenShareCaptureOptions { + audio?: boolean | AudioCaptureOptions; + contentHint?: 'detail' | 'text' | 'motion'; + controller?: unknown; + preferCurrentTab?: boolean; + resolution?: VideoResolution; + selfBrowserSurface?: 'include' | 'exclude'; + suppressLocalAudioPlayback?: boolean; + surfaceSwitching?: 'include' | 'exclude'; + systemAudio?: 'include' | 'exclude'; + video?: true | { + displaySurface?: 'window' | 'browser' | 'monitor'; + }; +} + +// @public (undocumented) +export const ScreenSharePresets: { + readonly h360fps3: VideoPreset; + readonly h360fps15: VideoPreset; + readonly h720fps5: VideoPreset; + readonly h720fps15: VideoPreset; + readonly h720fps30: VideoPreset; + readonly h1080fps15: VideoPreset; + readonly h1080fps30: VideoPreset; + readonly original: VideoPreset; +}; + +// @public (undocumented) +export type ScriptTransformOptions = { + kind: 'decode' | 'encode'; + participantIdentity: string; + trackId: string; + codec?: VideoCodec; + hasPacketTrailer: boolean; + packetTrailer?: FrameMetadataPublishOptions; +}; + +// @public (undocumented) +export interface SendBytesOptions { + // (undocumented) + attributes?: Record; + compress?: boolean; + // (undocumented) + destinationIdentities?: Array; + // (undocumented) + mimeType?: string; + // (undocumented) + name?: string; + // (undocumented) + onProgress?: (progress: number) => void; + // (undocumented) + topic?: string; +} + +// @public (undocumented) +export interface SendTextOptions { + // (undocumented) + attachments?: Array; + // (undocumented) + attributes?: Record; + compress?: boolean; + // (undocumented) + destinationIdentities?: Array; + // (undocumented) + onProgress?: (progress: number) => void; + // (undocumented) + topic?: string; +} + +// @beta +export type Serializer = { + symbol: typeof SerializerSymbol; + parse: (raw: string) => Input; + serialize: (val: Output) => string; +}; + +// Warning: (ae-incompatible-release-tags) The symbol "SerializerInput" is marked as @public, but its signature references "Serializer" which is marked as @beta +// +// @public (undocumented) +export type SerializerInput = S extends Serializer ? Input : any; + +// Warning: (ae-incompatible-release-tags) The symbol "SerializerOutput" is marked as @public, but its signature references "Serializer" which is marked as @beta +// +// @public (undocumented) +export type SerializerOutput = S extends Serializer ? Output : any; + +// @beta +export const serializers: { + json: typeof json; + raw: typeof raw; + custom: typeof custom; +}; + +// @public (undocumented) +export interface SetKeyMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity?: string; + isPublisher: boolean; + key: CryptoKey; + keyIndex?: number; + updateCurrentKeyIndex: boolean; + }; + // (undocumented) + kind: 'setKey'; +} + +// Warning: (ae-forgotten-export) The symbol "LogExtension" needs to be exported by the entry point core.d.ts +// +// @public +export function setLogExtension(extension: LogExtension, logger?: StructuredLogger): void; + +// Warning: (ae-forgotten-export) The symbol "LogLevelString" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export function setLogLevel(level: LogLevel | LogLevelString, loggerName?: LoggerNames): void; + +// @public (undocumented) +export interface SetLogLevelMessage extends BaseMessage { + // (undocumented) + data: { + level: LogLevel; + }; + // (undocumented) + kind: 'setLogLevel'; +} + +// @public (undocumented) +export interface SifTrailerMessage extends BaseMessage { + // (undocumented) + data: { + trailer: NonSharedUint8Array; + }; + // (undocumented) + kind: 'setSifTrailer'; +} + +// @public (undocumented) +export class SignalReconnectError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "SignalReconnectError"; +} + +// @public (undocumented) +export class SignalRequestError extends LivekitReasonedError { + constructor(message: string, reason: RequestErrorReason); + // (undocumented) + readonly name = "SignalRequestError"; + // (undocumented) + reason: RequestErrorReason; + // (undocumented) + reasonName: string; +} + +// @public (undocumented) +export class SimulatedError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "simulated"; +} + +// @public +export const simulatedParticipants: { + key: symbol; + install(room: CoreRoom, ctx: ExtensionContext): RoomApiProvider; +}; + +// @public +export interface SimulatedParticipantsRoomApi { + // Warning: (ae-forgotten-export) The symbol "SimulationOptions" needs to be exported by the entry point core.d.ts + simulateParticipants(options: SimulationOptions): Promise; +} + +// @public (undocumented) +export type SimulationScenario = 'signal-reconnect' | 'speaker' | 'node-failure' | 'server-leave' | 'migration' | 'resume-reconnect' | 'force-tcp' | 'force-tls' | 'full-reconnect' | 'subscriber-bandwidth' | 'disconnect-signal-on-resume' | 'disconnect-signal-on-resume-no-messages' | 'leave-full-reconnect' | 'fail-on-v1-path'; + +// @public +export type SlotProvider = Pick; + +export { SubscriptionError } + +// @public (undocumented) +export function supportsAdaptiveStream(): boolean; + +// @public +export function supportsAudioOutputSelection(): boolean; + +// @public (undocumented) +export function supportsAV1(): boolean; + +// @public (undocumented) +export function supportsDynacast(): boolean; + +// @public (undocumented) +export function supportsH265(): boolean; + +// @public (undocumented) +export function supportsVP9(): boolean; + +// @public +export interface SyncStateProvider { + syncState?(): PublishDataTrackResponse[]; +} + +// @public (undocumented) +export type TextStreamHandler = (reader: TextStreamReader, participantInfo: { + identity: string; +}) => void; + +// @public (undocumented) +export interface TextStreamInfo extends BaseStreamInfo { + // (undocumented) + attachedStreamIds?: Array; +} + +// @public +export class TextStreamReader extends BaseStreamReader { + [Symbol.asyncIterator](): { + next: () => Promise>; + return(): Promise>; + }; + // (undocumented) + readAll(opts?: BaseStreamReaderReadAllOpts): Promise; + // (undocumented) + signal?: AbortSignal; + withAbortSignal(signal: AbortSignal): this; +} + +// @public (undocumented) +export class TextStreamWriter extends BaseStreamWriter { +} + +// @public +export type TokenPayload = JWTPayload & { + name?: string; + metadata?: string; + attributes?: Record; + video?: { + room?: string; + roomJoin?: boolean; + canPublish?: boolean; + canPublishData?: boolean; + canSubscribe?: boolean; + }; + roomConfig?: RoomConfigurationObject; +}; + +// @public (undocumented) +export const TokenSource: { + literal(literalOrFn: LiteralOrFn): TokenSourceLiteral; + custom(customFn: CustomFn): TokenSourceCustom; + endpoint(url: string, options?: EndpointOptions): TokenSourceEndpoint; + sandboxTokenServer(sandboxId: string, options?: SandboxTokenServerOptions): TokenSourceSandboxTokenServer; + developmentTokenServer(tokenServerId: string, options?: DevelopmentTokenServerOptions): TokenSourceDevelopmentTokenServer; +}; + +// @public +export type TokenSourceBase = TokenSourceFixed | TokenSourceConfigurable; + +// @public +export abstract class TokenSourceConfigurable { + // (undocumented) + abstract fetch(options: TokenSourceFetchOptions): Promise; + // (undocumented) + abstract fetch(options: TokenSourceFetchOptions, force?: boolean): Promise; +} + +// Warning: (ae-forgotten-export) The symbol "TokenSourceCached" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export class TokenSourceCustom extends TokenSourceCached { + constructor(customFn: CustomFn); + // (undocumented) + protected update(options: TokenSourceFetchOptions): Promise; +} + +// @public (undocumented) +export class TokenSourceDevelopmentTokenServer extends TokenSourceEndpoint { + constructor(tokenServerId: string, options: DevelopmentTokenServerOptions); +} + +// @public (undocumented) +export class TokenSourceEndpoint extends TokenSourceCached { + constructor(url: string, options?: EndpointOptions); + // (undocumented) + protected update(options: TokenSourceFetchOptions): Promise; +} + +// @public (undocumented) +export type TokenSourceFetchOptions = { + roomName?: string; + participantName?: string; + participantIdentity?: string; + participantMetadata?: string; + participantAttributes?: { + [key: string]: string; + }; + agentName?: string; + agentMetadata?: string; + deployment?: string; +}; + +// @public +export abstract class TokenSourceFixed { + // (undocumented) + abstract fetch(): Promise; +} + +// @public (undocumented) +export class TokenSourceLiteral extends TokenSourceFixed { + constructor(literalOrFn: LiteralOrFn); + // (undocumented) + fetch(): Promise; +} + +// @public (undocumented) +export type TokenSourceRequestObject = Required[0]>>; + +// Warning: (ae-forgotten-export) The symbol "ValueToSnakeCase" needs to be exported by the entry point core.d.ts +// +// @public +export type TokenSourceRequestPayload = ValueToSnakeCase; + +// @public (undocumented) +export type TokenSourceResponseObject = Required[0]>>; + +// @public +export type TokenSourceResponsePayload = ValueToSnakeCase; + +// @public @deprecated (undocumented) +export class TokenSourceSandboxTokenServer extends TokenSourceDevelopmentTokenServer { +} + +// Warning: (ae-forgotten-export) The symbol "Track_base" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export abstract class Track extends Track_base { + protected constructor(mediaTrack: MediaStreamTrack, kind: TrackKind, loggerOptions?: LoggerOptions); + // (undocumented) + protected addAppVisibilityListener(): void; + // (undocumented) + protected appVisibilityChangedListener: () => void; + attach(): HTMLMediaElement; + attach(element: HTMLMediaElement): HTMLMediaElement; + // (undocumented) + attachedElements: HTMLMediaElement[]; + get currentBitrate(): number; + // (undocumented) + protected _currentBitrate: number; + detach(): HTMLMediaElement[]; + detach(element: HTMLMediaElement): HTMLMediaElement; + // (undocumented) + protected disable(): void; + // (undocumented) + protected enable(): void; + abstract getRTCStatsReport(): Promise; + // (undocumented) + protected handleAppVisibilityChanged(): Promise; + // (undocumented) + protected isInBackground: boolean; + // (undocumented) + abstract get isLocal(): boolean; + // (undocumented) + isMuted: boolean; + // (undocumented) + readonly kind: TrackKind; + // (undocumented) + protected log: StructuredLogger; + // (undocumented) + protected get logContext(): { + [x: string]: unknown; + }; + // (undocumented) + protected _mediaStreamID: string; + // (undocumented) + get mediaStreamTrack(): MediaStreamTrack; + // (undocumented) + protected _mediaStreamTrack: MediaStreamTrack; + // (undocumented) + protected monitorInterval?: ReturnType; + // (undocumented) + protected removeAppVisibilityListener(): void; + sid?: Track.SID; + // (undocumented) + source: Track.Source; + // (undocumented) + stop(): void; + get streamState(): Track.StreamState; + // (undocumented) + protected timeSyncHandle: number | undefined; +} + +// @public (undocumented) +export namespace Track { + // (undocumented) + export interface Dimensions { + // (undocumented) + height: number; + // (undocumented) + width: number; + } + // (undocumented) + export enum Kind { + // (undocumented) + Audio = "audio", + // (undocumented) + Unknown = "unknown", + // (undocumented) + Video = "video" + } + // (undocumented) + export type SID = string; + // (undocumented) + export enum Source { + // (undocumented) + Camera = "camera", + // (undocumented) + Microphone = "microphone", + // (undocumented) + ScreenShare = "screen_share", + // (undocumented) + ScreenShareAudio = "screen_share_audio", + // (undocumented) + Unknown = "unknown" + } + // (undocumented) + export enum StreamState { + // (undocumented) + Active = "active", + // (undocumented) + Paused = "paused", + // (undocumented) + Unknown = "unknown" + } +} + +// @public (undocumented) +enum TrackEvent_2 { + // (undocumented) + CpuConstrained = "cpuConstrained", + // (undocumented) + Ended = "ended", + // (undocumented) + Message = "message", + // (undocumented) + Muted = "muted", + Restarted = "restarted", + // (undocumented) + Subscribed = "subscribed", + SubscriptionFailed = "subscriptionFailed", + SubscriptionStatusChanged = "subscriptionStatusChanged", + // (undocumented) + TimeSyncUpdate = "timeSyncUpdate", + // @beta (undocumented) + TranscriptionReceived = "transcriptionReceived", + // (undocumented) + Unmuted = "unmuted", + // (undocumented) + Unsubscribed = "unsubscribed" +} +export { TrackEvent_2 as TrackEvent } + +// @public (undocumented) +export type TrackEventCallbacks = { + message: () => void; + muted: (track?: any) => void; + unmuted: (track?: any) => void; + restarted: (track?: any) => void; + ended: (track?: any) => void; + updateSettings: () => void; + updateSubscription: () => void; + audioPlaybackStarted: () => void; + audioPlaybackFailed: (error?: Error) => void; + audioSilenceDetected: () => void; + visibilityChanged: (visible: boolean, track?: any) => void; + videoDimensionsChanged: (dimensions: Track.Dimensions, track?: any) => void; + videoPlaybackStarted: () => void; + videoPlaybackFailed: (error?: Error) => void; + elementAttached: (element: HTMLMediaElement) => void; + elementDetached: (element: HTMLMediaElement) => void; + upstreamPaused: (track: any) => void; + upstreamResumed: (track: any) => void; + trackProcessorUpdate: (processor?: TrackProcessor) => void; + audioTrackFeatureUpdate: (track: any, feature: AudioTrackFeature, enabled: boolean) => void; + timeSyncUpdate: (update: { + timestamp: number; + rtpTimestamp: number; + }) => void; + preConnectBufferFlushed: (buffer: NonSharedUint8Array[]) => void; + cpuConstrained: () => void; +}; + +// @public (undocumented) +export class TrackInvalidError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "TrackInvalidError"; +} + +// @public +export interface TrackProcessor = ProcessorOptions> { + // (undocumented) + destroy: () => Promise; + // (undocumented) + init: (opts: U) => Promise; + // (undocumented) + name: string; + // (undocumented) + onPublish?: (room: CoreRoom) => Promise; + // (undocumented) + onUnpublish?: () => Promise; + // (undocumented) + processedTrack?: MediaStreamTrack; + // (undocumented) + restart: (opts: U) => Promise; +} + +// Warning: (ae-forgotten-export) The symbol "TrackPublication_base" needs to be exported by the entry point core.d.ts +// +// @public (undocumented) +export abstract class TrackPublication extends TrackPublication_base { + constructor(kind: Track.Kind, id: string, name: string, loggerOptions?: LoggerOptions); + get audioTrack(): LocalAudioTrack | RemoteAudioTrack | undefined; + dimensions?: Track.Dimensions; + // (undocumented) + protected encryption: Encryption_Type; + // (undocumented) + handleMuted: () => void; + // (undocumented) + handleUnmuted: () => void; + // (undocumented) + get isEnabled(): boolean; + // (undocumented) + get isEncrypted(): boolean; + // (undocumented) + abstract get isLocal(): boolean; + // (undocumented) + get isMuted(): boolean; + // (undocumented) + get isSubscribed(): boolean; + // (undocumented) + kind: Track.Kind; + // (undocumented) + protected log: StructuredLogger; + // (undocumented) + protected get logContext(): { + [x: string]: unknown; + }; + // (undocumented) + protected metadataMuted: boolean; + mimeType?: string; + simulcasted?: boolean; + // (undocumented) + source: Track.Source; + // (undocumented) + track?: Track; + // (undocumented) + trackName: string; + // (undocumented) + trackSid: Track.SID; + get videoTrack(): LocalVideoTrack | RemoteVideoTrack | undefined; +} + +// @public (undocumented) +export namespace TrackPublication { + // (undocumented) + export enum PermissionStatus { + // (undocumented) + Allowed = "allowed", + // (undocumented) + NotAllowed = "not_allowed" + } + // (undocumented) + export enum SubscriptionStatus { + // (undocumented) + Desired = "desired", + // (undocumented) + Subscribed = "subscribed", + // (undocumented) + Unsubscribed = "unsubscribed" + } +} + +// @public (undocumented) +export interface TrackPublishDefaults { + audioPreset?: AudioPreset; + backupCodec?: true | false | { + codec: BackupVideoCodec; + encoding?: VideoEncoding; + }; + backupCodecPolicy?: BackupCodecPolicy; + degradationPreference?: RTCDegradationPreference; + dtx?: boolean; + forceStereo?: boolean; + frameMetadata?: FrameMetadataPublishOptions; + preConnectBuffer?: boolean; + red?: boolean; + scalabilityMode?: ScalabilityMode; + screenShareEncoding?: VideoEncoding; + screenShareSimulcastLayers?: Array; + simulcast?: boolean; + stopMicTrackOnMute?: boolean; + videoCodec?: VideoCodec; + videoEncoding?: VideoEncoding; + videoSimulcastLayers?: Array; +} + +// @public +export interface TrackPublishOptions extends TrackPublishDefaults { + name?: string; + source?: Track.Source; + stream?: string; +} + +export { TrackType } + +// @public +interface TranscriptionAttributes { + 'lk.segment_id'?: string; + 'lk.transcribed_track_id'?: string; + 'lk.transcription_final'?: boolean; + // (undocumented) + [property: string]: any; +} + +// @public (undocumented) +export interface TranscriptionSegment { + // (undocumented) + endTime: number; + // (undocumented) + final: boolean; + // (undocumented) + firstReceivedTime: number; + // (undocumented) + id: string; + // (undocumented) + language: string; + // (undocumented) + lastReceivedTime: number; + // (undocumented) + startTime: number; + // (undocumented) + text: string; +} + +// @public (undocumented) +export class UnexpectedConnectionState extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "UnexpectedConnectionState"; +} + +// @public (undocumented) +export class UnsupportedServer extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "UnsupportedServer"; +} + +// @public (undocumented) +export interface UpdateCodecMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity: string; + trackId: string; + codec?: VideoCodec; + previousTrackId?: string; + hasPacketTrailer: boolean; + }; + // (undocumented) + kind: 'updateCodec'; +} + +// @public (undocumented) +export const version: string; + +// @public +export const video: { + key: symbol; + install(room: CoreRoom, ctx: ExtensionContext): LocalParticipantApiProvider & SlotProvider<"videoPublisher"> & EngineHooks; +}; + +// @public (undocumented) +export interface VideoCaptureOptions { + deviceId?: ConstrainDOMString; + facingMode?: 'user' | 'environment' | 'left' | 'right'; + frameRate?: ConstrainDouble; + processor?: TrackProcessor; + // (undocumented) + resolution?: VideoResolution; +} + +// @public (undocumented) +export type VideoCodec = (typeof videoCodecs)[number]; + +// @public (undocumented) +export const videoCodecs: readonly ["vp8", "h264", "vp9", "av1", "h265"]; + +// @public (undocumented) +export interface VideoEncoding { + // (undocumented) + maxBitrate: number; + // (undocumented) + maxFramerate?: number; + // (undocumented) + priority?: RTCPriorityType; +} + +// @public +export interface VideoLocalParticipantApi { + createScreenTracks(options?: ScreenShareCaptureOptions): Promise>; + enableCameraAndMicrophone(): Promise; + setCameraEnabled(enabled: boolean, options?: VideoCaptureOptions, publishOptions?: TrackPublishOptions): Promise; + setScreenShareEnabled(enabled: boolean, options?: ScreenShareCaptureOptions, publishOptions?: TrackPublishOptions): Promise; +} + +// @public (undocumented) +export class VideoPreset { + constructor(videoPresetOptions: VideoPresetOptions); + constructor(width: number, height: number, maxBitrate: number, maxFramerate?: number, priority?: RTCPriorityType); + // (undocumented) + aspectRatio?: number; + // (undocumented) + encoding: VideoEncoding; + // (undocumented) + height: number; + // (undocumented) + get resolution(): VideoResolution; + // (undocumented) + width: number; +} + +// @public (undocumented) +export interface VideoPresetOptions { + // (undocumented) + aspectRatio?: number; + // (undocumented) + height: number; + // (undocumented) + maxBitrate: number; + // (undocumented) + maxFramerate?: number; + // (undocumented) + priority?: RTCPriorityType; + // (undocumented) + width: number; +} + +// @public +export const VideoPresets: { + readonly h90: VideoPreset; + readonly h180: VideoPreset; + readonly h216: VideoPreset; + readonly h360: VideoPreset; + readonly h540: VideoPreset; + readonly h720: VideoPreset; + readonly h1080: VideoPreset; + readonly h1440: VideoPreset; + readonly h2160: VideoPreset; +}; + +// @public +export const VideoPresets43: { + readonly h120: VideoPreset; + readonly h180: VideoPreset; + readonly h240: VideoPreset; + readonly h360: VideoPreset; + readonly h480: VideoPreset; + readonly h540: VideoPreset; + readonly h720: VideoPreset; + readonly h1080: VideoPreset; + readonly h1440: VideoPreset; +}; + +// @public (undocumented) +export interface VideoProcessorOptions extends ProcessorOptions { +} + +// @public (undocumented) +export enum VideoQuality { + // (undocumented) + HIGH = 2, + // (undocumented) + LOW = 0, + // (undocumented) + MEDIUM = 1 +} + +// @public (undocumented) +export interface VideoReceiverStats extends ReceiverStats { + // (undocumented) + decoderImplementation?: string; + // (undocumented) + firCount?: number; + // (undocumented) + frameHeight?: number; + // (undocumented) + framesDecoded: number; + // (undocumented) + framesDropped: number; + // (undocumented) + framesReceived: number; + // (undocumented) + frameWidth?: number; + // (undocumented) + mimeType?: string; + // (undocumented) + nackCount?: number; + // (undocumented) + pliCount?: number; + // (undocumented) + type: 'video'; +} + +// @public (undocumented) +export interface VideoResolution { + // (undocumented) + aspectRatio?: number; + // (undocumented) + frameRate?: number; + // (undocumented) + height: number; + // (undocumented) + width: number; +} + +// @public (undocumented) +export interface VideoSenderStats extends SenderStats { + // (undocumented) + firCount: number; + // (undocumented) + frameHeight: number; + // (undocumented) + framesPerSecond: number; + // (undocumented) + framesSent: number; + // (undocumented) + frameWidth: number; + // (undocumented) + nackCount: number; + // (undocumented) + pliCount: number; + // (undocumented) + qualityLimitationDurations?: Record; + // (undocumented) + qualityLimitationReason?: string; + // (undocumented) + qualityLimitationResolutionChanges?: number; + // (undocumented) + retransmittedPacketsSent?: number; + // (undocumented) + rid: string; + // (undocumented) + targetBitrate: number; + // (undocumented) + type: 'video'; +} + +// @public (undocumented) +export type VideoTrack = RemoteVideoTrack | LocalVideoTrack; + +// @public (undocumented) +export interface WebAudioSettings { + // (undocumented) + audioContext: AudioContext; +} + +// @public (undocumented) +export function writeRbsp(data_in: NonSharedUint8Array): NonSharedUint8Array; + +// Warnings were encountered during analysis: +// +// dist/core/types/src/room/CoreRoom.d.ts:361:5 - (ae-forgotten-export) The symbol "DataTrackSid" needs to be exported by the entry point core.d.ts +// dist/core/types/src/room/data-stream/extension.d.ts:60:5 - (ae-forgotten-export) The symbol "IncomingDataStreamManager" needs to be exported by the entry point core.d.ts +// dist/core/types/src/room/data-stream/extension.d.ts:61:5 - (ae-forgotten-export) The symbol "OutgoingDataStreamManager" needs to be exported by the entry point core.d.ts +// dist/core/types/src/room/data-track/extension.d.ts:27:9 - (ae-forgotten-export) The symbol "IncomingDataTrackManager" needs to be exported by the entry point core.d.ts +// dist/core/types/src/room/data-track/extension.d.ts:28:9 - (ae-forgotten-export) The symbol "OutgoingDataTrackManager" needs to be exported by the entry point core.d.ts +// dist/core/types/src/room/data-track/packet/index.d.ts:70:13 - (ae-forgotten-export) The symbol "FrameMarker" needs to be exported by the entry point core.d.ts +// dist/core/types/src/room/extensions.d.ts:175:5 - (ae-forgotten-export) The symbol "LocalOf" needs to be exported by the entry point core.d.ts +// dist/core/types/src/room/token-source/TokenSource.d.ts:59:5 - (ae-forgotten-export) The symbol "LiteralOrFn" needs to be exported by the entry point core.d.ts +// dist/core/types/src/room/token-source/TokenSource.d.ts:66:5 - (ae-forgotten-export) The symbol "CustomFn" needs to be exported by the entry point core.d.ts +// dist/core/types/src/utils/serializer.d.ts:43:5 - (ae-forgotten-export) The symbol "json" needs to be exported by the entry point core.d.ts +// dist/core/types/src/utils/serializer.d.ts:44:5 - (ae-forgotten-export) The symbol "raw" needs to be exported by the entry point core.d.ts +// dist/core/types/src/utils/serializer.d.ts:45:5 - (ae-forgotten-export) The symbol "custom" needs to be exported by the entry point core.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/etc/livekit-client.api.md b/etc/livekit-client.api.md new file mode 100644 index 0000000000..c50bf77df6 --- /dev/null +++ b/etc/livekit-client.api.md @@ -0,0 +1,3799 @@ +## API Report File for "livekit-client" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { AddTrackRequest } from '@livekit/protocol'; +import { AudioTrackFeature } from '@livekit/protocol'; +import { ClientInfo_Capability } from '@livekit/protocol'; +import { Codec } from '@livekit/protocol'; +import { ConnectionQuality as ConnectionQuality_2 } from '@livekit/protocol'; +import { ConnectionQualityUpdate } from '@livekit/protocol'; +import { DataPacket } from '@livekit/protocol'; +import { DataPacket_Kind } from '@livekit/protocol'; +import type { DataStream_Chunk } from '@livekit/protocol'; +import { DataTrackInfo as DataTrackInfo_2 } from '@livekit/protocol'; +import { DataTrackSubscriberHandles } from '@livekit/protocol'; +import { DisconnectReason } from '@livekit/protocol'; +import { EncryptedPacketPayload } from '@livekit/protocol'; +import { Encryption_Type } from '@livekit/protocol'; +import { JoinResponse } from '@livekit/protocol'; +import type { JWTPayload } from 'jose'; +import { LeaveRequest } from '@livekit/protocol'; +import log from 'loglevel'; +import type { MediaAttributes } from 'sdp-transform'; +import { MediaSectionsRequirement } from '@livekit/protocol'; +import { MetricsBatch } from '@livekit/protocol'; +import { Mutex } from '@livekit/mutex'; +import { PacketTrailerFeature } from '@livekit/protocol'; +import { ParticipantInfo } from '@livekit/protocol'; +import { ParticipantInfo_Kind as ParticipantKind } from '@livekit/protocol'; +import { ParticipantPermission } from '@livekit/protocol'; +import { PublishDataTrackResponse } from '@livekit/protocol'; +import { ReconnectReason } from '@livekit/protocol'; +import { ReconnectResponse } from '@livekit/protocol'; +import { RegionSettings } from '@livekit/protocol'; +import { RequestResponse } from '@livekit/protocol'; +import { RequestResponse_Reason } from '@livekit/protocol'; +import { Room as Room_2 } from '@livekit/protocol'; +import { RoomConfiguration } from '@livekit/protocol'; +import { RoomMovedResponse } from '@livekit/protocol'; +import { RpcError as RpcError_2 } from '@livekit/protocol'; +import { ServerInfo } from '@livekit/protocol'; +import { SessionDescription } from '@livekit/protocol'; +import { SignalTarget } from '@livekit/protocol'; +import { SimulateScenario } from '@livekit/protocol'; +import { SipDTMF } from '@livekit/protocol'; +import { SpeakerInfo } from '@livekit/protocol'; +import { StreamState } from '@livekit/protocol'; +import { StreamStateUpdate } from '@livekit/protocol'; +import { SubscribedCodec } from '@livekit/protocol'; +import { SubscribedQuality } from '@livekit/protocol'; +import { SubscribedQualityUpdate } from '@livekit/protocol'; +import { SubscriptionError } from '@livekit/protocol'; +import { SubscriptionPermissionUpdate } from '@livekit/protocol'; +import { SubscriptionResponse } from '@livekit/protocol'; +import { SyncState } from '@livekit/protocol'; +import { Throws } from '@livekit/throws-transformer/throws'; +import { TokenSourceRequest } from '@livekit/protocol'; +import { TokenSourceResponse } from '@livekit/protocol'; +import { TrackInfo } from '@livekit/protocol'; +import { TrackPermission } from '@livekit/protocol'; +import { TrackPublishedResponse } from '@livekit/protocol'; +import { TrackSource } from '@livekit/protocol'; +import { TrackType } from '@livekit/protocol'; +import { TrackUnpublishedResponse } from '@livekit/protocol'; +import { Transcription } from '@livekit/protocol'; +import { TranscriptionSegment as TranscriptionSegment_2 } from '@livekit/protocol'; +import type TypedEmitter from 'typed-emitter'; +import type TypedEventEmitter from 'typed-emitter'; +import { UnpublishDataTrackResponse } from '@livekit/protocol'; +import { UpdateSubscription } from '@livekit/protocol'; +import { UpdateTrackSettings } from '@livekit/protocol'; +import { VideoLayer } from '@livekit/protocol'; + +// @public (undocumented) +export type AdaptiveStreamSettings = { + pixelDensity?: number | 'screen'; + pauseVideoInBackground?: boolean; +}; + +// @public (undocumented) +interface AgentAttributes { + // (undocumented) + 'lk.agent.inputs'?: AgentInput[]; + // (undocumented) + 'lk.agent.outputs'?: AgentOutput[]; + // (undocumented) + 'lk.agent.state'?: AgentState; + // (undocumented) + 'lk.publish_on_behalf'?: string; + // (undocumented) + [property: string]: any; +} + +// @public (undocumented) +type AgentInput = 'audio' | 'video' | 'text'; + +// @public (undocumented) +type AgentOutput = 'transcription' | 'audio'; + +// @public (undocumented) +type AgentState = 'idle' | 'initializing' | 'listening' | 'thinking' | 'speaking'; + +// @public +export function areTokenSourceFetchOptionsEqual(a: TokenSourceFetchOptions, b: TokenSourceFetchOptions): boolean; + +// @public (undocumented) +export function asEncryptablePacket(packet: DataPacket): EncryptedPacketPayload | undefined; + +// @public (undocumented) +export function attachToElement(track: MediaStreamTrack, element: HTMLMediaElement): void; + +declare namespace attributes { + export { + AgentAttributes, + AgentInput, + AgentOutput, + AgentState, + TranscriptionAttributes, + Convert + } +} +export { attributes } + +// @public (undocumented) +export type AudioAnalyserOptions = { + cloneTrack?: boolean; + fftSize?: number; + smoothingTimeConstant?: number; + minDecibels?: number; + maxDecibels?: number; +}; + +// @public (undocumented) +export interface AudioCaptureOptions { + autoGainControl?: ConstrainBoolean; + channelCount?: ConstrainULong; + deviceId?: ConstrainDOMString; + echoCancellation?: ConstrainBoolean; + latency?: ConstrainDouble; + noiseSuppression?: ConstrainBoolean; + processor?: TrackProcessor; + restrictOwnAudio?: ConstrainBoolean; + sampleRate?: ConstrainULong; + sampleSize?: ConstrainULong; + voiceIsolation?: ConstrainBoolean; +} + +// @public (undocumented) +export type AudioCodec = (typeof audioCodecs)[number]; + +// @public (undocumented) +export const audioCodecs: readonly ["opus", "red"]; + +// @public (undocumented) +export interface AudioOutputOptions { + deviceId?: string; +} + +// @public (undocumented) +export interface AudioPreset { + // (undocumented) + maxBitrate: number; + // (undocumented) + priority?: RTCPriorityType; +} + +// @public (undocumented) +export namespace AudioPresets { + const // (undocumented) + telephone: AudioPreset; + const // (undocumented) + speech: AudioPreset; + const // (undocumented) + music: AudioPreset; + const // (undocumented) + musicStereo: AudioPreset; + const // (undocumented) + musicHighQuality: AudioPreset; + const // (undocumented) + musicHighQualityStereo: AudioPreset; +} + +// @public (undocumented) +export interface AudioProcessorOptions extends ProcessorOptions { + // (undocumented) + audioContext: AudioContext; +} + +// Warning: (ae-forgotten-export) The symbol "ReceiverStats" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export interface AudioReceiverStats extends ReceiverStats { + // (undocumented) + concealedSamples?: number; + // (undocumented) + concealmentEvents?: number; + // (undocumented) + silentConcealedSamples?: number; + // (undocumented) + silentConcealmentEvents?: number; + // (undocumented) + totalAudioEnergy?: number; + // (undocumented) + totalSamplesDuration?: number; + // (undocumented) + type: 'audio'; +} + +// Warning: (ae-forgotten-export) The symbol "SenderStats" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export interface AudioSenderStats extends SenderStats { + // (undocumented) + type: 'audio'; +} + +// @public (undocumented) +export type AudioTrack = RemoteAudioTrack | LocalAudioTrack; + +// @public (undocumented) +export enum BackupCodecPolicy { + // (undocumented) + PREFER_REGRESSION = 0, + // (undocumented) + REGRESSION = 2, + // (undocumented) + SIMULCAST = 1 +} + +// Warning: (ae-forgotten-export) The symbol "backupVideoCodecs" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export type BackupVideoCodec = (typeof backupVideoCodecs)[number]; + +// @public (undocumented) +export interface BaseE2EEManager { + // (undocumented) + dispose?(): void; + // (undocumented) + encryptData(data: NonSharedUint8Array): Promise; + // (undocumented) + handleEncryptedData(payload: NonSharedUint8Array, iv: NonSharedUint8Array, participantIdentity: string, keyIndex: number): Promise; + // (undocumented) + isDataChannelEncryptionEnabled: boolean; + // (undocumented) + isEnabled: boolean; + // (undocumented) + off(event: E, listener: E2EEManagerCallbacks[E]): this; + // (undocumented) + on(event: E, listener: E2EEManagerCallbacks[E]): this; + // @internal (undocumented) + setParticipantCryptorEnabled(enabled: boolean, participantIdentity: string): void; + // Warning: (ae-forgotten-export) The symbol "NonSharedUint8Array" needs to be exported by the entry point index.d.ts + // + // @internal (undocumented) + setSifTrailer(trailer: NonSharedUint8Array): void; + // @internal (undocumented) + setup(room: CoreRoom): void; + // Warning: (ae-forgotten-export) The symbol "RTCEngine" needs to be exported by the entry point index.d.ts + // + // (undocumented) + setupEngine(engine: RTCEngine): void; +} + +// Warning: (ae-forgotten-export) The symbol "BaseKeyProvider_base" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class BaseKeyProvider extends BaseKeyProvider_base { + constructor(options?: Partial); + // (undocumented) + getKeys(): KeyInfo[]; + // (undocumented) + getLatestManuallySetKeyIndex(): number; + // (undocumented) + getOptions(): KeyProviderOptions; + protected onKeyRatcheted: (ratchetResult: RatchetResult, participantId?: string, keyIndex?: number) => void; + protected onSetEncryptionKey(key: CryptoKey, participantIdentity?: string, keyIndex?: number): void; + // (undocumented) + ratchetKey(participantIdentity?: string, keyIndex?: number): void; +} + +// @public (undocumented) +export interface BaseMessage { + // (undocumented) + data?: unknown; + // (undocumented) + kind: string; +} + +// @public (undocumented) +export type BaseStreamReaderReadAllOpts = { + signal?: AbortSignal; +}; + +// @public (undocumented) +export type ByteStreamHandler = (reader: ByteStreamReader, participantInfo: { + identity: string; +}) => void; + +// Warning: (ae-forgotten-export) The symbol "BaseStreamInfo" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export interface ByteStreamInfo extends BaseStreamInfo { + // (undocumented) + name: string; +} + +// Warning: (ae-forgotten-export) The symbol "BaseStreamReader" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class ByteStreamReader extends BaseStreamReader { + // (undocumented) + [Symbol.asyncIterator](): { + next: () => Promise>; + return(): Promise>; + }; + // (undocumented) + readAll(opts?: BaseStreamReaderReadAllOpts): Promise>; + // (undocumented) + signal?: AbortSignal; + withAbortSignal(signal: AbortSignal): this; +} + +// Warning: (ae-forgotten-export) The symbol "BaseStreamWriter" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class ByteStreamWriter extends BaseStreamWriter { +} + +// @public +export function canFailOverToAnotherRegion(error: ConnectionError): boolean; + +// @public +export interface ChatLocalParticipantApi { + // @deprecated (undocumented) + editChatMessage(editText: string, originalMessage: ChatMessage): Promise; + // @deprecated (undocumented) + sendChatMessage(text: string, options?: SendTextOptions): Promise; +} + +// @public (undocumented) +export interface ChatMessage { + // (undocumented) + attachedFiles?: Array; + // (undocumented) + editTimestamp?: number; + // (undocumented) + id: string; + // (undocumented) + message: string; + // (undocumented) + timestamp: number; +} + +// Warning: (ae-forgotten-export) The symbol "Checker_base" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export abstract class Checker extends Checker_base { + constructor(url: string, token: string, options?: CheckerOptions); + // (undocumented) + protected appendError(message: string): void; + // (undocumented) + protected appendMessage(message: string): void; + // (undocumented) + protected appendWarning(message: string): void; + // (undocumented) + protected connect(url?: string): Promise; + // (undocumented) + connectOptions?: RoomConnectOptions; + // (undocumented) + abstract get description(): string; + // (undocumented) + protected disconnect(): Promise; + // (undocumented) + protected get engine(): RTCEngine | undefined; + // (undocumented) + getInfo(): CheckInfo; + // (undocumented) + protected isSuccess(): boolean; + // Warning: (ae-forgotten-export) The symbol "LogMessage_2" needs to be exported by the entry point index.d.ts + // + // (undocumented) + logs: Array; + // (undocumented) + name: string; + // (undocumented) + options: CheckerOptions; + // (undocumented) + protected abstract perform(): Promise; + // Warning: (ae-forgotten-export) The symbol "CheckRoom" needs to be exported by the entry point index.d.ts + // + // (undocumented) + room: CheckRoom; + // (undocumented) + run(onComplete?: () => void): Promise; + // (undocumented) + protected setStatus(status: CheckStatus): void; + // (undocumented) + protected skip(): void; + // (undocumented) + status: CheckStatus; + // (undocumented) + protected switchProtocol(protocol: 'udp' | 'tcp' | 'tls'): Promise; + // (undocumented) + protected token: string; + // (undocumented) + protected url: string; +} + +// @public (undocumented) +export interface CheckerOptions { + // (undocumented) + connectOptions?: RoomConnectOptions; + // (undocumented) + errorsAsWarnings?: boolean; + // (undocumented) + protocol?: 'udp' | 'tcp'; + // (undocumented) + roomOptions?: RoomOptions; +} + +// @public (undocumented) +export type CheckInfo = { + name: string; + logs: Array; + status: CheckStatus; + description: string; + data?: any; +}; + +// @public (undocumented) +export enum CheckStatus { + // (undocumented) + FAILED = 4, + // (undocumented) + IDLE = 0, + // (undocumented) + RUNNING = 1, + // (undocumented) + SKIPPED = 2, + // (undocumented) + SUCCESS = 3 +} + +// @public +export const CLIENT_PROTOCOL_DATA_STREAM_RPC = 1; + +// @public +export const CLIENT_PROTOCOL_DATA_STREAM_V2 = 2; + +// @public +export const CLIENT_PROTOCOL_DEFAULT = 0; + +// @public +export const clientProtocol = 2; + +// @public (undocumented) +export function compareVersions(v1: string, v2: string): number; + +// @public +export type ConfigurableExtension, Options, Requires extends readonly RoomExtension[]> = ConfiguredExtension & ((options: Options | (() => Options)) => ConfiguredExtension); + +// @public +export type ConfiguredExtension, Requires extends readonly RoomExtension[]> = { + readonly key: symbol; + readonly requires: Requires; + install(room: CoreRoom, ctx: ExtensionContext): Result; +}; + +// Warning: (ae-forgotten-export) The symbol "ConnectionCheck_base" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class ConnectionCheck extends ConnectionCheck_base { + constructor(url: string, token: string, options?: CheckerOptions); + // (undocumented) + checkCloudRegion(): Promise; + // (undocumented) + checkConnectionProtocol(): Promise; + // (undocumented) + checkPublishAudio(): Promise; + // (undocumented) + checkPublishVideo(): Promise; + // (undocumented) + checkReconnect(): Promise; + // (undocumented) + checkTURN(): Promise; + // (undocumented) + checkWebRTC(): Promise; + // (undocumented) + checkWebsocket(): Promise; + // (undocumented) + createAndRunCheck(check: InstantiableCheck): Promise; + // (undocumented) + getResults(): CheckInfo[]; + // (undocumented) + isSuccess(): boolean; + // (undocumented) + options: CheckerOptions; + // (undocumented) + token: string; + // (undocumented) + url: string; +} + +// Warning: (ae-forgotten-export) The symbol "ConnectionErrorVariants" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class ConnectionError extends LivekitReasonedError { + protected constructor(message: string, reason: Variant['reason'], status?: Variant['status'], context?: Variant['context']); + // Warning: (ae-forgotten-export) The symbol "Cancelled" needs to be exported by the entry point index.d.ts + // + // (undocumented) + static cancelled(message: string): ConnectionError; + // (undocumented) + context: Variant['context']; + // Warning: (ae-forgotten-export) The symbol "InternalError" needs to be exported by the entry point index.d.ts + // + // (undocumented) + static internal(message: string, context?: { + status?: number; + statusText?: string; + }): ConnectionError; + // Warning: (ae-forgotten-export) The symbol "LeaveRequest_2" needs to be exported by the entry point index.d.ts + // + // (undocumented) + static leaveRequest(message: string, context: DisconnectReason): ConnectionError; + // (undocumented) + readonly name = "ConnectionError"; + // Warning: (ae-forgotten-export) The symbol "NotAllowed" needs to be exported by the entry point index.d.ts + // + // (undocumented) + static notAllowed(message: string, status: number, context?: unknown): ConnectionError; + // (undocumented) + reason: Variant['reason']; + // (undocumented) + reasonName: string; + // Warning: (ae-forgotten-export) The symbol "ServerUnreachable" needs to be exported by the entry point index.d.ts + // + // (undocumented) + static serverUnreachable(message: string, status?: number): ConnectionError; + // Warning: (ae-forgotten-export) The symbol "ServiceNotFound" needs to be exported by the entry point index.d.ts + // + // (undocumented) + static serviceNotFound(message: string, serviceName: 'v0-rtc'): ConnectionError; + // (undocumented) + status?: Variant['status']; + // Warning: (ae-forgotten-export) The symbol "ConnectionTimeout" needs to be exported by the entry point index.d.ts + // + // (undocumented) + static timeout(message: string): ConnectionError; + // Warning: (ae-forgotten-export) The symbol "WebSocket_2" needs to be exported by the entry point index.d.ts + // + // (undocumented) + static websocket(message: string, status?: number, reason?: string): ConnectionError; +} + +// @public (undocumented) +export enum ConnectionErrorReason { + // (undocumented) + Cancelled = 3, + // (undocumented) + InternalError = 2, + // (undocumented) + LeaveRequest = 4, + // (undocumented) + NotAllowed = 0, + // (undocumented) + ServerUnreachable = 1, + // (undocumented) + ServiceNotFound = 7, + // (undocumented) + Timeout = 5, + // (undocumented) + WebSocket = 6 +} + +// @public +export interface ConnectionHooks { + onDisconnect?(): void; +} + +// @public (undocumented) +export enum ConnectionQuality { + // (undocumented) + Excellent = "excellent", + // (undocumented) + Good = "good", + Lost = "lost", + // (undocumented) + Poor = "poor", + // (undocumented) + Unknown = "unknown" +} + +// @public (undocumented) +export enum ConnectionState { + // (undocumented) + Connected = "connected", + // (undocumented) + Connecting = "connecting", + // (undocumented) + Disconnected = "disconnected", + // (undocumented) + Reconnecting = "reconnecting", + // (undocumented) + SignalReconnecting = "signalReconnecting" +} + +// @public (undocumented) +class Convert { + // (undocumented) + static agentAttributesToJson(value: AgentAttributes): string; + // (undocumented) + static toAgentAttributes(json: string): AgentAttributes; + // (undocumented) + static toTranscriptionAttributes(json: string): TranscriptionAttributes; + // (undocumented) + static transcriptionAttributesToJson(value: TranscriptionAttributes): string; +} + +// Warning: (ae-forgotten-export) The symbol "CoreRoom_base" needs to be exported by the entry point index.d.ts +// +// @public +export class CoreRoom extends CoreRoom_base { + constructor(options?: CoreRoomOptions); + activeSpeakers: Participant[]; + // (undocumented) + bufferedSegments: Map; + get canPlaybackAudio(): boolean; + get canPlaybackVideo(): boolean; + // (undocumented) + static cleanupRegistry: false | FinalizationRegistry<() => void>; + // (undocumented) + connect: (url: string, token: string, opts?: RoomConnectOptions) => Promise; + disconnect: (stopTracks?: boolean) => Promise; + dispose(): Promise; + // (undocumented) + emit(event: E, ...args: Parameters): boolean; + // @internal (undocumented) + engine: RTCEngine; + // (undocumented) + getActiveDevice(kind: MediaDeviceKind): string | undefined; + static getLocalDevices(kind?: MediaDeviceKind, requestPermissions?: boolean): Promise; + getParticipantByIdentity(identity: string): Participant | undefined; + // Warning: (ae-forgotten-export) The symbol "TypedPromise" needs to be exported by the entry point index.d.ts + getSid(): TypedPromise; + // (undocumented) + get hasE2EESetup(): boolean; + // @internal + installExtensions(extensions: readonly RoomExtension[]): void; + isE2EEEnabled: boolean; + get isRecording(): boolean; + localParticipant: LocalParticipant; + get metadata(): string | undefined; + get name(): string; + // (undocumented) + get numParticipants(): number; + // (undocumented) + get numPublishers(): number; + options: InternalRoomOptions; + prepareConnection(url: string, token?: string): Promise; + remoteParticipants: Map; + // (undocumented) + serverInfo?: Partial; + // @internal + simulateScenario(scenario: SimulationScenario, arg?: any): Promise; + startAudio: () => Promise; + // (undocumented) + startVideo: () => Promise; + // (undocumented) + state: ConnectionState; + switchActiveDevice(kind: MediaDeviceKind, deviceId: string, exact?: boolean): Promise; +} + +// @public +export type CoreRoomOptions = Omit; + +// @public +export function createAudioAnalyser(track: LocalAudioTrack | RemoteAudioTrack, options?: AudioAnalyserOptions): { + calculateVolume: () => number; + analyser: AnalyserNode; + cleanup: () => Promise; +}; + +// @public (undocumented) +export function createE2EEKey(): NonSharedUint8Array; + +// @public (undocumented) +export function createKeyMaterialFromBuffer(cryptoBuffer: ArrayBuffer): Promise; + +// @public (undocumented) +export function createKeyMaterialFromString(password: string): Promise; + +// @public (undocumented) +export function createLocalAudioTrack(options?: AudioCaptureOptions): Promise; + +// @public +export function createLocalScreenTracks(options?: ScreenShareCaptureOptions): Promise>; + +// Warning: (ae-forgotten-export) The symbol "LoggerOptions" needs to be exported by the entry point index.d.ts +// +// @public +export function createLocalTracks(options?: CreateLocalTracksOptions, loggerOptions?: LoggerOptions): Promise>; + +// @public (undocumented) +export interface CreateLocalTracksOptions { + audio?: boolean | AudioCaptureOptions; + video?: boolean | VideoCaptureOptions; +} + +// @public +export function createLocalVideoTrack(options?: VideoCaptureOptions): Promise; + +// @public +export class CriticalTimers { + // (undocumented) + static clearInterval: (...args: Parameters) => ReturnType; + // (undocumented) + static clearTimeout: (...args: Parameters) => ReturnType; + // (undocumented) + static setInterval: (...args: Parameters) => ReturnType; + // (undocumented) + static setTimeout: (...args: Parameters) => ReturnType; +} + +// @public (undocumented) +export type CryptorCallbacks = { + [CryptorEvent.Error]: (error: CryptorError) => void; +}; + +// @public (undocumented) +export class CryptorError extends LivekitError { + constructor(message?: string, reason?: CryptorErrorReason, participantIdentity?: string); + // (undocumented) + participantIdentity?: string; + // (undocumented) + reason: CryptorErrorReason; +} + +// @public (undocumented) +export enum CryptorErrorReason { + // (undocumented) + InternalError = 2, + // (undocumented) + InvalidKey = 0, + // (undocumented) + MissingKey = 1 +} + +// @public (undocumented) +export enum CryptorEvent { + // (undocumented) + Error = "cryptorError" +} + +// @public (undocumented) +export enum DataChannelKind { + // (undocumented) + DATA_TRACK_LOSSY = 2, + // (undocumented) + LOSSY = 1, + // (undocumented) + RELIABLE = 0 +} + +export { DataPacket_Kind } + +// @public +export interface DataPacketOwner { + // Warning: (ae-forgotten-export) The symbol "DataPacketCase" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "DataPacketHandler" needs to be exported by the entry point index.d.ts + // + // (undocumented) + dataPackets?: { + [C in DataPacketCase]?: DataPacketHandler; + }; +} + +// @public (undocumented) +export type DataPublishOptions = { + reliable?: boolean; + destinationIdentities?: string[]; + topic?: string; +}; + +// @public (undocumented) +export class DataStreamError extends LivekitReasonedError { + constructor(message: string, reason: DataStreamErrorReason); + // (undocumented) + readonly name = "DataStreamError"; + // (undocumented) + reason: DataStreamErrorReason; + // (undocumented) + reasonName: string; +} + +// @public (undocumented) +export enum DataStreamErrorReason { + // (undocumented) + AbnormalEnd = 1, + // (undocumented) + AlreadyOpened = 0, + // (undocumented) + DecodeFailed = 2, + // (undocumented) + EncryptionTypeMismatch = 8, + // (undocumented) + HandlerAlreadyRegistered = 7, + // (undocumented) + HeaderTooLarge = 9, + // (undocumented) + Incomplete = 4, + // (undocumented) + LengthExceeded = 3, + // (undocumented) + PayloadTooLarge = 10 +} + +// @public +export interface DataStreamLocalParticipantApi { + sendBytes(bytes: Uint8Array, options?: SendBytesOptions): Promise; + // Warning: (ae-forgotten-export) The symbol "SendFileOptions" needs to be exported by the entry point index.d.ts + sendFile(file: File, options?: SendFileOptions): Promise<{ + id: string; + }>; + sendText(text: string, options?: SendTextOptions): Promise; + // Warning: (ae-forgotten-export) The symbol "StreamBytesOptions" needs to be exported by the entry point index.d.ts + streamBytes(options?: StreamBytesOptions): Promise; + // Warning: (ae-forgotten-export) The symbol "StreamTextOptions" needs to be exported by the entry point index.d.ts + // + // @internal + streamText(options?: StreamTextOptions): Promise; +} + +// @public +export interface DataStreamRoomApi { + // (undocumented) + registerByteStreamHandler(topic: string, callback: ByteStreamHandler): void; + // (undocumented) + registerTextStreamHandler(topic: string, callback: TextStreamHandler): void; + // (undocumented) + unregisterByteStreamHandler(topic: string): void; + // (undocumented) + unregisterTextStreamHandler(topic: string): void; +} + +// Warning: (ae-forgotten-export) The symbol "DataTrackExtension" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class DataTrackE2eeExtension extends DataTrackExtension { + constructor(keyIndex: number, iv: NonSharedUint8Array); + // (undocumented) + iv: NonSharedUint8Array; + // (undocumented) + keyIndex: number; + // (undocumented) + static lengthBytes: number; + // Warning: (ae-forgotten-export) The symbol "DataTrackExtensionTag" needs to be exported by the entry point index.d.ts + // + // (undocumented) + static tag: DataTrackExtensionTag; + // (undocumented) + toBinaryInto(dataView: DataView): Throws; + // (undocumented) + toBinaryLengthBytes(): number; + // (undocumented) + toJSON(): { + tag: number; + lengthBytes: number; + keyIndex: number; + iv: Uint8Array; + }; +} + +// Warning: (ae-forgotten-export) The symbol "Serializable" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class DataTrackExtensions extends Serializable { + constructor(opts?: { + userTimestamp?: DataTrackUserTimestampExtension; + e2ee?: DataTrackE2eeExtension; + }); + // (undocumented) + e2ee?: DataTrackE2eeExtension; + // Warning: (ae-forgotten-export) The symbol "DataTrackDeserializeError" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "DataTrackDeserializeErrorReason" needs to be exported by the entry point index.d.ts + // + // (undocumented) + static fromBinary(input: Input): Throws<[ + extensions: DataTrackExtensions, + byteLength: number + ], DataTrackDeserializeError>; + // (undocumented) + toBinaryInto(dataView: DataView): Throws; + // (undocumented) + toBinaryLengthBytes(): number; + // (undocumented) + toJSON(): { + userTimestamp: { + tag: number; + lengthBytes: number; + timestamp: bigint; + } | null; + e2ee: { + tag: number; + lengthBytes: number; + keyIndex: number; + iv: Uint8Array; + } | null; + }; + // (undocumented) + userTimestamp?: DataTrackUserTimestampExtension; +} + +// @public +export type DataTrackFrame = { + payload: NonSharedUint8Array; + userTimestamp?: bigint; +}; + +// @public +export interface DataTrackLocalParticipantApi { + // Warning: (ae-forgotten-export) The symbol "DataTrackOptions" needs to be exported by the entry point index.d.ts + publishDataTrack(options: DataTrackOptions): Promise; +} + +// @public +export class DataTrackPacket extends Serializable { + constructor(header: DataTrackPacketHeader, payload: NonSharedUint8Array); + // (undocumented) + static fromBinary(input: Input): Throws<[packet: DataTrackPacket, byteLength: number], DataTrackDeserializeError>; + // (undocumented) + header: DataTrackPacketHeader; + // (undocumented) + payload: NonSharedUint8Array; + // Warning: (ae-forgotten-export) The symbol "DataTrackSerializeError" needs to be exported by the entry point index.d.ts + // + // (undocumented) + toBinaryInto(dataView: DataView): Throws; + // (undocumented) + toBinaryLengthBytes(): number; + // (undocumented) + toJSON(): { + header: { + marker: FrameMarker; + trackHandle: number; + sequence: number; + frameNumber: number; + timestamp: number; + extensions: { + userTimestamp: { + tag: number; + lengthBytes: number; + timestamp: bigint; + } | null; + e2ee: { + tag: number; + lengthBytes: number; + keyIndex: number; + iv: Uint8Array; + } | null; + }; + }; + payload: Uint8Array; + }; +} + +// @public +export class DataTrackPacketHeader extends Serializable { + constructor(opts: { + marker: FrameMarker; + trackHandle: DataTrackHandle; + sequence: WrapAroundUnsignedInt; + frameNumber: WrapAroundUnsignedInt; + timestamp: DataTrackTimestamp<90000>; + extensions?: DataTrackExtensions; + }); + // (undocumented) + extensions: DataTrackExtensions; + // (undocumented) + frameNumber: WrapAroundUnsignedInt; + // (undocumented) + static fromBinary(input: Input): Throws<[header: DataTrackPacketHeader, byteLength: number], DataTrackDeserializeError>; + // (undocumented) + marker: FrameMarker; + // Warning: (ae-forgotten-export) The symbol "WrapAroundUnsignedInt" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "U16_MAX_SIZE" needs to be exported by the entry point index.d.ts + // + // (undocumented) + sequence: WrapAroundUnsignedInt; + // Warning: (ae-forgotten-export) The symbol "DataTrackTimestamp" needs to be exported by the entry point index.d.ts + // + // (undocumented) + timestamp: DataTrackTimestamp<90000>; + // Warning: (ae-forgotten-export) The symbol "DataTrackSerializeErrorReason" needs to be exported by the entry point index.d.ts + // + // (undocumented) + toBinaryInto(dataView: DataView): Throws>; + // (undocumented) + toBinaryLengthBytes(): number; + // (undocumented) + toJSON(): { + marker: FrameMarker; + trackHandle: number; + sequence: number; + frameNumber: number; + timestamp: number; + extensions: { + userTimestamp: { + tag: number; + lengthBytes: number; + timestamp: bigint; + } | null; + e2ee: { + tag: number; + lengthBytes: number; + keyIndex: number; + iv: Uint8Array; + } | null; + }; + }; + // Warning: (ae-forgotten-export) The symbol "DataTrackHandle" needs to be exported by the entry point index.d.ts + // + // (undocumented) + trackHandle: DataTrackHandle; +} + +// @public (undocumented) +export type DataTrackSubscribeOptions = { + signal?: AbortSignal; + bufferSize?: number; +}; + +// @public (undocumented) +export class DataTrackUserTimestampExtension extends DataTrackExtension { + constructor(timestamp: bigint); + // (undocumented) + static lengthBytes: number; + // (undocumented) + static tag: DataTrackExtensionTag; + // (undocumented) + timestamp: bigint; + // (undocumented) + toBinaryInto(dataView: DataView): Throws; + // (undocumented) + toBinaryLengthBytes(): number; + // (undocumented) + toJSON(): { + tag: number; + lengthBytes: number; + timestamp: bigint; + }; +} + +// @public (undocumented) +export type DecodeRatchetOptions = { + ratchetCount: number; + encryptionKey?: CryptoKey; +}; + +// @public +export function decodeTokenPayload(token: string): TokenPayload; + +// @public (undocumented) +export interface DecryptDataRequestMessage extends BaseMessage { + // (undocumented) + data: { + uuid: string; + payload: NonSharedUint8Array; + iv: NonSharedUint8Array; + participantIdentity: string; + keyIndex: number; + }; + // (undocumented) + kind: 'decryptDataRequest'; +} + +// @public (undocumented) +export interface DecryptDataResponseMessage extends BaseMessage { + // (undocumented) + data: { + uuid: string; + payload: NonSharedUint8Array; + }; + // (undocumented) + kind: 'decryptDataResponse'; +} + +// @public (undocumented) +export class DefaultReconnectPolicy implements ReconnectPolicy { + constructor(retryDelays?: number[]); + // (undocumented) + nextRetryDelayInMs(context: ReconnectContext): number | null; +} + +// @public +export function deriveKeys(material: CryptoKey, options: KeyProviderOptions): Promise<{ + material: CryptoKey; + encryptionKey: CryptoKey; +}>; + +// Warning: (ae-internal-missing-underscore) The name "detachTrack" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export function detachTrack(track: MediaStreamTrack, element: HTMLMediaElement): void; + +// @public (undocumented) +export type DevelopmentTokenServerOptions = { + baseUrl?: string; +}; + +// @public (undocumented) +export class DeviceUnsupportedError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "DeviceUnsupportedError"; +} + +export { DisconnectReason } + +// @public +export interface Disposable { + dispose(): void; +} + +// @public (undocumented) +export type E2EEManagerCallbacks = { + [EncryptionEvent.ParticipantEncryptionStatusChanged]: (enabled: boolean, participant: Participant) => void; + [EncryptionEvent.EncryptionError]: (error: Error, participantIdentity?: string) => void; +}; + +// @public (undocumented) +export type E2EEManagerOptions = { + keyProvider: BaseKeyProvider; + worker: Worker; +}; + +// @public (undocumented) +export type E2EEOptions = E2EEManagerOptions | { + e2eeManager: BaseE2EEManager; +}; + +// @public +export interface E2eeRoomApi { + // (undocumented) + setE2EEEnabled(enabled: boolean): Promise; +} + +// @public (undocumented) +export type E2EEWorkerMessage = InitMessage | SetKeyMessage | EncodeMessage | ErrorMessage | EnableMessage | RemoveTransformMessage | RTPVideoMapMessage | UpdateCodecMessage | RatchetRequestMessage | RatchetMessage | SifTrailerMessage | InitAck | DecryptDataRequestMessage | DecryptDataResponseMessage | EncryptDataRequestMessage | EncryptDataResponseMessage | PTMetadataFromE2EEMessage | LogMessage | SetLogLevelMessage; + +// @public (undocumented) +export interface ElementInfo { + // (undocumented) + element: object; + // (undocumented) + handleResize?: () => void; + // (undocumented) + handleVisibilityChanged?: () => void; + // (undocumented) + height(): number; + // (undocumented) + observe(): void; + // (undocumented) + pictureInPicture: boolean; + // (undocumented) + stopObserving(): void; + // (undocumented) + visibilityChangedAt: number | undefined; + // (undocumented) + visible: boolean; + // (undocumented) + width(): number; +} + +// @public (undocumented) +export interface EnableMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity: string; + enabled: boolean; + }; + // (undocumented) + kind: 'enable'; +} + +// @public (undocumented) +export interface EncodeMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity: string; + readableStream: ReadableStream; + writableStream: WritableStream; + trackId: string; + codec?: VideoCodec; + hasPacketTrailer: boolean; + packetTrailer?: FrameMetadataPublishOptions; + }; + // (undocumented) + kind: 'decode' | 'encode'; +} + +// @public (undocumented) +export interface EncryptDataRequestMessage extends BaseMessage { + // (undocumented) + data: { + uuid: string; + payload: NonSharedUint8Array; + participantIdentity: string; + }; + // (undocumented) + kind: 'encryptDataRequest'; +} + +// @public (undocumented) +export interface EncryptDataResponseMessage extends BaseMessage { + // (undocumented) + data: { + uuid: string; + payload: NonSharedUint8Array; + iv: NonSharedUint8Array; + keyIndex: number; + }; + // (undocumented) + kind: 'encryptDataResponse'; +} + +export { Encryption_Type } + +// @public (undocumented) +export enum EncryptionEvent { + // (undocumented) + EncryptionError = "encryptionError", + // (undocumented) + ParticipantEncryptionStatusChanged = "participantEncryptionStatusChanged" +} + +// @public (undocumented) +export type EndpointOptions = Omit; + +// Warning: (ae-internal-missing-underscore) The name "EngineEvent" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export enum EngineEvent { + // (undocumented) + ActiveSpeakersUpdate = "activeSpeakersUpdate", + // (undocumented) + Closing = "closing", + // (undocumented) + Connected = "connected", + // (undocumented) + ConnectionQualityUpdate = "connectionQualityUpdate", + // (undocumented) + DataPacketReceived = "dataPacketReceived", + // (undocumented) + DataTrackPacketReceived = "dataTrackPacketReceived", + // (undocumented) + DataTrackSubscriberHandles = "dataTrackSubscriberHandles", + // (undocumented) + DCBufferStatusChanged = "dcBufferStatusChanged", + // (undocumented) + Disconnected = "disconnected", + // (undocumented) + Joined = "joined", + // (undocumented) + LocalTrackSubscribed = "localTrackSubscribed", + // (undocumented) + LocalTrackUnpublished = "localTrackUnpublished", + // (undocumented) + MediaTrackAdded = "mediaTrackAdded", + // (undocumented) + Offline = "offline", + // (undocumented) + ParticipantUpdate = "participantUpdate", + // (undocumented) + PublishDataTrackResponse = "publishDataTrackResponse", + // (undocumented) + RemoteMute = "remoteMute", + // (undocumented) + RequestSubscribedCodecRefresh = "requestSubscribedCodecRefresh", + // (undocumented) + Restarted = "restarted", + // (undocumented) + Restarting = "restarting", + // (undocumented) + Resumed = "resumed", + // (undocumented) + Resuming = "resuming", + // (undocumented) + RoomMoved = "roomMoved", + // (undocumented) + RoomUpdate = "roomUpdate", + // (undocumented) + RTPVideoMapUpdate = "rtpVideoMapUpdate", + // (undocumented) + ServerRegionsReported = "serverRegionsReported", + // (undocumented) + SignalConnected = "signalConnected", + // (undocumented) + SignalRequestResponse = "signalRequestResponse", + // (undocumented) + SignalRestarted = "signalRestarted", + // (undocumented) + SignalResumed = "signalResumed", + // (undocumented) + SpeakersChanged = "speakersChanged", + // (undocumented) + StreamStateChanged = "streamStateChanged", + // (undocumented) + SubscribedQualityUpdate = "subscribedQualityUpdate", + // (undocumented) + SubscriptionError = "subscriptionError", + // (undocumented) + SubscriptionPermissionUpdate = "subscriptionPermissionUpdate", + // (undocumented) + TokenRefreshed = "tokenRefreshed", + // (undocumented) + TransportsCreated = "transportsCreated", + // (undocumented) + UnPublishDataTrackResponse = "unPublishDataTrackResponse" +} + +// @public +export interface EngineHooks { + onEngineCreated?(engine: RTCEngine): void; +} + +// @public (undocumented) +export interface ErrorMessage extends BaseMessage { + // (undocumented) + data: { + error: Error; + participantIdentity?: string; + uuid?: string; + }; + // (undocumented) + kind: 'error'; +} + +// Warning: (ae-forgotten-export) The symbol "UnionToIntersection" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "ApiOf" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "All" needs to be exported by the entry point index.d.ts +// +// @public +export type ExtensionApis = UnionToIntersection>> & { + localParticipant: UnionToIntersection>>; +}; + +// Warning: (ae-forgotten-export) The symbol "CoreSlots" needs to be exported by the entry point index.d.ts +// +// @public +export type ExtensionResult = Partial & LocalParticipantApiProvider & Disposable> & EngineHooks & ConnectionHooks & ParticipantHooks & DataPacketOwner & Partial & SyncStateProvider; + +// @public +export class ExternalE2EEKeyProvider extends BaseKeyProvider { + constructor(options?: Partial>); + // (undocumented) + ratchetInterval: number | undefined; + setKey(key: string | ArrayBuffer): Promise; +} + +// Warning: (ae-forgotten-export) The symbol "FacingModeFromLocalTrackReturnValue" needs to be exported by the entry point index.d.ts +// +// @public +export function facingModeFromDeviceLabel(deviceLabel: string): FacingModeFromLocalTrackReturnValue | undefined; + +// Warning: (ae-forgotten-export) The symbol "FacingModeFromLocalTrackOptions" needs to be exported by the entry point index.d.ts +// +// @public +export function facingModeFromLocalTrack(localTrack: LocalTrack | MediaStreamTrack, options?: FacingModeFromLocalTrackOptions): FacingModeFromLocalTrackReturnValue; + +// @public (undocumented) +export interface FrameMetadata { + // (undocumented) + frameId: number; + // (undocumented) + userData?: Uint8Array; + // (undocumented) + userTimestamp: bigint; +} + +// @public +export class FrameMetadataManager { + constructor(options?: FrameMetadataOptions); + dispose(): void; + // @internal (undocumented) + setup(room: CoreRoom): void; +} + +// @public (undocumented) +export interface FrameMetadataOptions { + worker: Worker; +} + +// @public (undocumented) +export interface FrameMetadataPublishOptions { + // (undocumented) + frameId?: boolean; + // (undocumented) + timestamp?: boolean; +} + +// Warning: (ae-forgotten-export) The symbol "BrowserDetails" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function getBrowser(userAgent?: string, force?: boolean): BrowserDetails | undefined; + +// @public +export function getEmptyAudioStreamTrack(): MediaStreamTrack; + +// @public (undocumented) +export function getEmptyVideoStreamTrack(): MediaStreamTrack; + +// Warning: (ae-forgotten-export) The symbol "ContextProvider" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "StructuredLogger" needs to be exported by the entry point index.d.ts +// +// @public +export function getLogger(name: string, ctxFn?: ContextProvider): StructuredLogger; + +// Warning: (ae-internal-missing-underscore) The name "getVideoCapture" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export function getVideoCapture(): VideoCapture; + +// @public (undocumented) +export function importKey(keyBytes: NonSharedUint8Array | ArrayBuffer, algorithm?: string | { + name: string; +}, usage?: 'derive' | 'encrypt'): Promise; + +// @public (undocumented) +export interface InitAck extends BaseMessage { + // (undocumented) + data: { + enabled: boolean; + }; + // (undocumented) + kind: 'initAck'; +} + +// @public (undocumented) +export interface InitMessage extends BaseMessage { + // (undocumented) + data: { + keyProviderOptions: KeyProviderOptions; + loglevel: LogLevel; + }; + // (undocumented) + kind: 'init'; +} + +// @public (undocumented) +export type InstantiableCheck = { + new (url: string, token: string, options?: CheckerOptions): T; +}; + +// @public +export interface InternalRoomConnectOptions { + autoSubscribe: boolean; + disableIceLite: boolean; + maxRetries: number; + peerConnectionTimeout: number; + rtcConfig?: RTCConfiguration; + subscriberAllowPause?: boolean; + websocketTimeout: number; +} + +// @public +export interface InternalRoomOptions { + adaptiveStream: AdaptiveStreamSettings | boolean; + audioCaptureDefaults?: AudioCaptureOptions; + audioOutput?: AudioOutputOptions; + dataStream?: RoomDataStreamOptions; + disconnectOnPageLeave: boolean; + dynacast: boolean; + // @deprecated (undocumented) + e2ee?: E2EEOptions; + encryption?: E2EEOptions; + // @internal + expSignalLatency?: number; + frameMetadata?: FrameMetadataOptions; + // (undocumented) + loggerName?: string; + // @deprecated (undocumented) + packetTrailer?: FrameMetadataOptions; + publishDefaults?: TrackPublishDefaults; + reconnectPolicy: ReconnectPolicy; + singlePeerConnection: boolean; + stopLocalTrackOnUnpublish: boolean; + videoCaptureDefaults?: VideoCaptureOptions; + webAudioMix: boolean | WebAudioSettings; +} + +// @public (undocumented) +export function isAudioCodec(maybeCodec: string): maybeCodec is AudioCodec; + +// @public (undocumented) +export function isAudioTrack(track: Track | undefined): track is LocalAudioTrack | RemoteAudioTrack; + +// @public @deprecated (undocumented) +export const isBackupCodec: typeof isBackupVideoCodec; + +// @public (undocumented) +export function isBackupVideoCodec(codec: string): codec is BackupVideoCodec; + +// @public (undocumented) +export function isBrowserSupported(): boolean; + +// @public (undocumented) +export function isE2EESupported(): boolean; + +// @public (undocumented) +export function isInsertableStreamSupported(): boolean; + +// @public (undocumented) +export function isLocalParticipant(p: Participant): p is LocalParticipant; + +// @public (undocumented) +export function isLocalTrack(track: Track | MediaStreamTrack | undefined): track is LocalTrack; + +// @public (undocumented) +export function isRemoteParticipant(p: Participant): p is RemoteParticipant; + +// @public (undocumented) +export function isRemoteTrack(track: Track | undefined): track is RemoteTrack; + +// @public (undocumented) +export function isScriptTransformSupported(): boolean; + +// Warning: (ae-incompatible-release-tags) The symbol "isSerializer" is marked as @public, but its signature references "Serializer" which is marked as @beta +// +// @public (undocumented) +export function isSerializer(v: unknown): v is Serializer; + +// @public (undocumented) +export function isSVCCodec(codec?: string): boolean; + +// @public (undocumented) +export function isVideoCodec(maybeCodec: string): maybeCodec is VideoCodec; + +// @public (undocumented) +export function isVideoFrame(frame: RTCEncodedAudioFrame | RTCEncodedVideoFrame): frame is RTCEncodedVideoFrame; + +// @public (undocumented) +export function isVideoTrack(track: Track | undefined): track is LocalVideoTrack | RemoteVideoTrack; + +// @public (undocumented) +export enum KeyHandlerEvent { + KeyRatcheted = "keyRatcheted" +} + +// @public (undocumented) +export type KeyInfo = { + key: CryptoKey; + participantIdentity?: string; + keyIndex?: number; +}; + +// @public (undocumented) +export type KeyProviderCallbacks = { + [KeyProviderEvent.SetKey]: (keyInfo: KeyInfo, updateCurrentKeyIndex: boolean) => void; + [KeyProviderEvent.RatchetRequest]: (participantIdentity?: string, keyIndex?: number) => void; + [KeyProviderEvent.KeyRatcheted]: (ratchetedResult: RatchetResult, participantIdentity?: string, keyIndex?: number) => void; +}; + +// @public (undocumented) +export enum KeyProviderEvent { + KeyRatcheted = "keyRatcheted", + RatchetRequest = "ratchetRequest", + // (undocumented) + SetKey = "setKey" +} + +// @public (undocumented) +export type KeyProviderOptions = { + sharedKey: boolean; + ratchetSalt: string; + ratchetWindowSize: number; + failureTolerance: number; + keyringSize: number; + keySize: 128 | 256; +}; + +// @public (undocumented) +export type KeySet = { + material: CryptoKey; + encryptionKey: CryptoKey; +}; + +// @public +export class LivekitError extends Error { + constructor(code: number, message?: string, options?: { + cause?: unknown; + }); + // (undocumented) + cause?: unknown; + // (undocumented) + code: number; +} + +// @public (undocumented) +export type LiveKitReactNativeInfo = { + platform: 'ios' | 'android' | 'windows' | 'macos' | 'web' | 'native'; + devicePixelRatio: number; +}; + +// @public +export abstract class LivekitReasonedError extends LivekitError { + // (undocumented) + abstract reason: Reason; + // (undocumented) + abstract reasonName: string; +} + +// @public (undocumented) +export class LocalAudioTrack extends LocalTrack { + constructor(mediaTrack: MediaStreamTrack, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, audioContext?: AudioContext, loggerOptions?: LoggerOptions); + // (undocumented) + applyConstraints(constraints: Pick): Promise; + // (undocumented) + checkForSilence(): Promise; + get enhancedNoiseCancellation(): boolean; + // (undocumented) + getSenderStats(): Promise; + // (undocumented) + protected internalStopProcessor(keepElement?: boolean): Promise; + // (undocumented) + protected monitorSender: () => Promise; + // (undocumented) + mute(): Promise; + // (undocumented) + protected onMediaStreamTrackChanged(): Promise; + // (undocumented) + protected processor?: TrackProcessor | undefined; + // (undocumented) + protected restart(constraints?: MediaTrackConstraints, isUnmuting?: boolean): Promise; + // (undocumented) + restartTrack(options?: AudioCaptureOptions): Promise; + // @internal + setAudioContext(audioContext: AudioContext | undefined): Promise; + setProcessor(processor: TrackProcessor): Promise; + // (undocumented) + startMonitor(): void; + // (undocumented) + stop(): void; + // @internal (undocumented) + stopOnMute: boolean; + // (undocumented) + unmute(): Promise; +} + +// Warning: (ae-forgotten-export) The symbol "ILocalTrack" needs to be exported by the entry point index.d.ts +// Warning: (ae-forgotten-export) The symbol "IDataTrack" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class LocalDataTrack implements ILocalTrack, IDataTrack { + // @internal + constructor(options: DataTrackOptions, manager: OutgoingDataTrackManager); + // Warning: (ae-forgotten-export) The symbol "Descriptor" needs to be exported by the entry point index.d.ts + protected get descriptor(): Descriptor | null; + flush(): Promise; + // Warning: (ae-forgotten-export) The symbol "Future" needs to be exported by the entry point index.d.ts + protected flushedFuture: Future; + protected handle: DataTrackHandle | null; + // Warning: (ae-forgotten-export) The symbol "DataTrackInfo" needs to be exported by the entry point index.d.ts + get info(): DataTrackInfo | undefined; + // (undocumented) + protected isFlushed: boolean; + // (undocumented) + readonly isLocal = true; + // (undocumented) + isPublished(): this is { + info: DataTrackInfo; + }; + // (undocumented) + protected log: StructuredLogger; + // Warning: (ae-forgotten-export) The symbol "OutgoingDataTrackManager" needs to be exported by the entry point index.d.ts + // + // (undocumented) + protected manager: OutgoingDataTrackManager; + // (undocumented) + protected options: DataTrackOptions; + // @internal + publish(signal?: AbortSignal): Promise; + // (undocumented) + readonly trackSymbol: symbol; + // Warning: (ae-forgotten-export) The symbol "DataTrackPushFrameError" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "DataTrackPushFrameErrorReason" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "DataTrackPushFrameErrorReason" needs to be exported by the entry point index.d.ts + tryPush(frame: DataTrackFrame): Promise | DataTrackPushFrameError>>; + // (undocumented) + readonly typeSymbol: symbol; + unpublish(): Promise; + // @internal (undocumented) + static withExplicitHandle(options: DataTrackOptions, manager: OutgoingDataTrackManager, handle: DataTrackHandle): LocalDataTrack; +} + +// @public (undocumented) +export class LocalParticipant extends Participant { + // @internal + constructor(sid: string, identity: string, engine: RTCEngine, options: InternalRoomOptions, slots?: Partial); + // @internal (undocumented) + activeDeviceMap: Map; + // (undocumented) + audioTrackPublications: Map; + createTracks(options?: CreateLocalTracksOptions): Promise; + // @internal (undocumented) + enabledPublishVideoCodecs: Codec[]; + // @internal (undocumented) + engine: RTCEngine; + // (undocumented) + getTrackPublication(source: Track.Source): LocalTrackPublication | undefined; + // (undocumented) + getTrackPublicationByName(name: string): LocalTrackPublication | undefined; + // (undocumented) + get isE2EEEnabled(): boolean; + // (undocumented) + get isLocal(): boolean; + // (undocumented) + get lastCameraError(): Error | undefined; + // (undocumented) + get lastMicrophoneError(): Error | undefined; + // @internal (undocumented) + normalizeRequestedFrameMetadataOptions(track: LocalTrack, opts: TrackPublishOptions): PacketTrailerFeature[]; + // @internal (undocumented) + pendingPublishing: Set; + publishData(data: NonSharedUint8Array, options?: DataPublishOptions): Promise; + publishDtmf(code: number, digit: string): Promise; + publishTrack(track: LocalTrack | MediaStreamTrack, options?: TrackPublishOptions): Promise; + // (undocumented) + republishAllTracks(options?: TrackPublishOptions, restartTracks?: boolean): Promise; + // @internal (undocumented) + setActiveAgent(agent: RemoteParticipant | undefined): void; + setAttributes(attributes: Record): Promise; + // @internal (undocumented) + setE2EEEnabled(enabled: boolean): Promise; + // @internal (undocumented) + setEnabledPublishCodecs(codecs: Codec[]): void; + setMetadata(metadata: string): Promise; + setMicrophoneEnabled(enabled: boolean, options?: AudioCaptureOptions, publishOptions?: TrackPublishOptions): Promise; + setName(name: string): Promise; + // @internal + setTrackEnabled(source: Extract, enabled: boolean, options?: VideoCaptureOptions, publishOptions?: TrackPublishOptions): Promise; + // (undocumented) + setTrackEnabled(source: Extract, enabled: boolean, options?: AudioCaptureOptions, publishOptions?: TrackPublishOptions): Promise; + // (undocumented) + setTrackEnabled(source: Extract, enabled: boolean, options?: ScreenShareCaptureOptions, publishOptions?: TrackPublishOptions): Promise; + setTrackSubscriptionPermissions(allParticipantsAllowed: boolean, participantTrackPermissions?: ParticipantTrackPermission[]): void; + // @internal (undocumented) + setupEngine(engine: RTCEngine): void; + // @internal + get trackLoggerOptions(): { + loggerName: string | undefined; + loggerContextCb: () => { + [x: string]: unknown; + }; + }; + trackPublications: Map; + // (undocumented) + unpublishTrack(track: LocalTrack | MediaStreamTrack, stopOnUnpublish?: boolean): Promise; + // (undocumented) + unpublishTracks(tracks: LocalTrack[] | MediaStreamTrack[]): Promise; + // @internal (undocumented) + updateInfo(info: ParticipantInfo): boolean; + // (undocumented) + videoTrackPublications: Map; +} + +// @public +export interface LocalParticipantApiProvider { + // (undocumented) + localParticipant: LocalParticipantApi; +} + +// @public (undocumented) +export abstract class LocalTrack extends Track { + protected constructor(mediaTrack: MediaStreamTrack, kind: TrackKind, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, loggerOptions?: LoggerOptions); + // (undocumented) + protected audioContext?: AudioContext; + // @internal (undocumented) + codec?: VideoCodec; + // (undocumented) + get constraints(): MediaTrackConstraints; + // (undocumented) + protected _constraints: MediaTrackConstraints; + // (undocumented) + get dimensions(): Track.Dimensions | undefined; + // (undocumented) + getDeviceId(normalize?: boolean): Promise; + // @internal (undocumented) + getPreConnectBuffer(): ReadableStream | undefined; + // (undocumented) + getPreConnectBufferMimeType(): string | undefined; + getProcessor(): TrackProcessor | undefined; + getRTCStatsReport(): Promise; + // @internal + getSourceTrackSettings(): MediaTrackSettings; + // (undocumented) + protected handleAppVisibilityChanged(): Promise; + // (undocumented) + get hasPreConnectBuffer(): boolean; + // (undocumented) + get id(): string; + // @internal + protected internalStopProcessor(keepElement?: boolean): Promise; + // (undocumented) + get isLocal(): boolean; + // (undocumented) + get isStopped(): boolean; + // (undocumented) + get isUpstreamPaused(): boolean; + // (undocumented) + get isUserProvided(): boolean; + // (undocumented) + protected localTrackRecorder: LocalTrackRecorder | undefined; + // (undocumented) + protected manuallyStopped: boolean; + // (undocumented) + get mediaStreamTrack(): MediaStreamTrack; + // (undocumented) + protected abstract monitorSender(): void; + // (undocumented) + mute(): Promise; + // (undocumented) + protected muteLock: Mutex; + // (undocumented) + protected get needsReAcquisition(): boolean; + protected onMediaStreamTrackChanged(): Promise; + protected onSenderTrackSwapped(): Promise; + pauseUpstream(): Promise; + // (undocumented) + protected pauseUpstreamLock: Mutex; + // (undocumented) + protected pendingDeviceChange: boolean; + // (undocumented) + protected processor?: TrackProcessor; + // (undocumented) + protected processorElement?: HTMLMediaElement; + // (undocumented) + protected providedByUser: boolean; + // (undocumented) + protected reacquireTrack: boolean; + // (undocumented) + replaceTrack(track: MediaStreamTrack, options?: ReplaceTrackOptions): Promise; + // (undocumented) + replaceTrack(track: MediaStreamTrack, userProvidedTrack?: boolean): Promise; + // (undocumented) + protected restart(constraints?: MediaTrackConstraints, isUnmuting?: boolean): Promise; + // (undocumented) + abstract restartTrack(constraints?: unknown): Promise; + // (undocumented) + resumeUpstream(): Promise; + // @internal (undocumented) + get sender(): RTCRtpSender | undefined; + set sender(sender: RTCRtpSender | undefined); + // (undocumented) + protected _sender?: RTCRtpSender; + // (undocumented) + setDeviceId(deviceId: ConstrainDOMString): Promise; + setProcessor(processor: TrackProcessor, showProcessedStreamLocally?: boolean): Promise; + // (undocumented) + protected setTrackMuted(muted: boolean): void; + // @internal (undocumented) + startPreConnectBuffer(timeslice?: number): void; + // (undocumented) + stop(): void; + // @internal (undocumented) + stopPreConnectBuffer(): void; + stopProcessor(keepElement?: boolean): Promise; + // (undocumented) + protected trackChangeLock: Mutex; + // (undocumented) + unmute(): Promise; + // (undocumented) + waitForDimensions(timeout?: number): Promise; +} + +// @public (undocumented) +export class LocalTrackPublication extends TrackPublication { + constructor(kind: Track.Kind, ti: TrackInfo, track?: LocalTrack, loggerOptions?: LoggerOptions); + // (undocumented) + get audioTrack(): LocalAudioTrack | undefined; + // (undocumented) + getTrackFeatures(): AudioTrackFeature[]; + // (undocumented) + handleTrackEnded: () => void; + // (undocumented) + get isLocal(): boolean; + // (undocumented) + get isMuted(): boolean; + // (undocumented) + get isUpstreamPaused(): boolean | undefined; + mute(): Promise | undefined>; + // (undocumented) + options?: TrackPublishOptions; + pauseUpstream(): Promise; + resumeUpstream(): Promise; + // (undocumented) + setTrack(track?: Track): void; + // (undocumented) + track?: LocalTrack; + unmute(): Promise | undefined>; + // (undocumented) + get videoTrack(): LocalVideoTrack | undefined; +} + +// Warning: (ae-forgotten-export) The symbol "RecorderBase" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class LocalTrackRecorder extends RecorderBase { + constructor(track: T, options?: MediaRecorderOptions); + // (undocumented) + byteStream: ReadableStream; +} + +// @public (undocumented) +export class LocalVideoTrack extends LocalTrack { + constructor(mediaTrack: MediaStreamTrack, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean, loggerOptions?: LoggerOptions); + // (undocumented) + addSimulcastTrack(codec: VideoCodec, encodings?: RTCRtpEncodingParameters[]): SimulcastTrackInfo | undefined; + // (undocumented) + getSenderStats(): Promise; + // (undocumented) + protected handleAppVisibilityChanged(): Promise; + // (undocumented) + get isSimulcast(): boolean; + // (undocumented) + lastEncodedDimensions?: Track.Dimensions; + // (undocumented) + protected monitorSender: () => Promise; + // (undocumented) + mute(): Promise; + // (undocumented) + protected onSenderTrackSwapped(): Promise; + // (undocumented) + pauseUpstream(): Promise; + prioritizePerformance(): Promise; + // (undocumented) + publishOptions?: TrackPublishOptions; + // (undocumented) + refreshSubscribedCodecs(): Promise; + // (undocumented) + restartTrack(options?: VideoCaptureOptions): Promise; + // (undocumented) + resumeUpstream(): Promise; + // (undocumented) + get sender(): RTCRtpSender | undefined; + set sender(sender: RTCRtpSender | undefined); + // (undocumented) + setDegradationPreference(preference: RTCDegradationPreference): Promise; + setProcessor(processor: TrackProcessor, showProcessedStreamLocally?: boolean): Promise; + // @internal + setPublishingCodecs(codecs: SubscribedCodec[]): Promise; + // @internal + setPublishingLayers(isSvc: boolean, qualities: SubscribedQuality[]): Promise; + // (undocumented) + setPublishingQuality(maxQuality: VideoQuality): void; + // (undocumented) + setSimulcastTrackSender(codec: VideoCodec, sender: RTCRtpSender): Promise; + // (undocumented) + protected setTrackMuted(muted: boolean): void; + // Warning: (ae-forgotten-export) The symbol "SignalClient" needs to be exported by the entry point index.d.ts + // + // (undocumented) + signalClient?: SignalClient; + // Warning: (ae-forgotten-export) The symbol "SimulcastTrackInfo" needs to be exported by the entry point index.d.ts + // + // (undocumented) + simulcastCodecs: Map; + // (undocumented) + startMonitor(signalClient: SignalClient): void; + // (undocumented) + stop(): void; + // (undocumented) + unmute(): Promise; +} + +// @public (undocumented) +export enum LoggerNames { + // (undocumented) + DataTracks = "livekit-data-tracks", + // (undocumented) + Default = "livekit", + // (undocumented) + E2EE = "lk-e2ee", + // (undocumented) + Engine = "livekit-engine", + // (undocumented) + ICE = "livekit-ice", + // (undocumented) + Participant = "livekit-participant", + // (undocumented) + PCManager = "livekit-pc-manager", + // (undocumented) + PCTransport = "livekit-pc-transport", + // (undocumented) + Publication = "livekit-track-publication", + // (undocumented) + Region = "livekit-region", + // (undocumented) + Room = "livekit-room", + // (undocumented) + Signal = "livekit-signal", + // (undocumented) + Stats = "livekit-stats", + // (undocumented) + TokenSource = "livekit-token-source", + // (undocumented) + Track = "livekit-track" +} + +// @public (undocumented) +export enum LogLevel { + // (undocumented) + debug = 1, + // (undocumented) + error = 4, + // (undocumented) + info = 2, + // (undocumented) + silent = 5, + // (undocumented) + trace = 0, + // (undocumented) + warn = 3 +} + +// @public (undocumented) +export interface LogMessage extends BaseMessage { + // (undocumented) + data: { + level: 'trace' | 'debug' | 'info' | 'warn' | 'error'; + msg: string; + context?: object; + }; + // (undocumented) + kind: 'log'; +} + +// @public (undocumented) +export enum MediaDeviceFailure { + // (undocumented) + DeviceInUse = "DeviceInUse", + // (undocumented) + NotFound = "NotFound", + // (undocumented) + Other = "Other", + // (undocumented) + PermissionDenied = "PermissionDenied" +} + +// @public (undocumented) +export namespace MediaDeviceFailure { + // (undocumented) + export function getFailure(error: any): MediaDeviceFailure | undefined; +} + +export { Mutex } + +// @public (undocumented) +export function needsRbspUnescaping(frameData: NonSharedUint8Array): boolean; + +// @public (undocumented) +export class NegotiationError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "NegotiationError"; +} + +// @public @deprecated (undocumented) +export const PacketTrailerManager: typeof FrameMetadataManager; + +// @public @deprecated (undocumented) +export type PacketTrailerMetadata = FrameMetadata; + +// @public @deprecated (undocumented) +export type PacketTrailerOptions = FrameMetadataOptions; + +// @public @deprecated (undocumented) +export type PacketTrailerPublishOptions = FrameMetadataPublishOptions; + +// @public (undocumented) +export function parseRbsp(stream: NonSharedUint8Array): NonSharedUint8Array; + +// Warning: (ae-forgotten-export) The symbol "Participant_base" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class Participant extends Participant_base { + // @internal + constructor(sid: string, identity: string, name?: string, metadata?: string, attributes?: Record, loggerOptions?: LoggerOptions, kind?: ParticipantKind); + // (undocumented) + protected activeFuture?: Future; + // (undocumented) + protected addTrackPublication(publication: TrackPublication): void; + get attributes(): Readonly>; + // @internal (undocumented) + audioContext?: AudioContext; + audioLevel: number; + // (undocumented) + audioTrackPublications: Map; + // (undocumented) + get connectionQuality(): ConnectionQuality; + getTrackPublication(source: Track.Source): TrackPublication | undefined; + getTrackPublicationByName(name: string): TrackPublication | undefined; + // (undocumented) + getTrackPublications(): TrackPublication[]; + identity: string; + // (undocumented) + get isActive(): boolean; + // (undocumented) + get isAgent(): boolean; + // (undocumented) + get isCameraEnabled(): boolean; + // (undocumented) + get isEncrypted(): boolean; + // (undocumented) + get isLocal(): boolean; + // (undocumented) + get isMicrophoneEnabled(): boolean; + // (undocumented) + get isScreenShareEnabled(): boolean; + isSpeaking: boolean; + get joinedAt(): Date | undefined; + // (undocumented) + get kind(): ParticipantKind; + // (undocumented) + protected _kind: ParticipantKind; + // (undocumented) + lastSpokeAt?: Date | undefined; + // (undocumented) + protected log: StructuredLogger; + // (undocumented) + protected get logContext(): { + [x: string]: unknown; + }; + // (undocumented) + protected loggerOptions?: LoggerOptions; + metadata?: string; + name?: string; + // (undocumented) + protected participantInfo?: ParticipantInfo; + // (undocumented) + permissions?: ParticipantPermission; + // @internal (undocumented) + setAudioContext(ctx: AudioContext | undefined): Promise; + // @internal (undocumented) + setConnectionQuality(q: ConnectionQuality_2): void; + // @internal (undocumented) + setDisconnected(): void; + // @internal (undocumented) + setIsSpeaking(speaking: boolean): void; + // @internal (undocumented) + setPermissions(permissions: ParticipantPermission): boolean; + sid: string; + trackPublications: Map; + // @internal (undocumented) + updateInfo(info: ParticipantInfo): boolean; + // (undocumented) + videoTrackPublications: Map; + waitUntilActive(): Promise; +} + +// @public (undocumented) +export enum ParticipantEvent { + Active = "active", + AttributesChanged = "attributesChanged", + // @internal (undocumented) + AudioStreamAcquired = "audioStreamAcquired", + ChatMessage = "chatMessage", + ConnectionQualityChanged = "connectionQualityChanged", + DataReceived = "dataReceived", + IsSpeakingChanged = "isSpeakingChanged", + // @internal (undocumented) + LocalSenderCreated = "localSenderCreated", + LocalTrackCpuConstrained = "localTrackCpuConstrained", + LocalTrackPublished = "localTrackPublished", + LocalTrackSubscribed = "localTrackSubscribed", + LocalTrackUnpublished = "localTrackUnpublished", + // @internal (undocumented) + MediaDevicesError = "mediaDevicesError", + ParticipantMetadataChanged = "participantMetadataChanged", + ParticipantNameChanged = "participantNameChanged", + ParticipantPermissionsChanged = "participantPermissionsChanged", + // @internal (undocumented) + PCTrackAdded = "pcTrackAdded", + SipDTMFReceived = "sipDTMFReceived", + TrackCpuConstrained = "trackCpuConstrained", + TrackMuted = "trackMuted", + TrackPublished = "trackPublished", + TrackStreamStateChanged = "trackStreamStateChanged", + TrackSubscribed = "trackSubscribed", + TrackSubscriptionFailed = "trackSubscriptionFailed", + TrackSubscriptionPermissionChanged = "trackSubscriptionPermissionChanged", + TrackSubscriptionStatusChanged = "trackSubscriptionStatusChanged", + TrackUnmuted = "trackUnmuted", + TrackUnpublished = "trackUnpublished", + TrackUnsubscribed = "trackUnsubscribed", + // @beta + TranscriptionReceived = "transcriptionReceived" +} + +// @public (undocumented) +export type ParticipantEventCallbacks = { + trackPublished: (publication: RemoteTrackPublication) => void; + trackSubscribed: (track: RemoteTrack, publication: RemoteTrackPublication) => void; + trackSubscriptionFailed: (trackSid: string, reason?: SubscriptionError) => void; + trackUnpublished: (publication: RemoteTrackPublication) => void; + trackUnsubscribed: (track: RemoteTrack, publication: RemoteTrackPublication) => void; + trackMuted: (publication: TrackPublication) => void; + trackUnmuted: (publication: TrackPublication) => void; + localTrackPublished: (publication: LocalTrackPublication) => void; + localTrackUnpublished: (publication: LocalTrackPublication) => void; + localTrackCpuConstrained: (track: LocalVideoTrack, publication: LocalTrackPublication) => void; + localSenderCreated: (sender: RTCRtpSender, track: Track) => void; + participantMetadataChanged: (prevMetadata: string | undefined, participant?: any) => void; + participantNameChanged: (name: string) => void; + dataReceived: (payload: NonSharedUint8Array, kind: DataPacket_Kind, encryptionType?: Encryption_Type) => void; + sipDTMFReceived: (dtmf: SipDTMF) => void; + transcriptionReceived: (transcription: TranscriptionSegment[], publication?: TrackPublication) => void; + isSpeakingChanged: (speaking: boolean) => void; + connectionQualityChanged: (connectionQuality: ConnectionQuality) => void; + trackStreamStateChanged: (publication: RemoteTrackPublication, streamState: Track.StreamState) => void; + trackSubscriptionPermissionChanged: (publication: RemoteTrackPublication, status: TrackPublication.PermissionStatus) => void; + mediaDevicesError: (error: Error, kind?: MediaDeviceKind) => void; + audioStreamAcquired: () => void; + participantPermissionsChanged: (prevPermissions?: ParticipantPermission) => void; + trackSubscriptionStatusChanged: (publication: RemoteTrackPublication, status: TrackPublication.SubscriptionStatus) => void; + attributesChanged: (changedAttributes: Record) => void; + localTrackSubscribed: (trackPublication: LocalTrackPublication) => void; + chatMessage: (msg: ChatMessage) => void; + active: () => void; +}; + +// @public +export interface ParticipantHooks { + onParticipantCreated?(participant: RemoteParticipant, info: ParticipantInfo): void; + onParticipantUpdates?(infos: ParticipantInfo[]): void; +} + +// @public (undocumented) +export type ParticipantKeyHandlerCallbacks = { + [KeyHandlerEvent.KeyRatcheted]: (ratchetResult: RatchetResult, participantIdentity: string, keyIndex?: number) => void; +}; + +export { ParticipantKind } + +// @public (undocumented) +export interface ParticipantTrackPermission { + allowAll?: boolean; + allowedTrackSids?: string[]; + participantIdentity?: string; + participantSid?: string; +} + +// @public +export interface PerformRpcParams { + destinationIdentity: string; + method: string; + payload: string; + responseTimeout?: number; +} + +// @public (undocumented) +export type ProcessorOptions = { + kind: T; + track: MediaStreamTrack; + element?: HTMLMediaElement; + audioContext?: AudioContext; + localTrack?: LocalTrack; +}; + +// @public (undocumented) +export const protocolVersion = 17; + +// @public (undocumented) +export interface PTMetadataFromE2EEMessage extends BaseMessage { + // Warning: (ae-forgotten-export) The symbol "FrameMetadataPayload" needs to be exported by the entry point index.d.ts + // + // (undocumented) + data: FrameMetadataPayload; + // (undocumented) + kind: 'packetTrailerMetadata'; +} + +// @public (undocumented) +export type PublicationEventCallbacks = { + muted: () => void; + unmuted: () => void; + ended: (track?: Track) => void; + updateSettings: (settings: UpdateTrackSettings) => void; + subscriptionPermissionChanged: (status: TrackPublication.PermissionStatus, prevStatus: TrackPublication.PermissionStatus) => void; + updateSubscription: (sub: UpdateSubscription) => void; + subscribed: (track: RemoteTrack) => void; + unsubscribed: (track: RemoteTrack) => void; + subscriptionStatusChanged: (status: TrackPublication.SubscriptionStatus, prevStatus: TrackPublication.SubscriptionStatus) => void; + subscriptionFailed: (error: SubscriptionError) => void; + transcriptionReceived: (transcription: TranscriptionSegment[]) => void; + timeSyncUpdate: (timestamp: number) => void; + cpuConstrained: (track: LocalVideoTrack) => void; +}; + +// @public (undocumented) +export class PublishDataError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "PublishDataError"; +} + +// @public (undocumented) +export class PublishTrackError extends LivekitError { + constructor(message: string, status: number); + // (undocumented) + readonly name = "PublishTrackError"; + // (undocumented) + status: number; +} + +// @public +export function ratchet(material: CryptoKey, salt: string): Promise; + +// @public (undocumented) +export interface RatchetMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity: string; + keyIndex?: number; + ratchetResult: RatchetResult; + }; + // (undocumented) + kind: 'ratchetKey'; +} + +// @public (undocumented) +export interface RatchetRequestMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity?: string; + keyIndex?: number; + }; + // (undocumented) + kind: 'ratchetRequest'; +} + +// @public (undocumented) +export type RatchetResult = { + chainKey: ArrayBuffer; + cryptoKey: CryptoKey; +}; + +// @public (undocumented) +export interface ReconnectContext { + readonly elapsedMs: number; + readonly retryCount: number; + readonly retryReason?: Error; + // (undocumented) + readonly serverUrl?: string; +} + +// @public +export interface ReconnectPolicy { + nextRetryDelayInMs(context: ReconnectContext): number | null; +} + +// @public +export function releaseEmptyAudioStreamTrack(track: MediaStreamTrack): Promise; + +// @public (undocumented) +export class RemoteAudioTrack extends RemoteTrack { + constructor(mediaTrack: MediaStreamTrack, sid: string, receiver: RTCRtpReceiver, audioContext?: AudioContext, audioOutput?: AudioOutputOptions, loggerOptions?: LoggerOptions); + // (undocumented) + attach(): HTMLMediaElement; + // (undocumented) + attach(element: HTMLMediaElement): HTMLMediaElement; + detach(): HTMLMediaElement[]; + detach(element: HTMLMediaElement): HTMLMediaElement; + // (undocumented) + getReceiverStats(): Promise; + getVolume(): number; + // (undocumented) + protected monitorReceiver: () => Promise; + // @internal (undocumented) + setAudioContext(audioContext: AudioContext | undefined): void; + setSinkId(deviceId: string): Promise; + setVolume(volume: number): void; + // @internal (undocumented) + setWebAudioPlugins(nodes: AudioNode[]): void; +} + +// Warning: (ae-forgotten-export) The symbol "IRemoteTrack" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class RemoteDataTrack implements IRemoteTrack, IDataTrack { + // Warning: (ae-forgotten-export) The symbol "RemoteDataTrackOptions" needs to be exported by the entry point index.d.ts + // + // @internal + constructor(info: DataTrackInfo, manager: IncomingDataTrackManager, options: RemoteDataTrackOptions); + // (undocumented) + info: DataTrackInfo; + // (undocumented) + readonly isLocal = false; + // Warning: (ae-forgotten-export) The symbol "IncomingDataTrackManager" needs to be exported by the entry point index.d.ts + // + // (undocumented) + protected manager: IncomingDataTrackManager; + // (undocumented) + publisherIdentity: Participant['identity']; + setPipelineOptions(options: RemoteDataTrackPipelineOptions): void; + subscribe(options?: DataTrackSubscribeOptions): ReadableStream; + // (undocumented) + readonly trackSymbol: symbol; + // (undocumented) + readonly typeSymbol: symbol; +} + +// @public (undocumented) +export type RemoteDataTrackPipelineOptions = { + maxPartialFrames?: number; +}; + +// @public (undocumented) +export class RemoteParticipant extends Participant { + // @internal + constructor(signalClient: SignalClient, sid: string, identity?: string, name?: string, metadata?: string, attributes?: Record, loggerOptions?: LoggerOptions, kind?: ParticipantKind, remoteDataTracks?: Array, clientProtocol?: number, capabilities?: Array); + // @internal (undocumented) + addRemoteDataTrack(remoteDataTrack: RemoteDataTrack): void; + // @internal (undocumented) + addSubscribedMediaTrack(mediaTrack: MediaStreamTrack, sid: Track.SID, mediaStream: MediaStream, receiver: RTCRtpReceiver, adaptiveStreamSettings?: AdaptiveStreamSettings, triesLeft?: number): RemoteTrackPublication | undefined; + // (undocumented) + protected addTrackPublication(publication: RemoteTrackPublication): void; + // (undocumented) + audioTrackPublications: Map; + // @internal + capabilities: Array; + // @internal + clientProtocol: number; + // Warning: (ae-forgotten-export) The symbol "DeferrableMap" needs to be exported by the entry point index.d.ts + dataTracks: DeferrableMap; + // @internal (undocumented) + emit(event: E, ...args: Parameters): boolean; + // @internal (undocumented) + static fromParticipantInfo(signalClient: SignalClient, pi: ParticipantInfo, loggerOptions: LoggerOptions): RemoteParticipant; + // (undocumented) + getTrackPublication(source: Track.Source): RemoteTrackPublication | undefined; + // (undocumented) + getTrackPublicationByName(name: string): RemoteTrackPublication | undefined; + // @internal (undocumented) + getTrackPublicationBySid(sid: Track.SID): RemoteTrackPublication | undefined; + getVolume(source?: Track.Source.Microphone | Track.Source.ScreenShareAudio): number | undefined; + // @internal (undocumented) + get hasMetadata(): boolean; + // (undocumented) + protected get logContext(): { + remoteParticipantID: string; + remoteParticipant: string; + }; + // @internal (undocumented) + removeRemoteDataTrack(remoteDataTrackSid: RemoteDataTrack['info']['sid']): void; + // @internal (undocumented) + setAudioOutput(output: AudioOutputOptions): Promise; + setVolume(volume: number, source?: Track.Source.Microphone | Track.Source.ScreenShareAudio): void; + // @internal (undocumented) + signalClient: SignalClient; + // (undocumented) + trackPublications: Map; + // @internal (undocumented) + unpublishTrack(sid: Track.SID, sendUnpublish?: boolean): void; + // @internal (undocumented) + updateInfo(info: ParticipantInfo): boolean; + // (undocumented) + videoTrackPublications: Map; +} + +// @public (undocumented) +export abstract class RemoteTrack extends Track { + constructor(mediaTrack: MediaStreamTrack, sid: string, kind: TrackKind, receiver: RTCRtpReceiver, loggerOptions?: LoggerOptions); + getPlayoutDelay(): number; + getRTCStatsReport(): Promise; + // (undocumented) + get isLocal(): boolean; + // (undocumented) + protected abstract monitorReceiver(): void; + // @internal (undocumented) + receiver: RTCRtpReceiver | undefined; + // (undocumented) + registerTimeSyncUpdate(): void; + // @internal (undocumented) + setMediaStream(stream: MediaStream): void; + // @internal (undocumented) + setMuted(muted: boolean): void; + setPlayoutDelay(delayInSeconds: number): void; + // (undocumented) + start(): void; + // (undocumented) + startMonitor(): void; + // (undocumented) + stop(): void; + // (undocumented) + stopMonitor(): void; +} + +// @public (undocumented) +export class RemoteTrackPublication extends TrackPublication { + constructor(kind: Track.Kind, ti: TrackInfo, autoSubscribe: boolean | undefined, loggerOptions?: LoggerOptions); + // @internal (undocumented) + protected allowed: boolean; + // (undocumented) + emitTrackUpdate(): void; + // (undocumented) + protected fps?: number; + // (undocumented) + protected handleEnded: (track: RemoteTrack) => void; + // (undocumented) + protected handleVideoDimensionsChange: (dimensions: Track.Dimensions) => void; + // (undocumented) + protected handleVisibilityChange: (visible: boolean) => void; + // (undocumented) + protected get isAdaptiveStream(): boolean; + // (undocumented) + get isDesired(): boolean; + // (undocumented) + get isEnabled(): boolean; + // (undocumented) + get isLocal(): boolean; + get isSubscribed(): boolean; + // (undocumented) + get permissionStatus(): TrackPublication.PermissionStatus; + // (undocumented) + protected requestedDisabled: boolean | undefined; + // (undocumented) + protected requestedMaxQuality?: VideoQuality; + // (undocumented) + protected requestedVideoDimensions?: Track.Dimensions; + // @internal (undocumented) + setAllowed(allowed: boolean): void; + setEnabled(enabled: boolean): void; + setSubscribed(subscribed: boolean): void; + // @internal (undocumented) + setSubscriptionError(error: SubscriptionError): void; + // @internal (undocumented) + setTrack(track?: RemoteTrack): void; + setVideoDimensions(dimensions: Track.Dimensions): void; + // (undocumented) + setVideoFPS(fps: number): void; + setVideoQuality(quality: VideoQuality): void; + // (undocumented) + protected subscribed?: boolean; + // (undocumented) + protected subscriptionError?: SubscriptionError; + // (undocumented) + get subscriptionStatus(): TrackPublication.SubscriptionStatus; + // (undocumented) + track?: RemoteTrack; + // @internal (undocumented) + updateInfo(info: TrackInfo): void; + // (undocumented) + protected videoDimensionsAdaptiveStream?: Track.Dimensions; + // (undocumented) + get videoQuality(): VideoQuality | undefined; + // (undocumented) + protected visible: boolean; +} + +// @public (undocumented) +export class RemoteVideoTrack extends RemoteTrack { + constructor(mediaTrack: MediaStreamTrack, sid: string, receiver: RTCRtpReceiver, adaptiveStreamSettings?: AdaptiveStreamSettings, loggerOptions?: LoggerOptions); + // (undocumented) + attach(): HTMLMediaElement; + // (undocumented) + attach(element: HTMLMediaElement): HTMLMediaElement; + // (undocumented) + detach(): HTMLMediaElement[]; + // (undocumented) + detach(element: HTMLMediaElement): HTMLMediaElement; + // Warning: (ae-forgotten-export) The symbol "FrameMetadataExtractor" needs to be exported by the entry point index.d.ts + // + // @internal (undocumented) + frameMetadataExtractor?: FrameMetadataExtractor; + // @internal (undocumented) + getDecoderImplementation(): string | undefined; + // (undocumented) + getReceiverStats(): Promise; + // (undocumented) + protected handleAppVisibilityChanged(): Promise; + // (undocumented) + get isAdaptiveStream(): boolean; + lookupFrameMetadata(input: { + rtpTimestamp: number; + }): FrameMetadata | undefined; + get mediaStreamTrack(): MediaStreamTrack; + // (undocumented) + protected monitorReceiver: () => Promise; + // @internal + observeElementInfo(elementInfo: ElementInfo): void; + // @internal (undocumented) + setMuted(muted: boolean): void; + // (undocumented) + setStreamState(value: Track.StreamState): void; + // @internal + stopObservingElementInfo(elementInfo: ElementInfo): void; +} + +// @public (undocumented) +export interface RemoveTransformMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity: string; + trackId: string; + }; + // (undocumented) + kind: 'removeTransform'; +} + +// @public (undocumented) +export interface ReplaceTrackOptions { + // (undocumented) + stopProcessor?: boolean; + // (undocumented) + userProvidedTrack?: boolean; +} + +// @public (undocumented) +export type RequestErrorReason = Exclude | 'TimeoutError'; + +// @public +export class Room extends CoreRoom { + constructor(options?: RoomOptions); +} + +// @public +export interface RoomApiProvider { + // (undocumented) + room: RoomApi; +} + +// @public (undocumented) +export type RoomConfigurationObject = NonNullable[0]>; + +// @public +export interface RoomConnectOptions extends Partial { +} + +// @public +export interface RoomDataStreamOptions { + maxPayloadByteLength?: number; +} + +// @public +export enum RoomEvent { + ActiveDeviceChanged = "activeDeviceChanged", + ActiveSpeakersChanged = "activeSpeakersChanged", + AudioPlaybackStatusChanged = "audioPlaybackChanged", + // (undocumented) + ChatMessage = "chatMessage", + Connected = "connected", + ConnectionQualityChanged = "connectionQualityChanged", + ConnectionStateChanged = "connectionStateChanged", + DataReceived = "dataReceived", + DataTrackPublished = "dataTrackPublished", + DataTrackUnpublished = "dataTrackUnpublished", + DCBufferStatusChanged = "dcBufferStatusChanged", + Disconnected = "disconnected", + // (undocumented) + EncryptionError = "encryptionError", + LocalAudioSilenceDetected = "localAudioSilenceDetected", + LocalDataTrackPublished = "localDataTrackPublished", + LocalDataTrackUnpublished = "localDataTrackUnpublished", + LocalTrackPublished = "localTrackPublished", + LocalTrackSubscribed = "localTrackSubscribed", + LocalTrackUnpublished = "localTrackUnpublished", + MediaDevicesChanged = "mediaDevicesChanged", + MediaDevicesError = "mediaDevicesError", + MetricsReceived = "metricsReceived", + Moved = "moved", + ParticipantActive = "participantActive", + ParticipantAttributesChanged = "participantAttributesChanged", + ParticipantConnected = "participantConnected", + ParticipantDisconnected = "participantDisconnected", + // (undocumented) + ParticipantEncryptionStatusChanged = "participantEncryptionStatusChanged", + ParticipantMetadataChanged = "participantMetadataChanged", + ParticipantNameChanged = "participantNameChanged", + ParticipantPermissionsChanged = "participantPermissionsChanged", + Reconnected = "reconnected", + Reconnecting = "reconnecting", + RecordingStatusChanged = "recordingStatusChanged", + RoomMetadataChanged = "roomMetadataChanged", + SignalConnected = "signalConnected", + SignalReconnecting = "signalReconnecting", + SipDTMFReceived = "sipDTMFReceived", + TrackMuted = "trackMuted", + TrackPublished = "trackPublished", + TrackStreamStateChanged = "trackStreamStateChanged", + TrackSubscribed = "trackSubscribed", + TrackSubscriptionFailed = "trackSubscriptionFailed", + TrackSubscriptionPermissionChanged = "trackSubscriptionPermissionChanged", + TrackSubscriptionStatusChanged = "trackSubscriptionStatusChanged", + TrackUnmuted = "trackUnmuted", + TrackUnpublished = "trackUnpublished", + TrackUnsubscribed = "trackUnsubscribed", + // @beta + TranscriptionReceived = "transcriptionReceived", + VideoPlaybackStatusChanged = "videoPlaybackChanged" +} + +// @public (undocumented) +export type RoomEventCallbacks = { + connected: () => void; + reconnecting: () => void; + signalReconnecting: () => void; + reconnected: () => void; + disconnected: (reason?: DisconnectReason) => void; + connectionStateChanged: (state: ConnectionState) => void; + moved: (name: string) => void; + mediaDevicesChanged: () => void; + participantConnected: (participant: RemoteParticipant) => void; + participantDisconnected: (participant: RemoteParticipant, disconnectReason?: DisconnectReason) => void; + trackPublished: (publication: RemoteTrackPublication, participant: RemoteParticipant) => void; + trackSubscribed: (track: RemoteTrack, publication: RemoteTrackPublication, participant: RemoteParticipant) => void; + trackSubscriptionFailed: (trackSid: string, participant: RemoteParticipant, reason?: SubscriptionError) => void; + trackUnpublished: (publication: RemoteTrackPublication, participant: RemoteParticipant) => void; + trackUnsubscribed: (track: RemoteTrack, publication: RemoteTrackPublication, participant: RemoteParticipant) => void; + trackMuted: (publication: TrackPublication, participant: Participant) => void; + trackUnmuted: (publication: TrackPublication, participant: Participant) => void; + localTrackPublished: (publication: LocalTrackPublication, participant: LocalParticipant) => void; + localTrackUnpublished: (publication: LocalTrackPublication, participant: LocalParticipant) => void; + localAudioSilenceDetected: (publication: LocalTrackPublication) => void; + participantMetadataChanged: (metadata: string | undefined, participant: RemoteParticipant | LocalParticipant) => void; + participantNameChanged: (name: string, participant: RemoteParticipant | LocalParticipant) => void; + participantPermissionsChanged: (prevPermissions: ParticipantPermission | undefined, participant: RemoteParticipant | LocalParticipant) => void; + participantAttributesChanged: (changedAttributes: Record, participant: RemoteParticipant | LocalParticipant) => void; + activeSpeakersChanged: (speakers: Array) => void; + roomMetadataChanged: (metadata: string) => void; + dataReceived: (payload: NonSharedUint8Array, participant?: RemoteParticipant, kind?: DataPacket_Kind, topic?: string, encryptionType?: Encryption_Type, participantIdentity?: string) => void; + sipDTMFReceived: (dtmf: SipDTMF, participant?: RemoteParticipant) => void; + transcriptionReceived: (transcription: TranscriptionSegment[], participant?: Participant, publication?: TrackPublication) => void; + connectionQualityChanged: (quality: ConnectionQuality, participant: Participant) => void; + mediaDevicesError: (error: Error, kind?: MediaDeviceKind) => void; + trackStreamStateChanged: (publication: RemoteTrackPublication, streamState: Track.StreamState, participant: RemoteParticipant) => void; + trackSubscriptionPermissionChanged: (publication: RemoteTrackPublication, status: TrackPublication.PermissionStatus, participant: RemoteParticipant) => void; + trackSubscriptionStatusChanged: (publication: RemoteTrackPublication, status: TrackPublication.SubscriptionStatus, participant: RemoteParticipant) => void; + audioPlaybackChanged: (playing: boolean) => void; + videoPlaybackChanged: (playing: boolean) => void; + signalConnected: () => void; + recordingStatusChanged: (recording: boolean) => void; + participantEncryptionStatusChanged: (encrypted: boolean, participant?: Participant) => void; + encryptionError: (error: Error, participant?: Participant) => void; + dcBufferStatusChanged: (isLow: boolean, kind: DataChannelKind) => void; + activeDeviceChanged: (kind: MediaDeviceKind, deviceId: string) => void; + chatMessage: (message: ChatMessage, participant?: RemoteParticipant | LocalParticipant) => void; + localTrackSubscribed: (publication: LocalTrackPublication, participant: LocalParticipant) => void; + metricsReceived: (metrics: MetricsBatch, participant?: Participant) => void; + participantActive: (participant: Participant) => void; + dataTrackPublished: (track: RemoteDataTrack) => void; + dataTrackUnpublished: (sid: DataTrackSid) => void; + localDataTrackPublished: (track: LocalDataTrack) => void; + localDataTrackUnpublished: (sid: DataTrackSid) => void; +}; + +// @public +export interface RoomExtension { + // (undocumented) + install(room: CoreRoom, ctx: ExtensionContext): ExtensionResult; + // (undocumented) + readonly key: symbol; + readonly requires?: readonly RoomExtension[]; +} + +// @public +export interface RoomOptions extends Partial { +} + +// @public +export class RpcError extends Error { + constructor(code: number, message: string, data?: string, options?: { + cause?: unknown; + }); + // @internal + static builtIn(key: keyof typeof RpcError.ErrorCode, data?: string, options?: { + cause?: unknown; + }): RpcError; + // (undocumented) + cause?: unknown; + // (undocumented) + code: number; + // (undocumented) + data?: string; + // (undocumented) + static ErrorCode: { + readonly APPLICATION_ERROR: 1500; + readonly CONNECTION_TIMEOUT: 1501; + readonly RESPONSE_TIMEOUT: 1502; + readonly RECIPIENT_DISCONNECTED: 1503; + readonly RESPONSE_PAYLOAD_TOO_LARGE: 1504; + readonly SEND_FAILED: 1505; + readonly UNSUPPORTED_METHOD: 1400; + readonly RECIPIENT_NOT_FOUND: 1401; + readonly REQUEST_PAYLOAD_TOO_LARGE: 1402; + readonly UNSUPPORTED_SERVER: 1403; + readonly UNSUPPORTED_VERSION: 1404; + }; + // @internal (undocumented) + static ErrorMessage: Record; + // @internal (undocumented) + static fromProto(proto: RpcError_2): RpcError; + // (undocumented) + static MAX_DATA_BYTES: number; + // (undocumented) + static MAX_MESSAGE_BYTES: number; + // @internal (undocumented) + toProto(): RpcError_2; +} + +// @public +export interface RpcInvocationData { + callerIdentity: string; + payload: string; + requestId: string; + responseTimeout: number; +} + +// @public +export interface RpcLocalParticipantApi { + performRpc(params: PerformRpcParams): TypedPromise; +} + +// @public +export interface RpcRoomApi { + registerRpcMethod(method: string, handler: (data: RpcInvocationData) => Promise): void; + unregisterRpcMethod(method: string): void; +} + +// @public (undocumented) +export interface RTPVideoMapMessage extends BaseMessage { + // (undocumented) + data: { + map: Map; + participantIdentity: string; + }; + // (undocumented) + kind: 'setRTPMap'; +} + +// @public @deprecated (undocumented) +export type SandboxTokenServerOptions = DevelopmentTokenServerOptions; + +// @public +export type ScalabilityMode = 'L1T1' | 'L1T2' | 'L1T3' | 'L2T1' | 'L2T1h' | 'L2T1_KEY' | 'L2T2' | 'L2T2h' | 'L2T2_KEY' | 'L2T3' | 'L2T3h' | 'L2T3_KEY' | 'L3T1' | 'L3T1h' | 'L3T1_KEY' | 'L3T2' | 'L3T2h' | 'L3T2_KEY' | 'L3T3' | 'L3T3h' | 'L3T3_KEY'; + +// @public (undocumented) +export interface ScreenShareCaptureOptions { + audio?: boolean | AudioCaptureOptions; + contentHint?: 'detail' | 'text' | 'motion'; + controller?: unknown; + preferCurrentTab?: boolean; + resolution?: VideoResolution; + selfBrowserSurface?: 'include' | 'exclude'; + suppressLocalAudioPlayback?: boolean; + surfaceSwitching?: 'include' | 'exclude'; + systemAudio?: 'include' | 'exclude'; + video?: true | { + displaySurface?: 'window' | 'browser' | 'monitor'; + }; +} + +// @public (undocumented) +export const ScreenSharePresets: { + readonly h360fps3: VideoPreset; + readonly h360fps15: VideoPreset; + readonly h720fps5: VideoPreset; + readonly h720fps15: VideoPreset; + readonly h720fps30: VideoPreset; + readonly h1080fps15: VideoPreset; + readonly h1080fps30: VideoPreset; + readonly original: VideoPreset; +}; + +// @public (undocumented) +export type ScriptTransformOptions = { + kind: 'decode' | 'encode'; + participantIdentity: string; + trackId: string; + codec?: VideoCodec; + hasPacketTrailer: boolean; + packetTrailer?: FrameMetadataPublishOptions; +}; + +// @public (undocumented) +export interface SendBytesOptions { + // (undocumented) + attributes?: Record; + compress?: boolean; + // (undocumented) + destinationIdentities?: Array; + // (undocumented) + mimeType?: string; + // (undocumented) + name?: string; + // (undocumented) + onProgress?: (progress: number) => void; + // (undocumented) + topic?: string; +} + +// @public (undocumented) +export interface SendTextOptions { + // (undocumented) + attachments?: Array; + // (undocumented) + attributes?: Record; + compress?: boolean; + // (undocumented) + destinationIdentities?: Array; + // (undocumented) + onProgress?: (progress: number) => void; + // (undocumented) + topic?: string; +} + +// @beta +export type Serializer = { + symbol: typeof SerializerSymbol; + parse: (raw: string) => Input; + serialize: (val: Output) => string; +}; + +// Warning: (ae-incompatible-release-tags) The symbol "SerializerInput" is marked as @public, but its signature references "Serializer" which is marked as @beta +// +// @public (undocumented) +export type SerializerInput = S extends Serializer ? Input : any; + +// Warning: (ae-incompatible-release-tags) The symbol "SerializerOutput" is marked as @public, but its signature references "Serializer" which is marked as @beta +// +// @public (undocumented) +export type SerializerOutput = S extends Serializer ? Output : any; + +// @beta +export const serializers: { + json: typeof json; + raw: typeof raw; + custom: typeof custom; +}; + +// @public (undocumented) +export interface SetKeyMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity?: string; + isPublisher: boolean; + key: CryptoKey; + keyIndex?: number; + updateCurrentKeyIndex: boolean; + }; + // (undocumented) + kind: 'setKey'; +} + +// Warning: (ae-forgotten-export) The symbol "LogExtension" needs to be exported by the entry point index.d.ts +// +// @public +export function setLogExtension(extension: LogExtension, logger?: StructuredLogger): void; + +// Warning: (ae-forgotten-export) The symbol "LogLevelString" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function setLogLevel(level: LogLevel | LogLevelString, loggerName?: LoggerNames): void; + +// @public (undocumented) +export interface SetLogLevelMessage extends BaseMessage { + // (undocumented) + data: { + level: LogLevel; + }; + // (undocumented) + kind: 'setLogLevel'; +} + +// Warning: (ae-internal-missing-underscore) The name "setVideoCapture" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export function setVideoCapture(capture: VideoCapture): void; + +// @public (undocumented) +export interface SifTrailerMessage extends BaseMessage { + // (undocumented) + data: { + trailer: NonSharedUint8Array; + }; + // (undocumented) + kind: 'setSifTrailer'; +} + +// @public (undocumented) +export class SignalReconnectError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "SignalReconnectError"; +} + +// @public (undocumented) +export class SignalRequestError extends LivekitReasonedError { + constructor(message: string, reason: RequestErrorReason); + // (undocumented) + readonly name = "SignalRequestError"; + // (undocumented) + reason: RequestErrorReason; + // (undocumented) + reasonName: string; +} + +// @public (undocumented) +export class SimulatedError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "simulated"; +} + +// @public (undocumented) +export type SimulationScenario = 'signal-reconnect' | 'speaker' | 'node-failure' | 'server-leave' | 'migration' | 'resume-reconnect' | 'force-tcp' | 'force-tls' | 'full-reconnect' | 'subscriber-bandwidth' | 'disconnect-signal-on-resume' | 'disconnect-signal-on-resume-no-messages' | 'leave-full-reconnect' | 'fail-on-v1-path'; + +// @public +export type SlotProvider = Pick; + +export { SubscriptionError } + +// @public (undocumented) +export function supportsAdaptiveStream(): boolean; + +// @public +export function supportsAudioOutputSelection(): boolean; + +// @public (undocumented) +export function supportsAV1(): boolean; + +// @public (undocumented) +export function supportsDynacast(): boolean; + +// @public (undocumented) +export function supportsH265(): boolean; + +// @public (undocumented) +export function supportsVP9(): boolean; + +// @public +export interface SyncStateProvider { + syncState?(): PublishDataTrackResponse[]; +} + +// @public (undocumented) +export type TextStreamHandler = (reader: TextStreamReader, participantInfo: { + identity: string; +}) => void; + +// @public (undocumented) +export interface TextStreamInfo extends BaseStreamInfo { + // (undocumented) + attachedStreamIds?: Array; +} + +// @public +export class TextStreamReader extends BaseStreamReader { + [Symbol.asyncIterator](): { + next: () => Promise>; + return(): Promise>; + }; + // (undocumented) + readAll(opts?: BaseStreamReaderReadAllOpts): Promise; + // (undocumented) + signal?: AbortSignal; + withAbortSignal(signal: AbortSignal): this; +} + +// @public (undocumented) +export class TextStreamWriter extends BaseStreamWriter { +} + +// @public +export type TokenPayload = JWTPayload & { + name?: string; + metadata?: string; + attributes?: Record; + video?: { + room?: string; + roomJoin?: boolean; + canPublish?: boolean; + canPublishData?: boolean; + canSubscribe?: boolean; + }; + roomConfig?: RoomConfigurationObject; +}; + +// @public (undocumented) +export const TokenSource: { + literal(literalOrFn: LiteralOrFn): TokenSourceLiteral; + custom(customFn: CustomFn): TokenSourceCustom; + endpoint(url: string, options?: EndpointOptions): TokenSourceEndpoint; + sandboxTokenServer(sandboxId: string, options?: SandboxTokenServerOptions): TokenSourceSandboxTokenServer; + developmentTokenServer(tokenServerId: string, options?: DevelopmentTokenServerOptions): TokenSourceDevelopmentTokenServer; +}; + +// @public +export type TokenSourceBase = TokenSourceFixed | TokenSourceConfigurable; + +// @public +export abstract class TokenSourceConfigurable { + // (undocumented) + abstract fetch(options: TokenSourceFetchOptions): Promise; + // (undocumented) + abstract fetch(options: TokenSourceFetchOptions, force?: boolean): Promise; +} + +// Warning: (ae-forgotten-export) The symbol "TokenSourceCached" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class TokenSourceCustom extends TokenSourceCached { + constructor(customFn: CustomFn); + // (undocumented) + protected update(options: TokenSourceFetchOptions): Promise; +} + +// @public (undocumented) +export class TokenSourceDevelopmentTokenServer extends TokenSourceEndpoint { + constructor(tokenServerId: string, options: DevelopmentTokenServerOptions); +} + +// @public (undocumented) +export class TokenSourceEndpoint extends TokenSourceCached { + constructor(url: string, options?: EndpointOptions); + // (undocumented) + protected update(options: TokenSourceFetchOptions): Promise; +} + +// @public (undocumented) +export type TokenSourceFetchOptions = { + roomName?: string; + participantName?: string; + participantIdentity?: string; + participantMetadata?: string; + participantAttributes?: { + [key: string]: string; + }; + agentName?: string; + agentMetadata?: string; + deployment?: string; +}; + +// @public +export abstract class TokenSourceFixed { + // (undocumented) + abstract fetch(): Promise; +} + +// @public (undocumented) +export class TokenSourceLiteral extends TokenSourceFixed { + constructor(literalOrFn: LiteralOrFn); + // (undocumented) + fetch(): Promise; +} + +// @public (undocumented) +export type TokenSourceRequestObject = Required[0]>>; + +// Warning: (ae-forgotten-export) The symbol "ValueToSnakeCase" needs to be exported by the entry point index.d.ts +// +// @public +export type TokenSourceRequestPayload = ValueToSnakeCase; + +// @public (undocumented) +export type TokenSourceResponseObject = Required[0]>>; + +// @public +export type TokenSourceResponsePayload = ValueToSnakeCase; + +// @public @deprecated (undocumented) +export class TokenSourceSandboxTokenServer extends TokenSourceDevelopmentTokenServer { +} + +// Warning: (ae-forgotten-export) The symbol "Track_base" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export abstract class Track extends Track_base { + protected constructor(mediaTrack: MediaStreamTrack, kind: TrackKind, loggerOptions?: LoggerOptions); + // (undocumented) + protected addAppVisibilityListener(): void; + // (undocumented) + protected appVisibilityChangedListener: () => void; + attach(): HTMLMediaElement; + attach(element: HTMLMediaElement): HTMLMediaElement; + // (undocumented) + attachedElements: HTMLMediaElement[]; + get currentBitrate(): number; + // (undocumented) + protected _currentBitrate: number; + detach(): HTMLMediaElement[]; + detach(element: HTMLMediaElement): HTMLMediaElement; + // (undocumented) + protected disable(): void; + // (undocumented) + protected enable(): void; + abstract getRTCStatsReport(): Promise; + // (undocumented) + protected handleAppVisibilityChanged(): Promise; + // (undocumented) + protected isInBackground: boolean; + // (undocumented) + abstract get isLocal(): boolean; + // (undocumented) + isMuted: boolean; + // (undocumented) + readonly kind: TrackKind; + // (undocumented) + protected log: StructuredLogger; + // (undocumented) + protected get logContext(): { + [x: string]: unknown; + }; + // @internal (undocumented) + mediaStream?: MediaStream; + // @internal + get mediaStreamID(): string; + // (undocumented) + protected _mediaStreamID: string; + // (undocumented) + get mediaStreamTrack(): MediaStreamTrack; + // (undocumented) + protected _mediaStreamTrack: MediaStreamTrack; + // (undocumented) + protected monitorInterval?: ReturnType; + // (undocumented) + protected removeAppVisibilityListener(): void; + // @internal (undocumented) + rtpTimestamp: number | undefined; + // @internal (undocumented) + setStreamState(value: Track.StreamState): void; + sid?: Track.SID; + // (undocumented) + source: Track.Source; + // (undocumented) + abstract startMonitor(signalClient?: SignalClient): void; + // (undocumented) + stop(): void; + // (undocumented) + stopMonitor(): void; + get streamState(): Track.StreamState; + // (undocumented) + protected timeSyncHandle: number | undefined; + // @internal (undocumented) + updateLoggerOptions(loggerOptions: LoggerOptions): void; +} + +// @public (undocumented) +export namespace Track { + // (undocumented) + export interface Dimensions { + // (undocumented) + height: number; + // (undocumented) + width: number; + } + // (undocumented) + export enum Kind { + // (undocumented) + Audio = "audio", + // (undocumented) + Unknown = "unknown", + // (undocumented) + Video = "video" + } + // @internal (undocumented) + export function kindFromProto(t: TrackType): Kind | undefined; + // @internal (undocumented) + export function kindToProto(k: Kind): TrackType; + // (undocumented) + export type SID = string; + // (undocumented) + export enum Source { + // (undocumented) + Camera = "camera", + // (undocumented) + Microphone = "microphone", + // (undocumented) + ScreenShare = "screen_share", + // (undocumented) + ScreenShareAudio = "screen_share_audio", + // (undocumented) + Unknown = "unknown" + } + // @internal (undocumented) + export function sourceFromProto(s: TrackSource): Source; + // @internal (undocumented) + export function sourceToProto(s: Source): TrackSource; + // (undocumented) + export enum StreamState { + // (undocumented) + Active = "active", + // (undocumented) + Paused = "paused", + // (undocumented) + Unknown = "unknown" + } + // @internal (undocumented) + export function streamStateFromProto(s: StreamState): StreamState; +} + +// @public (undocumented) +enum TrackEvent_2 { + // @internal (undocumented) + AudioPlaybackFailed = "audioPlaybackFailed", + // @internal (undocumented) + AudioPlaybackStarted = "audioPlaybackStarted", + // @internal + AudioSilenceDetected = "audioSilenceDetected", + // @internal (undocumented) + AudioTrackFeatureUpdate = "audioTrackFeatureUpdate", + // (undocumented) + CpuConstrained = "cpuConstrained", + // @internal (undocumented) + ElementAttached = "elementAttached", + // @internal (undocumented) + ElementDetached = "elementDetached", + // (undocumented) + Ended = "ended", + // (undocumented) + Message = "message", + // (undocumented) + Muted = "muted", + // @internal (undocumented) + PreConnectBufferFlushed = "preConnectBufferFlushed", + Restarted = "restarted", + // (undocumented) + Subscribed = "subscribed", + SubscriptionFailed = "subscriptionFailed", + // @internal + SubscriptionPermissionChanged = "subscriptionPermissionChanged", + SubscriptionStatusChanged = "subscriptionStatusChanged", + // (undocumented) + TimeSyncUpdate = "timeSyncUpdate", + // @internal (undocumented) + TrackProcessorUpdate = "trackProcessorUpdate", + // @beta (undocumented) + TranscriptionReceived = "transcriptionReceived", + // (undocumented) + Unmuted = "unmuted", + // (undocumented) + Unsubscribed = "unsubscribed", + // @internal (undocumented) + UpdateSettings = "updateSettings", + // @internal (undocumented) + UpdateSubscription = "updateSubscription", + // @internal + UpstreamPaused = "upstreamPaused", + // @internal + UpstreamResumed = "upstreamResumed", + // @internal (undocumented) + VideoDimensionsChanged = "videoDimensionsChanged", + // @internal (undocumented) + VideoPlaybackFailed = "videoPlaybackFailed", + // @internal (undocumented) + VideoPlaybackStarted = "videoPlaybackStarted", + // @internal (undocumented) + VisibilityChanged = "visibilityChanged" +} +export { TrackEvent_2 as TrackEvent } + +// @public (undocumented) +export type TrackEventCallbacks = { + message: () => void; + muted: (track?: any) => void; + unmuted: (track?: any) => void; + restarted: (track?: any) => void; + ended: (track?: any) => void; + updateSettings: () => void; + updateSubscription: () => void; + audioPlaybackStarted: () => void; + audioPlaybackFailed: (error?: Error) => void; + audioSilenceDetected: () => void; + visibilityChanged: (visible: boolean, track?: any) => void; + videoDimensionsChanged: (dimensions: Track.Dimensions, track?: any) => void; + videoPlaybackStarted: () => void; + videoPlaybackFailed: (error?: Error) => void; + elementAttached: (element: HTMLMediaElement) => void; + elementDetached: (element: HTMLMediaElement) => void; + upstreamPaused: (track: any) => void; + upstreamResumed: (track: any) => void; + trackProcessorUpdate: (processor?: TrackProcessor) => void; + audioTrackFeatureUpdate: (track: any, feature: AudioTrackFeature, enabled: boolean) => void; + timeSyncUpdate: (update: { + timestamp: number; + rtpTimestamp: number; + }) => void; + preConnectBufferFlushed: (buffer: NonSharedUint8Array[]) => void; + cpuConstrained: () => void; +}; + +// @public (undocumented) +export class TrackInvalidError extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "TrackInvalidError"; +} + +// @public +export interface TrackProcessor = ProcessorOptions> { + // (undocumented) + destroy: () => Promise; + // (undocumented) + init: (opts: U) => Promise; + // (undocumented) + name: string; + // (undocumented) + onPublish?: (room: CoreRoom) => Promise; + // (undocumented) + onUnpublish?: () => Promise; + // (undocumented) + processedTrack?: MediaStreamTrack; + // (undocumented) + restart: (opts: U) => Promise; +} + +// Warning: (ae-forgotten-export) The symbol "TrackPublication_base" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export abstract class TrackPublication extends TrackPublication_base { + constructor(kind: Track.Kind, id: string, name: string, loggerOptions?: LoggerOptions); + get audioTrack(): LocalAudioTrack | RemoteAudioTrack | undefined; + dimensions?: Track.Dimensions; + // (undocumented) + protected encryption: Encryption_Type; + // (undocumented) + handleMuted: () => void; + // (undocumented) + handleUnmuted: () => void; + // (undocumented) + get isEnabled(): boolean; + // (undocumented) + get isEncrypted(): boolean; + // (undocumented) + abstract get isLocal(): boolean; + // (undocumented) + get isMuted(): boolean; + // (undocumented) + get isSubscribed(): boolean; + // (undocumented) + kind: Track.Kind; + // (undocumented) + protected log: StructuredLogger; + // (undocumented) + protected get logContext(): { + [x: string]: unknown; + }; + // (undocumented) + protected metadataMuted: boolean; + mimeType?: string; + // @internal (undocumented) + setTrack(track?: Track): void; + simulcasted?: boolean; + // (undocumented) + source: Track.Source; + // (undocumented) + track?: Track; + // @internal (undocumented) + trackInfo?: TrackInfo; + // (undocumented) + trackName: string; + // (undocumented) + trackSid: Track.SID; + // @internal (undocumented) + updateInfo(info: TrackInfo): void; + get videoTrack(): LocalVideoTrack | RemoteVideoTrack | undefined; +} + +// @public (undocumented) +export namespace TrackPublication { + // (undocumented) + export enum PermissionStatus { + // (undocumented) + Allowed = "allowed", + // (undocumented) + NotAllowed = "not_allowed" + } + // (undocumented) + export enum SubscriptionStatus { + // (undocumented) + Desired = "desired", + // (undocumented) + Subscribed = "subscribed", + // (undocumented) + Unsubscribed = "unsubscribed" + } +} + +// @public (undocumented) +export interface TrackPublishDefaults { + audioPreset?: AudioPreset; + backupCodec?: true | false | { + codec: BackupVideoCodec; + encoding?: VideoEncoding; + }; + backupCodecPolicy?: BackupCodecPolicy; + degradationPreference?: RTCDegradationPreference; + dtx?: boolean; + forceStereo?: boolean; + frameMetadata?: FrameMetadataPublishOptions; + preConnectBuffer?: boolean; + red?: boolean; + scalabilityMode?: ScalabilityMode; + screenShareEncoding?: VideoEncoding; + screenShareSimulcastLayers?: Array; + simulcast?: boolean; + stopMicTrackOnMute?: boolean; + videoCodec?: VideoCodec; + videoEncoding?: VideoEncoding; + videoSimulcastLayers?: Array; +} + +// @public +export interface TrackPublishOptions extends TrackPublishDefaults { + name?: string; + source?: Track.Source; + stream?: string; +} + +export { TrackType } + +// @public +interface TranscriptionAttributes { + 'lk.segment_id'?: string; + 'lk.transcribed_track_id'?: string; + 'lk.transcription_final'?: boolean; + // (undocumented) + [property: string]: any; +} + +// @public (undocumented) +export interface TranscriptionSegment { + // (undocumented) + endTime: number; + // (undocumented) + final: boolean; + // (undocumented) + firstReceivedTime: number; + // (undocumented) + id: string; + // (undocumented) + language: string; + // (undocumented) + lastReceivedTime: number; + // (undocumented) + startTime: number; + // (undocumented) + text: string; +} + +// @public (undocumented) +export class UnexpectedConnectionState extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "UnexpectedConnectionState"; +} + +// @public (undocumented) +export class UnsupportedServer extends LivekitError { + constructor(message?: string); + // (undocumented) + readonly name = "UnsupportedServer"; +} + +// @public (undocumented) +export interface UpdateCodecMessage extends BaseMessage { + // (undocumented) + data: { + participantIdentity: string; + trackId: string; + codec?: VideoCodec; + previousTrackId?: string; + hasPacketTrailer: boolean; + }; + // (undocumented) + kind: 'updateCodec'; +} + +// @public (undocumented) +export const version: string; + +// Warning: (ae-internal-missing-underscore) The name "VideoCapture" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal +export interface VideoCapture { + // (undocumented) + createTrack(mediaStreamTrack: MediaStreamTrack, constraints: MediaTrackConstraints | undefined, userProvidedTrack: boolean, loggerOptions?: LoggerOptions): LocalVideoTrack; + // (undocumented) + defaults: VideoCaptureOptions; +} + +// @public (undocumented) +export interface VideoCaptureOptions { + deviceId?: ConstrainDOMString; + facingMode?: 'user' | 'environment' | 'left' | 'right'; + frameRate?: ConstrainDouble; + processor?: TrackProcessor; + // (undocumented) + resolution?: VideoResolution; +} + +// @public (undocumented) +export type VideoCodec = (typeof videoCodecs)[number]; + +// @public (undocumented) +export const videoCodecs: readonly ["vp8", "h264", "vp9", "av1", "h265"]; + +// @public (undocumented) +export interface VideoEncoding { + // (undocumented) + maxBitrate: number; + // (undocumented) + maxFramerate?: number; + // (undocumented) + priority?: RTCPriorityType; +} + +// @public +export interface VideoLocalParticipantApi { + createScreenTracks(options?: ScreenShareCaptureOptions): Promise>; + enableCameraAndMicrophone(): Promise; + // @internal + publishAdditionalCodecForTrack(track: LocalTrack | MediaStreamTrack, videoCodec: BackupVideoCodec, options?: TrackPublishOptions): Promise; + setCameraEnabled(enabled: boolean, options?: VideoCaptureOptions, publishOptions?: TrackPublishOptions): Promise; + setScreenShareEnabled(enabled: boolean, options?: ScreenShareCaptureOptions, publishOptions?: TrackPublishOptions): Promise; +} + +// @public (undocumented) +export class VideoPreset { + constructor(videoPresetOptions: VideoPresetOptions); + constructor(width: number, height: number, maxBitrate: number, maxFramerate?: number, priority?: RTCPriorityType); + // (undocumented) + aspectRatio?: number; + // (undocumented) + encoding: VideoEncoding; + // (undocumented) + height: number; + // (undocumented) + get resolution(): VideoResolution; + // (undocumented) + width: number; +} + +// @public (undocumented) +export interface VideoPresetOptions { + // (undocumented) + aspectRatio?: number; + // (undocumented) + height: number; + // (undocumented) + maxBitrate: number; + // (undocumented) + maxFramerate?: number; + // (undocumented) + priority?: RTCPriorityType; + // (undocumented) + width: number; +} + +// @public +export const VideoPresets: { + readonly h90: VideoPreset; + readonly h180: VideoPreset; + readonly h216: VideoPreset; + readonly h360: VideoPreset; + readonly h540: VideoPreset; + readonly h720: VideoPreset; + readonly h1080: VideoPreset; + readonly h1440: VideoPreset; + readonly h2160: VideoPreset; +}; + +// @public +export const VideoPresets43: { + readonly h120: VideoPreset; + readonly h180: VideoPreset; + readonly h240: VideoPreset; + readonly h360: VideoPreset; + readonly h480: VideoPreset; + readonly h540: VideoPreset; + readonly h720: VideoPreset; + readonly h1080: VideoPreset; + readonly h1440: VideoPreset; +}; + +// @public (undocumented) +export interface VideoProcessorOptions extends ProcessorOptions { +} + +// @public (undocumented) +export enum VideoQuality { + // (undocumented) + HIGH = 2, + // (undocumented) + LOW = 0, + // (undocumented) + MEDIUM = 1 +} + +// @public (undocumented) +export interface VideoReceiverStats extends ReceiverStats { + // (undocumented) + decoderImplementation?: string; + // (undocumented) + firCount?: number; + // (undocumented) + frameHeight?: number; + // (undocumented) + framesDecoded: number; + // (undocumented) + framesDropped: number; + // (undocumented) + framesReceived: number; + // (undocumented) + frameWidth?: number; + // (undocumented) + mimeType?: string; + // (undocumented) + nackCount?: number; + // (undocumented) + pliCount?: number; + // (undocumented) + type: 'video'; +} + +// @public (undocumented) +export interface VideoResolution { + // (undocumented) + aspectRatio?: number; + // (undocumented) + frameRate?: number; + // (undocumented) + height: number; + // (undocumented) + width: number; +} + +// @public (undocumented) +export interface VideoSenderStats extends SenderStats { + // (undocumented) + firCount: number; + // (undocumented) + frameHeight: number; + // (undocumented) + framesPerSecond: number; + // (undocumented) + framesSent: number; + // (undocumented) + frameWidth: number; + // (undocumented) + nackCount: number; + // (undocumented) + pliCount: number; + // (undocumented) + qualityLimitationDurations?: Record; + // (undocumented) + qualityLimitationReason?: string; + // (undocumented) + qualityLimitationResolutionChanges?: number; + // (undocumented) + retransmittedPacketsSent?: number; + // (undocumented) + rid: string; + // (undocumented) + targetBitrate: number; + // (undocumented) + type: 'video'; +} + +// @public (undocumented) +export type VideoTrack = RemoteVideoTrack | LocalVideoTrack; + +// @public (undocumented) +export interface WebAudioSettings { + // (undocumented) + audioContext: AudioContext; +} + +// @public (undocumented) +export function writeRbsp(data_in: NonSharedUint8Array): NonSharedUint8Array; + +// Warnings were encountered during analysis: +// +// src/room/CoreRoom.ts:2934:3 - (ae-forgotten-export) The symbol "DataTrackSid" needs to be exported by the entry point index.d.ts +// src/room/data-track/packet/index.ts:359:9 - (ae-forgotten-export) The symbol "FrameMarker" needs to be exported by the entry point index.d.ts +// src/room/extensions.ts:221:3 - (ae-forgotten-export) The symbol "LocalOf" needs to be exported by the entry point index.d.ts +// src/room/extensions.ts:234:3 - (ae-forgotten-export) The symbol "ExtensionContext" needs to be exported by the entry point index.d.ts +// src/room/token-source/TokenSource.ts:261:3 - (ae-forgotten-export) The symbol "LiteralOrFn" needs to be exported by the entry point index.d.ts +// src/room/token-source/TokenSource.ts:271:3 - (ae-forgotten-export) The symbol "CustomFn" needs to be exported by the entry point index.d.ts +// src/utils/serializer.ts:72:25 - (ae-forgotten-export) The symbol "json" needs to be exported by the entry point index.d.ts +// src/utils/serializer.ts:72:25 - (ae-forgotten-export) The symbol "raw" needs to be exported by the entry point index.d.ts +// src/utils/serializer.ts:72:25 - (ae-forgotten-export) The symbol "custom" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/package.json b/package.json index 8ed92d1ddb..754c17b64b 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,9 @@ "downlevel-dts": "downlevel-dts ./dist/src ./dist/ts4.2 --to=4.2 && downlevel-dts ./dist/core/types/src ./dist/core/ts4.2 --to=4.2", "compat": "eslint --config ./eslint.config.dist.mjs --no-inline-config ./dist/livekit-client.esm.mjs", "size-limit": "size-limit", - "check:core": "node scripts/check-core-imports.mjs && node scripts/check-core-types.mjs" + "check:core": "node scripts/check-core-imports.mjs && node scripts/check-core-types.mjs", + "api-report:update": "api-extractor run --local --config api-extractor.main.json && api-extractor run --local --config api-extractor.core.json", + "api-report:check": "api-extractor run --config api-extractor.main.json && api-extractor run --config api-extractor.core.json" }, "dependencies": { "@livekit/mutex": "1.1.1", @@ -108,6 +110,8 @@ "@eslint/js": "10.0.1", "@livekit/changesets-changelog-github": "^0.2.0", "@livekit/throws-transformer": "^0.1.3", + "@microsoft/api-extractor": "7.59.4", + "@nbilyk/downlevel-dts": "^0.15.2", "@rollup/plugin-babel": "7.1.0", "@rollup/plugin-commonjs": "29.0.3", "@rollup/plugin-json": "6.1.0", @@ -125,7 +129,6 @@ "@typescript/native": "catalog:", "@vitest/browser": "^4.1.10", "@vitest/browser-playwright": "^4.1.10", - "@nbilyk/downlevel-dts": "^0.15.2", "eslint": "10.7.0", "eslint-config-airbnb-extended": "^2.3.2", "eslint-config-prettier": "10.1.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e24149076a..80f4c1ca31 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -75,6 +75,9 @@ importers: '@livekit/throws-transformer': specifier: ^0.1.3 version: 0.1.3(@typescript/typescript6@6.0.2) + '@microsoft/api-extractor': + specifier: 7.59.4 + version: 7.59.4(@types/node@26.1.2) '@nbilyk/downlevel-dts': specifier: ^0.15.2 version: 0.15.2 @@ -1144,6 +1147,21 @@ packages: '@mermaid-js/parser@1.2.0': resolution: {integrity: sha512-oYPyv8A4As1yH5Bx+04iQEQxXuIQDe0GKCNSRgao6z8AM9jixXIfP0vsppRLvGf+nKIOb9/LdpWA4YuJiVvESA==} + '@microsoft/api-extractor-model@7.33.15': + resolution: {integrity: sha512-UpCnItIJwu03iNTWtJVKv8Qbf0MXN7WLQZUail9cpAQmnZiIX36YPRRoRxz0pocwytzUpmJhstsLkyW5tsaHBA==} + engines: {node: '>=20.9.0'} + + '@microsoft/api-extractor@7.59.4': + resolution: {integrity: sha512-XqseDKIw736qlhQwS9SOpbY4veOiP2Nc7YiWmgXXBmeA3kY9qGXw+Tu7DFpU9FvXywE1z8SvLJKUVxFpcX0kig==} + engines: {node: '>=20.9.0'} + hasBin: true + + '@microsoft/tsdoc-config@0.18.3': + resolution: {integrity: sha512-0I0rGXo1eJziw3EEErkDS9p/0RzBcyOiV+zbSDqOZTeURmhtut+WIvpih0LM5g+ZpZ9SyFxDfkhAcl/r8e2zGw==} + + '@microsoft/tsdoc@0.17.1': + resolution: {integrity: sha512-VHyYyyoH63jFoO3shpw9Zfijk5v/9p/VrClW35z0/q6ooK7sSmxpzOkS4iZPxs3vO4XtBW4H38HRAKkAMIK7DA==} + '@napi-rs/wasm-runtime@1.1.6': resolution: {integrity: sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==} peerDependencies: @@ -1489,6 +1507,40 @@ packages: '@rtsao/scc@1.1.0': resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} + '@rushstack/node-core-library@5.25.1': + resolution: {integrity: sha512-ozoRDwIx3jStOYpx86rFyXH4SaUR+DVT6HubQ59avLplJkWXSm5InztYH7RrOzzq9PJXTdq9/+lKX06SfkLVsA==} + engines: {node: '>=20.9.0'} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true + + '@rushstack/problem-matcher@0.2.1': + resolution: {integrity: sha512-gulfhBs6n+I5b7DvjKRfhMGyUejtSgOHTclF/eONr8hcgF1APEDjhxIsfdUYYMzC3rvLwGluqLjbwCFZ8nxrog==} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true + + '@rushstack/rig-package@0.7.4': + resolution: {integrity: sha512-SHZdzc9b2ptUb5uvRWALtAceD/QKZ4UAnZjcaKviTMPmHBnW14gs7XDocn6sDv2EqgnxxFPFkpV7/I3cUijCbw==} + engines: {node: '>=20.9.0'} + + '@rushstack/terminal@0.24.7': + resolution: {integrity: sha512-o8J9nHOIwfYb0s0eG2WYhx7ed3YIvBXQHVFxYdXCmVdBOkTkdArJcgVzRS8ewUepmlic4nGgJPjKIVaNKSqEnA==} + engines: {node: '>=20.9.0'} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true + + '@rushstack/ts-command-line@5.3.17': + resolution: {integrity: sha512-pIwhWawZXAT0nTXwvcE/InQ7uaVAgSeIzILMb2mBrI01Hz1yEvxrhV2+DE2Fzux8aZY9OJTdLsI+sk9kZDuAJw==} + engines: {node: '>=20.9.0'} + '@shikijs/engine-oniguruma@3.23.0': resolution: {integrity: sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==} @@ -1547,6 +1599,9 @@ packages: '@tybys/wasm-util@0.10.3': resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} + '@types/argparse@1.0.38': + resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} + '@types/chai@5.2.3': resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} @@ -2160,6 +2215,14 @@ packages: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} + ajv-draft-04@1.0.0: + resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} + peerDependencies: + ajv: ^8.5.0 + peerDependenciesMeta: + ajv: + optional: true + ajv-formats@2.1.1: resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: @@ -2168,6 +2231,14 @@ packages: ajv: optional: true + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + ajv-keywords@5.1.0: resolution: {integrity: sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==} peerDependencies: @@ -2179,6 +2250,12 @@ packages: ajv@8.17.1: resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + ajv@8.18.0: + resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -2610,6 +2687,10 @@ packages: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} + diff@8.0.4: + resolution: {integrity: sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==} + engines: {node: '>=0.3.1'} + dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -3030,6 +3111,10 @@ packages: resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} engines: {node: '>=14.14'} + fs-extra@11.3.6: + resolution: {integrity: sha512-w8ZNZr2mKIc7qeNaQ9AVPT1+iFaI+Avd4xudVOvdDJ8VytREi1Ft5Ih7hd9jjehod8vAM5GMsfQ/TpPf4EyoEA==} + engines: {node: '>=14.14'} + fs-extra@7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} @@ -3203,6 +3288,10 @@ packages: resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} engines: {node: '>= 4'} + import-lazy@4.0.0: + resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} + engines: {node: '>=8'} + import-meta-resolve@4.2.0: resolution: {integrity: sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==} @@ -3385,6 +3474,9 @@ packages: resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==} hasBin: true + jju@1.4.0: + resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} + jose@5.10.0: resolution: {integrity: sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==} @@ -3653,6 +3745,10 @@ packages: resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} engines: {node: '>= 0.6'} + minimatch@10.2.3: + resolution: {integrity: sha512-Rwi3pnapEqirPSbWbrZaa6N3nmqq4Xer/2XooiOKyV3q12ML06f7MOuc5DVH8ONZIFhwIYQ3yzPH4nt7iWHaTg==} + engines: {node: 18 || 20 || >=22} + minimatch@10.2.5: resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} engines: {node: 18 || 20 || >=22} @@ -4059,6 +4155,11 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true + semver@7.7.4: + resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==} + engines: {node: '>=10'} + hasBin: true + semver@7.8.2: resolution: {integrity: sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==} engines: {node: '>=10'} @@ -4168,6 +4269,10 @@ packages: resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} + string-argv@0.3.2: + resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} + engines: {node: '>=0.6.19'} + string.prototype.trim@1.2.11: resolution: {integrity: sha512-PwvK7BU+CMTJGYQCTZb5RWXIML92lftJLhQz1tBzgKiqGxJaMlBAa48POXaNAC2s4y8jr3EFqrkF9+44neS46w==} engines: {node: '>= 0.4'} @@ -4385,6 +4490,11 @@ packages: engines: {node: '>=4.2.0'} hasBin: true + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + typescript@6.0.3: resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} engines: {node: '>=14.17'} @@ -5772,6 +5882,41 @@ snapshots: dependencies: '@chevrotain/types': 11.1.2 + '@microsoft/api-extractor-model@7.33.15(@types/node@26.1.2)': + dependencies: + '@microsoft/tsdoc': 0.17.1 + '@microsoft/tsdoc-config': 0.18.3 + '@rushstack/node-core-library': 5.25.1(@types/node@26.1.2) + transitivePeerDependencies: + - '@types/node' + + '@microsoft/api-extractor@7.59.4(@types/node@26.1.2)': + dependencies: + '@microsoft/api-extractor-model': 7.33.15(@types/node@26.1.2) + '@microsoft/tsdoc': 0.17.1 + '@microsoft/tsdoc-config': 0.18.3 + '@rushstack/node-core-library': 5.25.1(@types/node@26.1.2) + '@rushstack/rig-package': 0.7.4 + '@rushstack/terminal': 0.24.7(@types/node@26.1.2) + '@rushstack/ts-command-line': 5.3.17(@types/node@26.1.2) + diff: 8.0.4 + minimatch: 10.2.3 + resolve: 1.22.12 + semver: 7.7.4 + source-map: 0.6.1 + typescript: 5.9.3 + transitivePeerDependencies: + - '@types/node' + + '@microsoft/tsdoc-config@0.18.3': + dependencies: + '@microsoft/tsdoc': 0.17.1 + ajv: 8.18.0 + jju: 1.4.0 + resolve: 1.22.12 + + '@microsoft/tsdoc@0.17.1': {} + '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)': dependencies: '@emnapi/core': 1.11.1 @@ -6001,6 +6146,45 @@ snapshots: '@rtsao/scc@1.1.0': optional: true + '@rushstack/node-core-library@5.25.1(@types/node@26.1.2)': + dependencies: + ajv: 8.20.0 + ajv-draft-04: 1.0.0(ajv@8.20.0) + ajv-formats: 3.0.1(ajv@8.20.0) + fs-extra: 11.3.6 + import-lazy: 4.0.0 + jju: 1.4.0 + resolve: 1.22.12 + semver: 7.7.4 + optionalDependencies: + '@types/node': 26.1.2 + + '@rushstack/problem-matcher@0.2.1(@types/node@26.1.2)': + optionalDependencies: + '@types/node': 26.1.2 + + '@rushstack/rig-package@0.7.4': + dependencies: + jju: 1.4.0 + resolve: 1.22.12 + + '@rushstack/terminal@0.24.7(@types/node@26.1.2)': + dependencies: + '@rushstack/node-core-library': 5.25.1(@types/node@26.1.2) + '@rushstack/problem-matcher': 0.2.1(@types/node@26.1.2) + supports-color: 8.1.1 + optionalDependencies: + '@types/node': 26.1.2 + + '@rushstack/ts-command-line@5.3.17(@types/node@26.1.2)': + dependencies: + '@rushstack/terminal': 0.24.7(@types/node@26.1.2) + '@types/argparse': 1.0.38 + argparse: 1.0.10 + string-argv: 0.3.2 + transitivePeerDependencies: + - '@types/node' + '@shikijs/engine-oniguruma@3.23.0': dependencies: '@shikijs/types': 3.23.0 @@ -6076,6 +6260,8 @@ snapshots: tslib: 2.8.1 optional: true + '@types/argparse@1.0.38': {} + '@types/chai@5.2.3': dependencies: '@types/deep-eql': 4.0.2 @@ -6681,10 +6867,18 @@ snapshots: clean-stack: 2.2.0 indent-string: 4.0.0 + ajv-draft-04@1.0.0(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + ajv-formats@2.1.1(ajv@8.17.1): optionalDependencies: ajv: 8.17.1 + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: + ajv: 8.20.0 + ajv-keywords@5.1.0(ajv@8.17.1): dependencies: ajv: 8.17.1 @@ -6704,6 +6898,20 @@ snapshots: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 + ajv@8.18.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.2 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.2 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + ansi-colors@4.1.3: {} ansi-regex@5.0.1: {} @@ -7192,6 +7400,8 @@ snapshots: detect-libc@2.1.2: {} + diff@8.0.4: {} + dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -7727,6 +7937,12 @@ snapshots: jsonfile: 6.1.0 universalify: 2.0.1 + fs-extra@11.3.6: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + fs-extra@7.0.1: dependencies: graceful-fs: 4.2.11 @@ -7942,6 +8158,8 @@ snapshots: ignore@7.0.5: {} + import-lazy@4.0.0: {} + import-meta-resolve@4.2.0: {} imurmurhash@0.1.4: {} @@ -8144,6 +8362,8 @@ snapshots: jiti@2.4.2: optional: true + jju@1.4.0: {} + jose@5.10.0: {} jose@6.2.12: {} @@ -8396,6 +8616,10 @@ snapshots: mime-db@1.54.0: {} + minimatch@10.2.3: + dependencies: + brace-expansion: 5.0.9 + minimatch@10.2.5: dependencies: brace-expansion: 5.0.5 @@ -8836,6 +9060,8 @@ snapshots: semver@6.3.1: {} + semver@7.7.4: {} + semver@7.8.2: {} semver@7.8.5: {} @@ -8957,6 +9183,8 @@ snapshots: internal-slot: 1.1.0 optional: true + string-argv@0.3.2: {} + string.prototype.trim@1.2.11: dependencies: call-bind: 1.0.9 @@ -9164,6 +9392,8 @@ snapshots: typescript@4.5.2: {} + typescript@5.9.3: {} + typescript@6.0.3: {} typescript@7.0.2: diff --git a/smoke-tests/fixtures/bundler-cjs/main.cjs b/smoke-tests/fixtures/bundler-cjs/main.cjs index aaf7c3efea..ec64444a42 100644 --- a/smoke-tests/fixtures/bundler-cjs/main.cjs +++ b/smoke-tests/fixtures/bundler-cjs/main.cjs @@ -2,9 +2,10 @@ require('../../shared/assertions.js'); const lk = require('livekit-client'); -const result = globalThis.__livekitRunSmoke(lk, globalThis.__expectedVersion); -globalThis.__smoke = result; -const el = document.getElementById('result'); -if (el) { - el.textContent = JSON.stringify(result, null, 2); -} +globalThis.__livekitRunSmoke(lk, globalThis.__expectedVersion).then((result) => { + globalThis.__smoke = result; + const el = document.getElementById('result'); + if (el) { + el.textContent = JSON.stringify(result, null, 2); + } +}); diff --git a/smoke-tests/fixtures/bundler-esm/main.js b/smoke-tests/fixtures/bundler-esm/main.js index e7534ff6d6..5f4007ed37 100644 --- a/smoke-tests/fixtures/bundler-esm/main.js +++ b/smoke-tests/fixtures/bundler-esm/main.js @@ -1,7 +1,8 @@ // Side-effect import: assertions.js installs `globalThis.__livekitRunSmoke`. -import '../../shared/assertions.js'; import * as lk from 'livekit-client'; +import '../../shared/assertions.js'; -const result = window.__livekitRunSmoke(lk, window.__expectedVersion); -window.__smoke = result; -document.getElementById('result').textContent = JSON.stringify(result, null, 2); +window.__livekitRunSmoke(lk, window.__expectedVersion).then((result) => { + window.__smoke = result; + document.getElementById('result').textContent = JSON.stringify(result, null, 2); +}); diff --git a/smoke-tests/fixtures/static/esm-direct.html b/smoke-tests/fixtures/static/esm-direct.html index ed195d4c76..e9278361d8 100644 --- a/smoke-tests/fixtures/static/esm-direct.html +++ b/smoke-tests/fixtures/static/esm-direct.html @@ -10,8 +10,9 @@

livekit-client smoke — native ESM

diff --git a/smoke-tests/fixtures/static/umd-global.html b/smoke-tests/fixtures/static/umd-global.html index 6515758650..179ef41fd5 100644 --- a/smoke-tests/fixtures/static/umd-global.html +++ b/smoke-tests/fixtures/static/umd-global.html @@ -10,7 +10,7 @@

livekit-client smoke — UMD global (CDN-style)