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 {KeyLimits} from "../../common";
import {Store} from "../Store"; 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 { interface Annotation {
count: number count: number
me: boolean me: boolean
@ -30,7 +43,7 @@ interface StorageEntry {
roomId: string roomId: string
fragmentId: number fragmentId: number
eventIndex: number eventIndex: number
event: any event: Event | StateEvent
displayName?: string displayName?: string
avatarUrl?: string avatarUrl?: string
annotations?: { [key : string]: Annotation } annotations?: { [key : string]: Annotation }