import { INotificationEventData } from '../Modules/Verto/util/interfaces' ; import { Env , RTCElement } from './types' ; export interface ICredentials { username ? : string ; password ? : string ; token ? : string ; } export interface ISIPClientOptions { host ? : string ; port ? : number ; env ? : Env ; project ? : string ; credentials : ICredentials ; localElement ? : RTCElement ; remoteElement ? : RTCElement ; useMic ? : string | boolean ; useSpeaker ? : string | boolean ; useCamera ? : string | boolean ; displayName ? : string ; ringFile ? : string ; } interface export interface IClientOptions { /**
     * The JSON Web Token (JWT) to authenticate with your SIP Connection.
     * This is the recommended authentication strategy. [See how to create one](https://developers.telnyx.com/docs/v2/webrtc/quickstart).
     */ login_token : string ; /**
     * The `username` to authenticate with your SIP Connection.
     * `login` and `password` will take precedence over
     * `login_token` for authentication.
     */ login ? : string ; /**
     * The `password` to authenticate with your SIP Connection.
     */ password ? : string ; /**
     * A URL to a wav/mp3 ringtone file.
     */ ringtoneFile ? : string ; /**
     * A URL to a wav/mp3 ringback file that will be used when you disable
     * "Generate Ringback Tone" in your SIP Connection.
     */ ringbackFile ? : string ; } export interface ISIPCallOptions { destinationNumber : string ; remoteCallerName ? : string ; remoteCallerNumber ? : string ; callerName ? : string ; callerNumber ? : string ; id ? : string ; localStream ? : MediaStream ; remoteStream ? : MediaStream ; localElement ? : HTMLMediaElement | string | Function ; remoteElement ? : HTMLMediaElement | string | Function ; iceServers ? : RTCIceServer [ ] ; audio ? : boolean | MediaTrackConstraints ; video ? : boolean | MediaTrackConstraints ; useStereo ? : boolean ; micId ? : string ; camId ? : string ; speakerId ? : string ; onNotification ? : Function ; telnyxCallControlId ? : string ; telnyxSessionId ? : string ; telnyxLegId ? : string ; clientState ? : string ; } export interface ICall { setAudioInDevice ( deviceId ) : Promise < any > ; setAudioOutDevice ( deviceId ) : Promise < any > ; setVideoDevice ( deviceId ) : Promise < any > ; } interface export interface ICallOptions { /**
     * Phone number or SIP URI to dial.
     */ destinationNumber : string ; /**
     * Number to use as the caller ID when dialing out to a destination. A valid phone number is required for dials out to PSTN numbers.
     */ callerNumber ? : string ; /**
     * Name to use as the caller ID name when dialing out to a destination.
     */ callerName ? : string ; /**
     * Custom ID to identify the call. This will be used as the `callID` in place of the UUID generated by the client.
     */ id ? : string ; /**
     * Telnyx Call Control ID, if using Call Control services.
     */ telnyxCallControlId ? : string ; /**
     * Telnyx call session ID, if using Call Control services.
     */ telnyxSessionId ? : string ; /**
     * Telnyx call leg ID, if using Call Control services.
     */ telnyxLegId ? : string ; /**
     *
     * Telnyx's Call Control client_state. Can be used with Connections with Advanced -> Events enabled.
     * `clientState` string should be base64 encoded.
     */ clientState ? : string ; /**
     * If set, the call will use this stream instead of retrieving a new one.
     */ localStream ? : MediaStream ; /**
     * If set, the call will use this stream instead of retrieving a new one.
     */ remoteStream ? : MediaStream ; /**
     * Overrides client's default `localElement`.
     */ localElement ? : HTMLMediaElement | string ; /**
     * Overrides client's default `remoteElement`.
     */ remoteElement ? : HTMLMediaElement | string ; /**
     * Overrides client's default `iceServers`.
     */ iceServers ? : RTCIceServer [ ] ; /**
     * Overrides client's default audio constraints. Defaults to `true`
     */ audio ? : boolean ; /**
     * Overrides client's default video constraints. Defaults to `false`
     */ video ? : boolean ; /**
     * Uses stereo audio instead of mono.
     */ useStereo ? : boolean ; /**
     * `deviceId` to use as microphone. Overrides the client's default one.
     */ micId ? : string ; /**
     * `deviceId` to use as webcam. Overrides the client's default one.
     */ camId ? : string ; /**
     * `deviceId` to use as speaker. Overrides the client's default one.
     */ speakerId ? : string ; /**
     * Overrides client's default `telnyx.notification` handler for this call.
     */ onNotification ? : Function ; /**
     * Configures media (audio/video) in a call.
     */ mediaSettings : { useSdpASBandwidthKbps : boolean ; sdpASBandwidthKbps : number ; } ; } examples category apialias internalnote export interface INotification extends Omit < INotificationEventData , 'call' > { /**
     * Identifies the event case.
     */ type : string ; /**
     * The current call. Reference this call state to update your UI.
     * See `Call` documentation.
     */ call ? : ICall ; /**
     * Error from the `userMediaError` event.
     * Check your `audio` and `video` constraints for browser support.
     */ error ? : Error ; } export interface MessageEvents { ready : ( ) => void ; registered : ( ) => void ; unregistered : ( ) => void ; error : ( ) => void ; callUpdate : ( call : ICall ) => void ; 'socket.error' : ( error : Error ) => void ; 'socket.connect' : ( ) => void ; 'socket.close' : ( error ? : Error ) => void ; }