TP-89230 | universal call sdk
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import GenericObject from "../types/GenericObject.ts";
|
||||
|
||||
class IAdapter {
|
||||
registerOnCallIncoming(callback: ()=>void) {callback()}
|
||||
registerOnCallConnected(callback: ()=>void) {callback()}
|
||||
registerOnCallDisconnected(callback: ()=>void) {callback()}
|
||||
registerOnCallIncoming(callback: (callState: GenericObject)=>void) {callback({})}
|
||||
registerOnCallConnected(callback: (callState: GenericObject)=>void) {callback({})}
|
||||
registerOnCallDisconnected(callback: (callState: GenericObject)=>void) {callback({})}
|
||||
acceptCall() {}
|
||||
rejectCall() {}
|
||||
muteCall() {}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useReducer} from 'react';
|
||||
import {GenericObject, StateType} from "./types.ts";
|
||||
import IAdapter from "@universal-call-sdk/common/lib/Interfaces/IAdapter.ts";
|
||||
|
||||
|
||||
|
||||
@@ -72,10 +73,13 @@ const initialState : StateType = {
|
||||
}
|
||||
|
||||
|
||||
function UseCallSdk(adapter : any) {
|
||||
function UseCallSdk(adapter : IAdapter) {
|
||||
// @ts-expect-error sdfsf
|
||||
const [callState] = useReducer<any>(reducer, initialState,()=> initialState);
|
||||
|
||||
|
||||
console.log('adapter in universal call sdk', adapter)
|
||||
|
||||
function registerOnCallIncoming(callback : (callState: GenericObject)=>void) {
|
||||
//dispatch({type: actionTypes.CALL_INCOMING, payload: {}})
|
||||
adapter.registerOnCallIncoming(callback);
|
||||
|
||||
Reference in New Issue
Block a user