import { EContentUseLicense } from '../ApiManager'; import { TOnAddedTransceiver, TRemoteStreams } from '../CallManager'; import { SipConnector } from '../SipConnector'; import { TOutboundVideoVerificationStrictness, TStatsManagerEventMap } from '../StatsManager'; import { TContentHint } from '../utils/peerConnection'; import { TCallToServerParameters, TConnectAndCallToServerParameters, TConnectAndCallToServerResult, TConnectToServerOptions, TConnectToServerParameters, TConnectToServerResult } from './types'; type TEnterRoomHandlers = { onEnterPurgatory?: () => void; onEnterConference?: (parameters_: { isSuccessProgressCall: boolean; }) => void; }; export declare const TEST_HOOKS: { handleEnterRoomEvent: (room: string, isSuccessProgressCall: boolean, { onEnterPurgatory, onEnterConference }: TEnterRoomHandlers) => void; handleOnceRaceEvent: (unsubscribeEnterConference: () => void, onEndedCall?: () => void) => void; handleFailProgressEvent: (onFailProgressCall: (() => void) | undefined, unsubscribeEnterConference: () => void, error: Error) => never; }; interface IProxyMethods { on: SipConnector['on']; once: SipConnector['once']; onceRace: SipConnector['onceRace']; wait: SipConnector['wait']; off: SipConnector['off']; sendDTMF: SipConnector['sendDTMF']; hangUp: SipConnector['hangUp']; declineToIncomingCall: SipConnector['declineToIncomingCall']; sendChannels: SipConnector['sendChannels']; checkTelephony: SipConnector['checkTelephony']; waitChannels: SipConnector['waitChannels']; ping: SipConnector['ping']; startAutoConnect: SipConnector['startAutoConnect']; stopAutoConnect: SipConnector['stopAutoConnect']; connection: SipConnector['connection']; isConfigured: SipConnector['isConfigured']; isRegistered: SipConnector['isRegistered']; } declare class SipConnectorFacade implements IProxyMethods { on: IProxyMethods['on']; once: IProxyMethods['once']; onceRace: IProxyMethods['onceRace']; wait: IProxyMethods['wait']; off: IProxyMethods['off']; sendDTMF: IProxyMethods['sendDTMF']; hangUp: IProxyMethods['hangUp']; declineToIncomingCall: IProxyMethods['declineToIncomingCall']; sendChannels: IProxyMethods['sendChannels']; checkTelephony: IProxyMethods['checkTelephony']; waitChannels: IProxyMethods['waitChannels']; ping: IProxyMethods['ping']; startAutoConnect: IProxyMethods['startAutoConnect']; stopAutoConnect: IProxyMethods['stopAutoConnect']; connection: IProxyMethods['connection']; isConfigured: IProxyMethods['isConfigured']; isRegistered: IProxyMethods['isRegistered']; readonly sipConnector: SipConnector; constructor(sipConnector: SipConnector); connectToServer: (parameters: TConnectToServerParameters, options?: TConnectToServerOptions) => Promise; connectAndCallToServer: ({ connection, call, }: TConnectAndCallToServerParameters) => Promise; callToServer: (parameters: TCallToServerParameters) => Promise; disconnectFromServer: () => Promise<{ isSuccessful: boolean; }>; answerToIncomingCall: (parameters: { mediaStream: MediaStream; extraHeaders?: string[] | undefined; iceServers?: RTCIceServer[]; contentHint?: TContentHint; degradationPreference?: RTCDegradationPreference; sendEncodings?: RTCRtpEncodingParameters[]; offerToReceiveAudio?: boolean; offerToReceiveVideo?: boolean; directionVideo?: RTCRtpTransceiverDirection; directionAudio?: RTCRtpTransceiverDirection; onBeforeProgressCall?: (conference: string) => void; onSuccessProgressCall?: (parameters_: { isPurgatory: boolean; }) => void; onFailProgressCall?: () => void; onFinishProgressCall?: () => void; onEnterPurgatory?: () => void; onEnterConference?: (parameters_: { isSuccessProgressCall: boolean; }) => void; onEndedCall?: () => void; onAddedTransceiver?: TOnAddedTransceiver; }) => Promise; updatePresentation: ({ videoTrack, contentHint, degradationPreference, sendEncodings, onAddedTransceiver, }: { videoTrack: MediaStreamVideoTrack; contentHint?: TContentHint; degradationPreference?: RTCDegradationPreference; sendEncodings?: RTCRtpEncodingParameters[]; onAddedTransceiver?: TOnAddedTransceiver; }) => Promise; startPresentation: ({ videoTrack, contentHint, degradationPreference, sendEncodings, callLimit, onAddedTransceiver, }: { videoTrack: MediaStreamVideoTrack; contentHint?: TContentHint; degradationPreference?: RTCDegradationPreference; sendEncodings?: RTCRtpEncodingParameters[]; onAddedTransceiver?: TOnAddedTransceiver; callLimit?: number; }) => Promise; stopPresentation: () => Promise; sendRefusalToTurnOnMic: () => Promise; sendRefusalToTurnOnCam: () => Promise; sendMediaState: ({ isEnabledCam, isEnabledMic, }: { isEnabledCam: boolean; isEnabledMic: boolean; }) => Promise; /** * Замена media stream с опциональной верификацией исходящего video через stats. * Опции `waitForOutboundVideoPackets*` пробрасываются в SipConnector без изменений. */ replaceMediaStream: (mediaStream: MediaStream, options?: { deleteExisting?: boolean; addMissing?: boolean; forceRenegotiation?: boolean; contentHint?: TContentHint; degradationPreference?: RTCDegradationPreference; sendEncodings?: RTCRtpEncodingParameters[]; onAddedTransceiver?: TOnAddedTransceiver; waitForOutboundVideoPackets?: boolean; waitForOutboundVideoPacketsTimeout?: number; waitForOutboundVideoPacketsStrictness?: TOutboundVideoVerificationStrictness; }) => Promise; askPermissionToEnableCam: () => Promise; resolveHandleReadyRemoteStreamsDebounced: ({ onReadyRemoteStreams, }: { onReadyRemoteStreams: (streams: TRemoteStreams) => void; }) => import('ts-debounce').DebouncedFunction void>; resolveHandleReadyRemoteStreams: ({ onReadyRemoteStreams, }: { onReadyRemoteStreams: () => void; }) => ({ track }: { track: MediaStreamTrack; }) => void; getRemoteStreams: () => TRemoteStreams; onUseLicense: (handler: (license: EContentUseLicense) => void) => (() => void); onMustStopPresentation: (handler: () => void) => (() => void); onMoveToSpectators: (handler: (event: { isAvailableSendingMedia: boolean; isSynthetic: true; } | { isAvailableSendingMedia: boolean; isSynthetic: false; audioId: string; }) => void) => (() => void); onMoveToParticipants: (handler: () => void) => (() => void); onStats: (handler: (data: TStatsManagerEventMap["collected"]) => void) => (() => void); offStats: (handler: (data: TStatsManagerEventMap["collected"]) => void) => void; } export default SipConnectorFacade;