Add an interface for events
This commit is contained in:
parent
6c6991e622
commit
1f368dcec1
1 changed files with 14 additions and 1 deletions
|
@ -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 }
|
||||
|
|
Reference in a new issue