Fixing typipng in back
This commit is contained in:
parent
cc1cb2f671
commit
6c5772e849
@ -301,7 +301,7 @@ export class IoSocketController {
|
||||
console.warn('Invalid WEBRTC_SIGNAL message received: ', data);
|
||||
return;
|
||||
}
|
||||
if(data && data.signal && (data.signal as any).type === "offer"){
|
||||
if(data.signal.type === "offer"){
|
||||
let roomOffer = this.offerScreenSharingByClient.get(data.roomId);
|
||||
if(!roomOffer){
|
||||
roomOffer = new Map<string, unknown>();
|
||||
|
@ -1,17 +1,22 @@
|
||||
import * as tg from "generic-type-guard";
|
||||
|
||||
export const isSignalData =
|
||||
new tg.IsInterface().withProperties({
|
||||
type: tg.isOptional(tg.isString)
|
||||
}).get();
|
||||
|
||||
export const isWebRtcSignalMessageInterface =
|
||||
new tg.IsInterface().withProperties({
|
||||
userId: tg.isString,
|
||||
receiverId: tg.isString,
|
||||
roomId: tg.isString,
|
||||
signal: tg.isUnknown
|
||||
signal: isSignalData
|
||||
}).get();
|
||||
export const isWebRtcScreenSharingSignalMessageInterface =
|
||||
new tg.IsInterface().withProperties({
|
||||
userId: tg.isString,
|
||||
roomId: tg.isString,
|
||||
signal: tg.isUnknown
|
||||
signal: isSignalData
|
||||
}).get();
|
||||
export const isWebRtcScreenSharingStartMessageInterface =
|
||||
new tg.IsInterface().withProperties({
|
||||
@ -19,3 +24,4 @@ export const isWebRtcScreenSharingStartMessageInterface =
|
||||
roomId: tg.isString
|
||||
}).get();
|
||||
export type WebRtcSignalMessageInterface = tg.GuardedType<typeof isWebRtcSignalMessageInterface>;
|
||||
export type WebRtcScreenSharingMessageInterface = tg.GuardedType<typeof isWebRtcScreenSharingSignalMessageInterface>;
|
||||
|
Loading…
Reference in New Issue
Block a user