UNPKG

fcc-core

Version:

Fusion communication center.

62 lines (56 loc) 2.77 kB
// 创建FCC对象是的配置 interface options { meeting?: boolean phone?: boolean IM?: boolean monitor?: boolean pointToPointCall?: boolean } // FCC 接口返回的结果集 interface result { status: number msg: string parameterErrors: object stack: string data: object } // 事件 type events = { OnOffLineNotice: (type: number) => void, OnDropped: (type: number) => void, OnReconnect: any, // 待设计!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! OnDialVoiceRequest: (callId: string, caller: string) => void, OnDialVoiceDropped: (callId: string, type: number, msg: string) => void, OnDialVideoRequest: (callId: string, caller: string) => void, OnDialVideoDropped: (callId: string, type: number, msg: string) => void, OnAnswerSuccess: (callId: string, caller: string, called: string) => void, OnAnswerRequest: (callId: string, caller: string, called: string) => void, OnReleaseSuccess: (callId: string, type: number) => void, OnLongNoAnswer: () => void, // 待完善设计!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! OnMeetingOver: (meettingId: string) => void, OnCloseMonitor: (resId: string) => void, OnExitMatrix: () => void, OnIMMessage: (receiveType: '1' | '2', receiveID: string, messageType: string, body: string) => void, // 待完善设计!!!!!!!!! OnIMRead: (messageId: string) => void } declare class FCC { constructor(options?: options) public connect (path: string): Promise<result> public login (params: {userAccount: string, password?: string}): Promise<result> public logout (): Promise<result> public listen<T extends keyof events> (eventType: T, callback: events[T]): Promise<result> public unlisten<T extends keyof events> (eventType: T, callback?: events[T]): Promise<result> public dialVoice (params: {userAccount: string}): Promise<result> public dialVoiceHangUp (): Promise<result> public dialVideo (params: {userAccount: string}): Promise<result> public dialVideoHangUp (): Promise<result> public callout (params: {phoneNum: string}): Promise<result> public answer (params: {callId: string}): Promise<result> public release (): Promise<result> public createConf (params: {meetingName: string, members: any[]}): Promise<result> // 待完善设计!!!!!!!!!!!!! public openMonitor (params: {resId: string, name?: string, x?: number, y?: number, width?: number, height?: number}): Promise<result> public enterMatrix (): Promise<result> public sendIM (params: {receiveType?: 1 | 2, receiveID: string, messageType: number, body: string}): Promise<result> // 待完善设计 public searchIM (params: object): Promise<result> // 待完善设计 } export = FCC