import { VideoContentType, Metadata } from '../protocol'; import { DomainEvent } from './domain-event'; export declare namespace callEvents { enum EndReason { Terminated = "terminated", Timeout = "timeout", Ended = "ended", Hangup = "hangup", ConnectionDropped = "connection_dropped", Disconnected = "disconnected", CallRejected = "rejected", Busy = "busy" } abstract class CallEvent implements DomainEvent { readonly callId: string; readonly timestamp: number; readonly tag: string; readonly __discriminator__ = "domainEvent"; static isCallEvent(e: DomainEvent): e is CallEvent; protected constructor(callId: string, timestamp: number, tag: string); } class Created extends CallEvent { static readonly tag = "call_created"; readonly authorId: string; constructor(callId: string, authorId: string, timestamp: number); static isCreated(e: DomainEvent): e is Created; } class Invited extends CallEvent { static readonly tag = "call_invited"; readonly authorId: string; readonly invitee: string; readonly metadata?: Metadata; constructor(callId: string, authorId: string, invitee: string, timestamp: number, metadata?: Metadata); static isInvited(e: DomainEvent): e is Invited; } class Answered extends CallEvent { static readonly tag = "call_answered"; readonly authorId: string; constructor(callId: string, authorId: string, timestamp: number); static isAnswered(e: DomainEvent): e is Answered; } class Joined extends CallEvent { static readonly tag = "call_joined"; readonly authorId: string; constructor(callId: string, authorId: string, timestamp: number); static isJoined(e: DomainEvent): e is Joined; } class Left extends CallEvent { static readonly tag = "call_left"; readonly authorId: string; readonly reason: EndReason; constructor(callId: string, authorId: string, reason: EndReason, timestamp: number); static isLeft(e: DomainEvent): e is Left; } class Rejected extends CallEvent { static readonly tag = "call_rejected"; readonly authorId: string; readonly reason: EndReason; constructor(callId: string, authorId: string, reason: EndReason, timestamp: number); static isRejected(e: DomainEvent): e is Rejected; } class Ended extends CallEvent { static readonly tag = "call_ended"; readonly reason: EndReason; constructor(callId: string, reason: EndReason, timestamp: number); static isEnded(e: DomainEvent): e is Ended; } class CallHandledOnDevice extends CallEvent { static readonly tag = "call_handled_on_device"; readonly authorId: string; readonly device: string; constructor(callId: string, authorId: string, device: string, timestamp: number); static isCallHandledOnDevice(e: DomainEvent): e is CallHandledOnDevice; } class DeviceOffline extends CallEvent { static readonly tag = "device_offline"; readonly userId: string; readonly deviceId: string; constructor(callId: string, userId: string, deviceId: string, timestamp: number); static isDeviceOffline(e: DomainEvent): e is DeviceOffline; } class DeviceOnline extends CallEvent { static readonly tag = "device_online"; readonly userId: string; readonly deviceId: string; constructor(callId: string, userId: string, deviceId: string, timestamp: number); static isDeviceOnline(e: DomainEvent): e is DeviceOnline; } class AudioStreamToggled extends CallEvent { static readonly tag = "audio_stream_toggled"; readonly userId: string; readonly enabled: boolean; constructor(callId: string, userId: string, enabled: boolean, timestamp: number); static isAudioStreamToggled(e: DomainEvent): e is AudioStreamToggled; } class VideoStreamToggled extends CallEvent { static readonly tag = "video_stream_toggled"; readonly userId: string; readonly enabled: boolean; readonly content?: VideoContentType; constructor(callId: string, userId: string, enabled: boolean, timestamp: number, contentType?: VideoContentType); static isVideoStreamToggled(e: DomainEvent): e is VideoStreamToggled; } }