interface SessionBody { doorbot_id: number; session_id: string; } interface AnswerMessage { method: 'sdp'; body: { sdp: string; type: 'answer'; } & SessionBody; } interface IceCandidateMessage { method: 'ice'; body: { ice: string; mlineindex: number; } & SessionBody; } interface SessionCreatedMessage { method: 'session_created'; body: SessionBody; } interface SessionStartedMessage { method: 'session_started'; body: SessionBody; } interface PongMessage { method: 'pong'; body: SessionBody; } interface NotificationMessage { method: 'notification'; body: { is_ok: boolean; text: string; } & SessionBody; } declare enum CloseReasonCode { NormalClose = 0, AuthenticationFailed = 5, Timeout = 6 } interface CloseMessage { method: 'close'; body: { reason: { code: CloseReasonCode; text: string; }; } & SessionBody; } export type IncomingMessage = AnswerMessage | IceCandidateMessage | SessionCreatedMessage | SessionStartedMessage | PongMessage | CloseMessage | NotificationMessage; export {};