1
- /** 0.6.10 */
1
+ /** 0.7.0 */
2
2
3
3
export as namespace SendBirdCall ;
4
4
@@ -9,14 +9,35 @@ export function connectWebSocket(): Promise<void>;
9
9
export function addListener ( id : string , listener : SendBirdCallListener ) : void ;
10
10
export function removeListener ( id : string ) : void ;
11
11
export 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 ;
13
14
export 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 > ;
14
24
export function setLoggerLevel ( level : LoggerLevel ) ;
15
25
export function getCall ( callId : string ) : DirectCall ;
16
26
export const sdkVersion : string ;
17
27
export const appId : string ;
18
28
export const currentUser : User ;
19
29
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
+
20
41
export enum LoggerLevel {
21
42
NONE = 'NONE' ,
22
43
ERROR = 'ERROR'
@@ -42,15 +63,21 @@ export enum DirectCallEndResult {
42
63
43
64
export interface SendBirdCallListener {
44
65
onRinging : ( ( directCall : DirectCall ) => void ) | null ;
66
+ onAudioInputDeviceChanged : ( ( currentAudioInputDevice : MediaDeviceInfo , availableAudioInputDevices : MediaDeviceInfo [ ] ) => void ) | null ;
67
+ onAudioOutputDeviceChanged : ( ( currentAudioOutputDevice : MediaDeviceInfo , availableAudioOutputDevices : MediaDeviceInfo [ ] ) => void ) | null ;
45
68
}
46
69
47
70
export interface DirectCall {
48
71
onEstablished : ( ( call : DirectCall ) => void ) | null ;
49
72
onConnected : ( ( call : DirectCall ) => void ) | null ;
73
+ onReconnected : ( ( call : DirectCall ) => void ) | null ;
74
+ onReconnecting : ( ( call : DirectCall ) => void ) | null ;
50
75
51
76
//deprecated
52
77
onRemoteAudioEnabled : ( ( call : DirectCall ) => void ) | null ;
53
78
onRemoteAudioSettingsChanged : ( ( call : DirectCall ) => void ) | null ;
79
+ onCustomItemsUpdated : ( ( call : DirectCall , updatedKeys : string [ ] ) => void ) | null ;
80
+ onCustomItemsDeleted : ( ( call : DirectCall , deletedKeys : string [ ] ) => void ) | null ;
54
81
onEnded : ( ( call : DirectCall ) => void ) | null ;
55
82
56
83
readonly caller : DirectCallUser ;
@@ -63,9 +90,11 @@ export interface DirectCall {
63
90
readonly myRole : DirectCallUserRole ;
64
91
readonly endedBy : DirectCallUser ;
65
92
readonly endResult : DirectCallEndResult ;
93
+ readonly customItems : CustomItems ;
66
94
67
95
getDuration ( ) : number ;
68
- accept ( callOptions : DirectCallOption ) : void ;
96
+ accept ( callOption : DirectCallOption ) : void ;
97
+ accept ( params : AcceptParams ) : void ;
69
98
end ( ) : void ;
70
99
71
100
//deprecated
@@ -76,6 +105,10 @@ export interface DirectCall {
76
105
77
106
muteMicrophone ( ) : void ;
78
107
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 > ;
79
112
}
80
113
81
114
export interface DirectCallOption {
@@ -107,6 +140,7 @@ export interface DirectCallLog {
107
140
readonly duration : number ;
108
141
readonly endResult : DirectCallEndResult ;
109
142
readonly isVideoCall : boolean ;
143
+ readonly customItems : CustomItems ;
110
144
}
111
145
112
146
export interface DirectCallUser {
@@ -126,6 +160,11 @@ export interface AuthOption {
126
160
export type AuthHandler = ( user ?: User , error ?: Error ) => void ;
127
161
export type DialHandler = ( call ?: DirectCall , error ?: Error ) => void ;
128
162
export 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
+ }
129
168
130
169
export interface User {
131
170
readonly userId : string ;
@@ -139,4 +178,8 @@ export interface DirectCallLogListQueryParams {
139
178
myRole ?: DirectCallUserRole ;
140
179
endResults ?: DirectCallEndResult [ ] ;
141
180
limit ?: number ;
142
- }
181
+ }
182
+
183
+ export interface CustomItems {
184
+ [ key : string ] : string ;
185
+ }
0 commit comments