NTP-26125 | added type for event data
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import {MessagingType} from "./assets/js/ajaxClient.ts";
|
import {MessagingType} from "./assets/js/ajaxClient.ts";
|
||||||
import {CallStatus, PushType, CallState} from "./types.ts";
|
import {CallStatus, PushType, CallState, EventData} from "./types.ts";
|
||||||
import {parseQuerystring} from "@universal-call-sdk/common/lib/utils/parsingUtils.ts";
|
import {parseQuerystring} from "@universal-call-sdk/common/lib/utils/parsingUtils.ts";
|
||||||
|
|
||||||
class CallStateManager {
|
class CallStateManager {
|
||||||
@@ -208,7 +208,7 @@ export function extractAndProcessEvents(rawResponse: any) {
|
|||||||
})
|
})
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
parts.forEach(event => {
|
parts.forEach((event : EventData) => {
|
||||||
try {
|
try {
|
||||||
callStateManager.handleEvent(event);
|
callStateManager.handleEvent(event);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -103,3 +103,8 @@ export interface CallState {
|
|||||||
callId?: string;
|
callId?: string;
|
||||||
} | null;
|
} | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface EventData {
|
||||||
|
pushType: PushType;
|
||||||
|
data: any;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user