From 714042e9f779451807c455ca5a3e4b7e16aaa9df Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 20 Dec 2024 13:36:33 -0300 Subject: [PATCH] `isRoomCreateEvent` --- packages/core/src/events/m.room.create.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/events/m.room.create.ts b/packages/core/src/events/m.room.create.ts index c969ceb3..99032a9e 100644 --- a/packages/core/src/events/m.room.create.ts +++ b/packages/core/src/events/m.room.create.ts @@ -1,7 +1,7 @@ import { createEventBase, type EventBase } from "./eventBase"; import { createEventWithId } from "./utils/createSignedEvent"; -interface RoomCreateEvent extends EventBase { +export interface RoomCreateEvent extends EventBase { content: { room_version: string; creator: string; @@ -43,3 +43,6 @@ export const roomCreateEvent = ({ }); export const createRoomCreateEvent = createEventWithId(roomCreateEvent); + +export const isRoomCreateEvent = (event: EventBase): event is RoomCreateEvent => + event.type === "m.room.create";