import { LocalMicrophoneStream } from '@webex/internal-media-core';
import { CallError } from '../../Errors/catalog/CallError';
import { CallDetails, CallDirection, CallId, CorrelationId, DisplayInformation, WebexRequestPayload } from '../../common/types';
import { Eventing } from '../../Events/impl';
import { CallerIdInfo, CallEvent, CallEventTypes, RoapEvent, RoapMessage } from '../../Events/types';
import { ILine } from '../line/types';
export declare enum MobiusEventType {
    CALL_SETUP = "mobius.call",
    CALL_PROGRESS = "mobius.callprogress",
    CALL_CONNECTED = "mobius.callconnected",
    CALL_MEDIA = "mobius.media",
    CALL_DISCONNECTED = "mobius.calldisconnected",
    CALL_INFO = "mobius.callinfo",
    REGISTRATION_DOWN = "registration.down"
}
export declare enum MediaState {
    OFFER = "OFFER",
    ANSWER = "ANSWER",
    OFFER_REQUEST = "OFFER_REQUEST",
    OK = "OK",
    ERROR = "ERROR"
}
export declare enum DisconnectCode {
    BUSY = 115,
    NORMAL = 0,
    MEDIA_INACTIVITY = 131
}
export declare enum DisconnectCause {
    BUSY = "User Busy.",
    NORMAL = "Normal Disconnect.",
    MEDIA_INACTIVITY = "Media Inactivity."
}
export declare enum MidCallEventType {
    CALL_INFO = "callInfo",
    CALL_STATE = "callState"
}
export type MidCallCallerId = {
    callerId: CallerIdInfo;
};
export type DisconnectReason = {
    code: DisconnectCode;
    cause: DisconnectCause;
};
export declare enum RoapScenario {
    ANSWER = "ANSWER",
    OK = "OK",
    OFFER = "OFFER",
    ERROR = "ERROR",
    OFFER_RESPONSE = "OFFER_RESPONSE"
}
export declare enum MobiusCallState {
    PROCEEDING = "sig_proceeding",
    PROGRESS = "sig_progress",
    ALERTING = "sig_alerting",
    CONNECTED = "sig_connected"
}
export type MobiusCallResponse = {
    statusCode: number;
    body: {
        device: {
            deviceId: string;
            correlationId: string;
        };
        callId: CallId;
        callData?: {
            callState: MobiusCallState;
        };
    };
};
export type MidCallEvent = {
    eventType: string;
    eventData: unknown;
};
export type SupplementaryServiceState = {
    callState: string;
};
export type MobiusCallData = {
    eventType: MobiusEventType;
    callProgressData?: {
        alerting: boolean;
        inbandMedia: boolean;
    };
    message?: RoapMessage;
    callerId?: CallerIdInfo;
    midCallService?: Array<MidCallEvent>;
    callId: CallId;
    callUrl: string;
    deviceId: string;
    correlationId: string;
    broadworksCorrelationInfo?: string;
};
export type MobiusRegistrationDownData = {
    eventType: MobiusEventType.REGISTRATION_DOWN;
    deviceInfo: {
        userId: string;
        device: {
            deviceId: string;
            uri: string;
            status: string;
        };
    };
};
export type MobiusAsyncEvent = {
    type: string;
    eventId: string;
    trackingId: string;
    data: MobiusCallData | MobiusRegistrationDownData;
};
export type PatchResponse = {
    statusCode: number;
    body: {
        device: {
            deviceId: string;
            correlationId: string;
        };
        callId: CallId;
    };
};
export type SSResponse = {
    statusCode: number;
    body: {
        device: {
            deviceId: string;
            correlationId: string;
        };
        callId: CallId;
    };
};
export type DivertContext = {
    destination: string;
    toVoicemail: boolean;
};
export type TransferContext = {
    transferorCallId: CallId;
    destination?: string;
    transferToCallId?: CallId;
};
export declare enum TransferType {
    BLIND = "BLIND",
    CONSULT = "CONSULT"
}
export declare enum MUTE_TYPE {
    USER = "user_mute",
    SYSTEM = "system_mute"
}
export type ParkContext = {
    isGroupPark: boolean;
    destination: string;
};
export type MediaContext = {
    previousState: string;
};
export type VoiceQualityMetrics = {
    VoRxCodec: string;
    VoPktSizeMs: number;
    maxJitter: number;
    VoOneWayDelayMs: number;
    networkType: string;
    hwType: string;
};
export type TransmitterVqPayload = {
    VoTxCodec: string;
    rtpBitRate: number;
};
export type ReceiveStatistics = {
    Dur: number;
    Pkt: number;
    Oct: number;
    LatePkt: number;
    LostPkt: number;
    AvgJit: number;
    VQMetrics: VoiceQualityMetrics;
};
export type TransmitStatistics = {
    Dur: number;
    Pkt: number;
    Oct: number;
    VQMetrics: TransmitterVqPayload;
};
export type CallRtpStats = {
    'rtp-rxstat': ReceiveStatistics;
    'rtp-txstat': TransmitStatistics;
};
export type IceEventPayload = {
    state?: string;
    connectionState?: string;
    iceConnectionState?: string;
    iceGatheringState?: string;
};
export type IceCandidateErrorEventPayload = {
    address?: string | null;
    errorCode?: number;
    errorText?: string;
    port?: number | null;
    url?: string;
};
export interface ICall extends Eventing<CallEventTypes> {
    lineId: string;
    getCallId(): string;
    getCorrelationId(): string;
    getDirection(): CallDirection;
    setCallId(callId: CallId): void;
    sendCallStateMachineEvt(event: CallEvent): void;
    sendMediaStateMachineEvt(event: RoapEvent): void;
    getDisconnectReason(): DisconnectReason;
    end(): void;
    isMuted(): boolean;
    isConnected(): boolean;
    isHeld(): boolean;
    doHoldResume(): void;
    mute(localAudioStream: LocalMicrophoneStream, muteType?: MUTE_TYPE): void;
    getCallerInfo(): DisplayInformation;
    startCallerIdResolution(callerInfo: CallerIdInfo): void;
    handleMidCallEvent(event: MidCallEvent): void;
    dial(localAudioStream: LocalMicrophoneStream): void;
    sendDigit(tone: string): void;
    answer(localAudioStream: LocalMicrophoneStream): void;
    completeTransfer(transferType: TransferType, transferCallId?: CallId, transferTarget?: string): void;
    updateMedia(newAudioStream: LocalMicrophoneStream): void;
    getBroadworksCorrelationInfo(): string | undefined;
    setBroadworksCorrelationInfo(broadworksCorrelationInfo: string): void;
    getCallRtpStats(): Promise<CallRtpStats>;
    postStatus(): Promise<WebexRequestPayload>;
}
export type DeleteRecordCallBack = (callId: CallId) => void;
export type CallEmitterCallBack = (callerInfo: DisplayInformation) => void;
export type CallErrorEmitterCallBack = (error: CallError) => void;
export type RetryCallBack = (interval: number) => void;
export interface ICallManager extends Eventing<CallEventTypes> {
    createCall(direction: CallDirection, deviceId: string, lineId: string, destination?: CallDetails): ICall;
    getCall(correlationId: CorrelationId): ICall;
    updateActiveMobius(url: string): void;
    getActiveCalls(): Record<string, ICall>;
    dequeueWsEvents(event: unknown): void;
    updateLine(deviceId: string, line: ILine): void;
}
//# sourceMappingURL=types.d.ts.map