1- /** 0.6.10 */
1+ /** 0.7.0 */
22
33export as namespace SendBirdCall ;
44
@@ -9,14 +9,35 @@ export function connectWebSocket(): Promise<void>;
99export function addListener ( id : string , listener : SendBirdCallListener ) : void ;
1010export function removeListener ( id : string ) : void ;
1111export function removeAllListeners ( ) : void ;
12- export function dial ( userId : string , isVideoCall : false , callOption : DirectCallOption , callback ?: DialHandler ) : DirectCall ;
12+ export function dial ( userId : string , isVideoCall : boolean , callOption : DirectCallOption , callback ?: DialHandler ) : DirectCall ;
13+ export function dial ( params : DialParams , callback ?: DialHandler ) : DirectCall ;
1314export function createDirectCallLogListQuery ( params ?: DirectCallLogListQueryParams ) : DirectCallLogListQuery ;
15+ export function getCurrentAudioInputDevice ( ) : MediaDeviceInfo ;
16+ export function getAvailableAudioInputDevices ( ) : MediaDeviceInfo [ ] ;
17+ export function selectAudioInputDevice ( mediaDeviceInfo : MediaDeviceInfo ) : void ;
18+ export function getCurrentAudioOutputDevice ( ) : MediaDeviceInfo ;
19+ export function getAvailableAudioOutputDevices ( ) : MediaDeviceInfo [ ] ;
20+ export function selectAudioOutputDevice ( mediaDeviceInfo : MediaDeviceInfo ) : void ;
21+ export function updateCustomItems ( callId : string , customItems : CustomItems , callback ?: CustomItemsHandler ) : Promise < CustomItemsResult > ;
22+ export function deleteCustomItems ( callId : string , customItemKeys : string [ ] , callback ?: CustomItemsHandler ) : Promise < CustomItemsResult > ;
23+ export function deleteAllCustomItems ( callId : string , callback ?: CustomItemsHandler ) : Promise < CustomItemsResult > ;
1424export function setLoggerLevel ( level : LoggerLevel ) ;
1525export function getCall ( callId : string ) : DirectCall ;
1626export const sdkVersion : string ;
1727export const appId : string ;
1828export const currentUser : User ;
1929
30+ export interface DialParams {
31+ userId : string ;
32+ isVideoCall : boolean ;
33+ callOption : DirectCallOption ;
34+ customItems ?: CustomItems ;
35+ }
36+
37+ export interface AcceptParams {
38+ callOption : DirectCallOption ;
39+ }
40+
2041export enum LoggerLevel {
2142 NONE = 'NONE' ,
2243 ERROR = 'ERROR'
@@ -42,15 +63,21 @@ export enum DirectCallEndResult {
4263
4364export interface SendBirdCallListener {
4465 onRinging : ( ( directCall : DirectCall ) => void ) | null ;
66+ onAudioInputDeviceChanged : ( ( currentAudioInputDevice : MediaDeviceInfo , availableAudioInputDevices : MediaDeviceInfo [ ] ) => void ) | null ;
67+ onAudioOutputDeviceChanged : ( ( currentAudioOutputDevice : MediaDeviceInfo , availableAudioOutputDevices : MediaDeviceInfo [ ] ) => void ) | null ;
4568}
4669
4770export interface DirectCall {
4871 onEstablished : ( ( call : DirectCall ) => void ) | null ;
4972 onConnected : ( ( call : DirectCall ) => void ) | null ;
73+ onReconnected : ( ( call : DirectCall ) => void ) | null ;
74+ onReconnecting : ( ( call : DirectCall ) => void ) | null ;
5075
5176 //deprecated
5277 onRemoteAudioEnabled : ( ( call : DirectCall ) => void ) | null ;
5378 onRemoteAudioSettingsChanged : ( ( call : DirectCall ) => void ) | null ;
79+ onCustomItemsUpdated : ( ( call : DirectCall , updatedKeys : string [ ] ) => void ) | null ;
80+ onCustomItemsDeleted : ( ( call : DirectCall , deletedKeys : string [ ] ) => void ) | null ;
5481 onEnded : ( ( call : DirectCall ) => void ) | null ;
5582
5683 readonly caller : DirectCallUser ;
@@ -63,9 +90,11 @@ export interface DirectCall {
6390 readonly myRole : DirectCallUserRole ;
6491 readonly endedBy : DirectCallUser ;
6592 readonly endResult : DirectCallEndResult ;
93+ readonly customItems : CustomItems ;
6694
6795 getDuration ( ) : number ;
68- accept ( callOptions : DirectCallOption ) : void ;
96+ accept ( callOption : DirectCallOption ) : void ;
97+ accept ( params : AcceptParams ) : void ;
6998 end ( ) : void ;
7099
71100 //deprecated
@@ -76,6 +105,10 @@ export interface DirectCall {
76105
77106 muteMicrophone ( ) : void ;
78107 unmuteMicrophone ( ) : void ;
108+
109+ updateCustomItems ( customItems : CustomItems , callback ?: CustomItemsHandler ) : Promise < CustomItemsResult > ;
110+ deleteCustomItems ( customItemsKeys : string [ ] , callback ?: CustomItemsHandler ) : Promise < CustomItemsResult > ;
111+ deleteAllCustomItems ( callback ?: CustomItemsHandler ) : Promise < CustomItemsResult > ;
79112}
80113
81114export interface DirectCallOption {
@@ -107,6 +140,7 @@ export interface DirectCallLog {
107140 readonly duration : number ;
108141 readonly endResult : DirectCallEndResult ;
109142 readonly isVideoCall : boolean ;
143+ readonly customItems : CustomItems ;
110144}
111145
112146export interface DirectCallUser {
@@ -126,6 +160,11 @@ export interface AuthOption {
126160export type AuthHandler = ( user ?: User , error ?: Error ) => void ;
127161export type DialHandler = ( call ?: DirectCall , error ?: Error ) => void ;
128162export type CompletionHandler = ( error ?: Error ) => void ;
163+ export type CustomItemsHandler = ( result ?: CustomItemsResult , error ?: Error ) => void ;
164+ export interface CustomItemsResult {
165+ readonly customItems : CustomItems ;
166+ readonly affectedKeys : string [ ] ;
167+ }
129168
130169export interface User {
131170 readonly userId : string ;
@@ -139,4 +178,8 @@ export interface DirectCallLogListQueryParams {
139178 myRole ?: DirectCallUserRole ;
140179 endResults ?: DirectCallEndResult [ ] ;
141180 limit ?: number ;
142- }
181+ }
182+
183+ export interface CustomItems {
184+ [ key : string ] : string ;
185+ }
0 commit comments