import { Credentials, AgentInfo } from './authentication.service'; import { MediaInfo } from './media-channel'; import { Call } from './call'; import { IOService } from './io'; export interface ZiwoClientOptions { /** * @contactCenterName is the contact center the agent is working for */ contactCenterName: string; /** * see `authentication.ts#Credentials` for complete definition */ credentials: Credentials; /** * @autoConnect let you choose to connect the agent automatically or not. * Default = true * Error is raised if authentication fails. In case you want to handle failed authentication, run `connect` manually */ autoConnect: boolean; /** * [DEPRECATED] - use @mediaTag instead */ tags: MediaInfo; /** * @mediaTag is a DIV element that will contains the HTML media elements used for calls * The div must always be available but doesn't have to be visible */ mediaTag: HTMLDivElement; /** * @useGoogleStun will force Google STUNS ONLY */ useGoogleStun?: boolean; /** * @debug display log info if set to true */ debug?: boolean; } /** * Ziwo Client allow your to setup the environment. * It will setup the WebRTC, open the WebSocket and do the required authentications * * See README#Ziwo Client to see how to instanciate a new client. * Make sure to wait for `connected` event before doing further action. * * Once the client is instancied and you received the `connected` event, Ziwo is ready to be used * and you can start a call by using `startCall(phoneNumber:string)` or simply wait for events to proc. */ export declare class ZiwoClient { /** * @connectedAgent provide useful information about the connected user * See src/authentication.service.ts#AgentInfo for more details */ connectedAgent?: AgentInfo; options: ZiwoClientOptions; io: IOService; private calls; private apiService; private verto; private debug; constructor(options: ZiwoClientOptions); restart(options: ZiwoClientOptions): void; /** * connect authenticate the user over Ziwo & our communication socket * This function is required before proceeding with calls */ connect(): Promise; /** * Disconnect user from our socket and stop the protocol */ disconnect(): Promise; restartSocket(): void; /** * Add a callback function for all events * Can be used instead of `addEventListener` * NoteL Event thrown through this support * does not include the `ziwo` suffix nor the `_jorel-dialog-state` prefix */ addListener(func: Function): void; /** * Start a phone call with the external phone number provided and return an instance of the Call * Note: the call's instance will also be provided in all the events */ startCall(phoneNumber: string): Promise; /** * Start a call using click2call * return the call ID if the call is successful or undefined if an issue occured */ startClick2Call(phoneNumber: string, roaming?: boolean): Promise; answerCall(): void; /** * Opt out of Google Stun */ optOutGoogleStunServer(): Promise; }