import { Observable } from 'rxjs';
import { Call } from '../Call';
import { TrackPublishOptions } from '../rtc';
import { DeviceManagerState } from './DeviceManagerState';
import { ScopedLogger } from '../logger';
import { TrackType } from '../gen/video/sfu/models/models';
import { MediaStreamFilter, MediaStreamFilterRegistrationResult } from './filters';
import { DevicePersistenceOptions } from './devicePersistence';
import { VirtualDevice, VirtualDeviceEntry, VirtualDeviceHandle } from './VirtualDevice';
export declare abstract class DeviceManager<S extends DeviceManagerState<C>, C = MediaTrackConstraints> {
    /**
     * if true, stops the media stream when call is left
     */
    stopOnLeave: boolean;
    logger: ScopedLogger;
    state: S;
    protected readonly call: Call;
    protected readonly trackType: TrackType;
    protected subscriptions: (() => void)[];
    protected currentStreamCleanups: (() => void)[];
    protected devicePersistence: Required<DevicePersistenceOptions>;
    protected areSubscriptionsSetUp: boolean;
    private isTrackStoppedDueToTrackEnd;
    private filters;
    private virtualDevicesSubject;
    private activeVirtualSession;
    private virtualDeviceConcurrencyTag;
    private statusChangeConcurrencyTag;
    private filterRegistrationConcurrencyTag;
    protected constructor(call: Call, state: S, trackType: TrackType, devicePersistence: Required<DevicePersistenceOptions>);
    setup(): void;
    /**
     * Lists the available audio/video devices
     *
     * Note: It prompts the user for a permission to use devices (if not already granted)
     *
     * @returns an Observable that will be updated if a device is connected or disconnected
     */
    listDevices(): Observable<MediaDeviceInfo[]>;
    /**
     * Registers a virtual camera or microphone backed by a caller-supplied
     * stream factory. The device appears in `listDevices()` and can be selected
     * via `select()` like any real device.
     *
     * Web only. React Native is not supported.
     *
     * Only supported for camera and microphone managers; calling on any other
     * manager throws.
     */
    registerVirtualDevice(virtualDevice: VirtualDevice<C>): VirtualDeviceHandle;
    protected sanitizeVirtualStream(stream: MediaStream): MediaStream;
    protected findVirtualDevice(deviceId: string | undefined): VirtualDeviceEntry<C> | undefined;
    private stopActiveVirtualSession;
    protected getSelectedStream(constraints: C): Promise<MediaStream>;
    /**
     * Returns `true` when this device is in enabled state.
     */
    get enabled(): boolean;
    /**
     * Starts stream.
     */
    enable(): Promise<void>;
    /**
     * Stops or pauses the stream based on state.disableMode
     */
    disable(options: {
        forceStop?: boolean;
    }): Promise<void>;
    disable(forceStop?: boolean): Promise<void>;
    /**
     * Returns a promise that resolves when all pe
     */
    statusChangeSettled(): Promise<void>;
    /**
     * If status was previously enabled, it will re-enable the device.
     */
    resume(): Promise<void>;
    /**
     * If the current device status is disabled, it will enable the device,
     * else it will disable it.
     */
    toggle(): Promise<void>;
    /**
     * Registers a filter that will be applied to the stream.
     *
     * The registered filter will get the existing stream, and it should return
     * a new stream with the applied filter.
     *
     * @param filter the filter to register.
     * @returns MediaStreamFilterRegistrationResult
     */
    registerFilter(filter: MediaStreamFilter): MediaStreamFilterRegistrationResult;
    /**
     * Will set the default constraints for the device.
     *
     * @param constraints the constraints to set.
     */
    setDefaultConstraints(constraints: C): void;
    /**
     * Selects a device.
     *
     * Note: This method is not supported in React Native
     * @param deviceId the device id to select.
     */
    select(deviceId: string | undefined): Promise<void>;
    /**
     * Disposes the manager.
     *
     * @internal
     */
    dispose: () => void;
    private runCurrentStreamCleanups;
    protected applySettingsToStream(): Promise<void>;
    protected abstract getDevices(): Observable<MediaDeviceInfo[]>;
    protected getResolvedConstraints(constraints: C): C;
    protected abstract getStream(constraints: C): Promise<MediaStream>;
    protected publishStream(stream: MediaStream, options?: TrackPublishOptions): Promise<void>;
    protected stopPublishStream(): Promise<void>;
    protected getTracks(): MediaStreamTrack[];
    protected muteStream(stopTracks?: boolean): Promise<void>;
    private disableTracks;
    private enableTracks;
    private stopTracks;
    private muteLocalStream;
    protected unmuteStream(): Promise<void>;
    private setLocalInterrupted;
    private get mediaDeviceKind();
    private handleDisconnectedOrReplacedDevices;
    protected findDevice(devices: MediaDeviceInfo[], deviceId: string): MediaDeviceInfo | undefined;
    private dispatchDeviceDisconnectedEvent;
    private persistPreference;
    protected applyPersistedPreferences(enabledInCallType: boolean): Promise<boolean>;
    private applyMutedState;
}
