import type { AudioDevicesState, IOSAudioInterruptionEvent, IOSAudioSessionDiagnosticEvent, IOSAudioSessionState, StreamInCallManagerConfig } from './types'; /** * Cross-platform audio output device picker. */ declare class AudioDevicesManager { private eventEmitter?; private interruptionReassertSetup; /** * iOS + CallKit only: re-assert the user's output pick after an interruption ends. * * On interruption-end iOS clears the ephemeral route override (`setPreferredInput` / * `overrideOutputAudioPort`) and doesn't restore it, and callingx re-applies its config * only on engine-enable — not the engine-restart of interruption recovery. */ private ensureInterruptionReassert; /** * Get the current audio device state (available devices + the selected one). * Read directly from the audio session, so it works on every path. */ getStatus: () => Promise; /** * Switch the audio output to the device with the given id. * * @param deviceId the stable {@link AudioDevice.id} (not the display name). */ select: (deviceId: string) => void; /** * Register a listener for audio device changes. Returns an unsubscribe fn. * * @param onChange called with the latest {@link AudioDevicesState} on change. */ addChangeListener: (onChange: (state: AudioDevicesState) => void) => (() => void); } declare class IOSCallManager { private eventEmitter?; /** * Will trigger the iOS device selector. */ showDeviceSelector: () => void; /** * Register a listener for iOS audio interruptions. * * @param onInterruption callback to be called when iOS reports an audio interruption. */ addAudioInterruptionListener: (onInterruption: (event: IOSAudioInterruptionEvent) => void) => (() => void); /** * Register a listener for iOS audio session diagnostics (configuration, * activation and engine start results of the in-call manager). * * @param onDiagnostic callback to be called for every diagnostic event. * @internal used by the SDK's audio session diagnostics tracer. */ addAudioSessionDiagnosticListener: (onDiagnostic: (event: IOSAudioSessionDiagnosticEvent) => void) => (() => void); /** * Returns a snapshot of the shared iOS audio session. * Meant for debugging purposes. * @internal used by the SDK's audio session diagnostics tracer. */ getAudioSessionState: () => IOSAudioSessionState; /** * Re-activates the SDK-owned iOS audio session when iOS cleared it. * Resolves whether the session is active afterwards; rejects with the * AVAudioSession error (`code` is the OSStatus as a string, e.g. * `'561017449'` while another app owns the audio). * @internal used by the SDK's audio session diagnostics tracer. */ reactivateAudioSession: () => Promise; } declare class SpeakerManager { /** * Mutes or unmutes the speaker. */ setMute: (mute: boolean) => void; /** * Forces speakerphone on/off. */ setForceSpeakerphoneOn: (force: boolean) => void; } export declare class CallManager { audioDevices: AudioDevicesManager; ios: IOSCallManager; speaker: SpeakerManager; /** * The audio config recorded via {@link start}. The SDK's internal call manager reads it at the * next join-time start and applies it before the native audio manager is activated. */ private storedConfig?; /** * The config recorded via {@link start}. * * @internal Read by the SDK's internal call manager at join; not intended for app use. */ getStoredConfig: () => StreamInCallManagerConfig | undefined; /** * Records the desired audio config for the call. * * This does NOT start the native audio manager — the SDK owns native start/stop and applies this * config at the next join-time start (before the audio manager is activated). Call it **before** * joining. Calling it mid-call only updates the stored config; it does not change the running * call's audio, and the new config takes effect on the next call/rejoin. * * @param config.audioRole The audio role to set. It can be one of the following: * - `'communicator'`: (Default) For use cases like video or voice calls. * It prioritizes low latency and allows manual audio device switching. * Audio routing is controlled by the SDK. * - `'listener'`: For use cases like livestream viewing. * It prioritizes high-quality stereo audio streaming. * Audio routing is controlled by the OS, and manual switching is not supported. * * @param config.deviceEndpointType Overrides the default audio device endpoint. When omitted, * the SDK uses the device derived from the call settings. It can be one of the following: * - `'speaker'`: For normal video or voice calls. * - `'earpiece'`: For voice-only mobile call type scenarios. */ start: (config?: StreamInCallManagerConfig) => void; /** * Clears the stored audio config. */ stop: () => void; /** * For debugging purposes, will emit a log event with the current audio state. * in the native layer. * * NOTE: This method might be called outside of the call JOIN/LEFT window, * so it may lead to default peer connection factory and adm being created. */ logAudioState: () => void; /** * For debugging purposes, returns the current audio state as a string. * * NOTE: This method might be called outside of the call JOIN/LEFT window, * so it may lead to default peer connection factory and adm being created. * * @returns A string containing the current audio state information. */ getAudioStateLog: () => string; } export {}; //# sourceMappingURL=CallManager.d.ts.map