import { StateStore } from '@stream-io/state-store'; import type { AudioPlayer } from './AudioPlayer'; export type AudioPlaybackArbiterState = { activeAudioPlayer: AudioPlayer | null; }; /** * Decides which player may play across every {@link AudioPlayerPool} that shares it, and owns the * single `Audio` element they take turns on: starting a player pauses the previous holder. * Exclusivity lives here, not in a pool, because each surface (`Channel`, `Thread`) mounts its own * pool. One reused element also keeps playback working on iOS, where an element must be unlocked * by a user gesture before it can be played programmatically. */ export declare class AudioPlaybackArbiter { state: StateStore; private element; private owner; get activeAudioPlayer(): AudioPlayer | null; /** * Hands the shared element to `owner`, pausing the previous holder, and loads `src` into it. * @param params.owner - Player that takes the element. * @param params.src - Audio source to load. Only assigned when it differs from the current one. * @returns The shared element. */ acquire: ({ owner, src }: { owner: AudioPlayer; src: string; }) => HTMLAudioElement; /** * Drops `owner`'s claim on the shared element and pauses it. Ignored when `owner` is not the * current holder, so a player torn down in the background cannot stop its successor. * @param owner - Player releasing the element. */ release: (owner: AudioPlayer) => void; setActivePlayer: (activeAudioPlayer: AudioPlayer | null) => void; } //# sourceMappingURL=AudioPlaybackArbiter.d.ts.map