You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
707 B

export type TechtelUser = {
name: string
publicKey: Uint8Array
}
export type TechtelRoom = {
roomKey: Uint8Array
name: string
members: TechtelUser[]
}
type TechtelEventType = 'message' | 'membership' | 'invite' | 'inviteResponse'
type TechtelMessageEventData = {
message: string
}
type TechtelMembershipEventData = {
user: string
action: 'join' | 'leave'
}
type TechtelInviteData = {
roomName: string
}
type TechtelInviteResponseData = {
roomName: string
accepted: boolean
}
export type TechtelEvent = {
emitter: TechtelUser
type: TechtelEventType
room: TechtelRoom
data:
| TechtelMessageEventData
| TechtelMembershipEventData
| TechtelInviteData
| TechtelInviteResponseData
}