import type { Readable } from 'svelte/store'; import type { AudioOffer, VideoOffer } from '../../plugins/videoroom/publish'; import type { DeviceOffer } from '../../plugins/videoroom/publish/factory'; export { default as Selector } from './index.svelte'; /** * The payload of the attach event; exposes the refresh function to the caller */ export declare type SelectorAttachEvent = { refresh: () => Promise; }; /** * The payload of a refresh event, listing the devices and those selected */ export declare type RefreshEvent = { devices: Devices; selected: SelectedDevices; }; /** * Config option for which kinds of media to check and return */ declare type ListDeviceConfig = { audio?: boolean; video?: boolean; }; /** * The return structure of the ListDevices function */ export declare type SelectedDevices = { audio?: Id; video?: Id; }; /** * Index devices as lists according to their kind */ export declare type Devices = Record<'videoinput' | 'audioinput', MediaDeviceInfo[]>; /** * For sanity's sake, explicitly declare this trivial type */ export declare type Id = string; export declare type Offer = VideoOffer | AudioOffer; export declare type OfferManager = { mute: () => void; unmute: () => void; setDeviceId: (deviceId: string) => void; offer: Readable; }; /** * Wrap up the logic for offer handling: `mute` will always set the offer to * false, otherwise it's a janus-compatible object structure with the deviceId */ export declare function setupOffer(initial: Offer | false): OfferManager; /** * A promisified wrapper around Janus' listDevices() function */ export declare function listDevices(): Promise; /** * Helper function to extract the device IDs of the requested device types of the given media stream */ export declare function getDeviceIdsFromLocalStream(localStream: MediaStream, config?: ListDeviceConfig): SelectedDevices;