From 1f368dcec1bfead2acd414c20369d138778af76f Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 13 Aug 2021 14:17:01 -0700 Subject: [PATCH] Add an interface for events --- .../storage/idb/stores/TimelineEventStore.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/matrix/storage/idb/stores/TimelineEventStore.ts b/src/matrix/storage/idb/stores/TimelineEventStore.ts index 41ccdc1b..d05fa6cb 100644 --- a/src/matrix/storage/idb/stores/TimelineEventStore.ts +++ b/src/matrix/storage/idb/stores/TimelineEventStore.ts @@ -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 }