import { EnhancedEventEmitter } from './EnhancedEventEmitter'; import { Transport, TransportOptions } from './Transport'; import { HandlerFactory } from './handlers/HandlerInterface'; import { RtpCapabilities, MediaKind } from './RtpParameters'; import { SctpCapabilities } from './SctpParameters'; export type BuiltinHandlerName = 'Chrome111' | 'Chrome74' | 'Chrome70' | 'Firefox60' | 'Firefox111' | 'Safari12' | 'Edge11' | 'ReactNativeUnifiedPlan' | 'ReactNative'; export type DeviceOptions = { /** * The name of one of the builtin handlers. */ handlerName?: BuiltinHandlerName; /** * Custom handler factory. */ handlerFactory?: HandlerFactory; /** * DEPRECATED! * The name of one of the builtin handlers. */ Handler?: string; }; export declare function detectDevice(): BuiltinHandlerName | undefined; export type DeviceObserverEvents = { newtransport: [Transport]; }; export declare abstract class BaseDevice { protected _handlerFactory: HandlerFactory; private readonly _handlerName; private _loaded; private _extendedRtpCapabilities?; private _recvRtpCapabilities?; private readonly _canProduceByKind; private _sctpCapabilities?; protected readonly _observer: EnhancedEventEmitter; abstract switchDevice(handlerName: string): void; /** * Create a new Device to connect to mediasoup server. * * @throws {UnsupportedError} if device is not supported. */ constructor({ handlerName, handlerFactory, Handler }?: DeviceOptions); /** * The RTC handler name. */ get handlerName(): string; /** * Whether the Device is loaded. */ get loaded(): boolean; /** * RTP capabilities of the Device for receiving media. * * @throws {InvalidStateError} if not loaded. */ get rtpCapabilities(): RtpCapabilities; /** * SCTP capabilities of the Device. * * @throws {InvalidStateError} if not loaded. */ get sctpCapabilities(): SctpCapabilities; get observer(): EnhancedEventEmitter; /** * Initialize the Device. */ load({ routerRtpCapabilities }: { routerRtpCapabilities: RtpCapabilities; }): Promise; /** * Whether we can produce audio/video. * * @throws {InvalidStateError} if not loaded. * @throws {TypeError} if wrong arguments. */ canProduce(kind: MediaKind): boolean; /** * Creates a Transport for sending media. * * @throws {InvalidStateError} if not loaded. * @throws {TypeError} if wrong arguments. */ createSendTransport({ id, iceParameters, iceCandidates, dtlsParameters, sctpParameters, iceServers, iceTransportPolicy, additionalSettings, proprietaryConstraints, appData }: TransportOptions): Transport; /** * Creates a Transport for receiving media. * * @throws {InvalidStateError} if not loaded. * @throws {TypeError} if wrong arguments. */ createRecvTransport({ id, iceParameters, iceCandidates, dtlsParameters, sctpParameters, iceServers, iceTransportPolicy, additionalSettings, proprietaryConstraints, appData }: TransportOptions): Transport; private createTransport; } //# sourceMappingURL=BaseDevice.d.ts.map