Add an interface for events

This commit is contained in:
Danila Fedorin 2021-08-13 14:17:01 -07:00
parent 6c6991e622
commit 1f368dcec1

View File

@ -20,6 +20,19 @@ import { encodeUint32 } from "../utils";
import {KeyLimits} from "../../common";
import {Store} from "../Store";
type Content = { [key: string]: any }
interface RoomEvent {
content: Content
type: string
event_id: string
sender: string
origin_server_ts: number
unsigned?: Content
}
type StateEvent = RoomEvent & { prev_content?: Content, state_key: string }
interface Annotation {
count: number
me: boolean
@ -30,7 +43,7 @@ interface StorageEntry {
roomId: string
fragmentId: number
eventIndex: number
event: any
event: Event | StateEvent
displayName?: string
avatarUrl?: string
annotations?: { [key : string]: Annotation }