From eb677af1e69b03ecddf9db470c0c7aebb700baf0 Mon Sep 17 00:00:00 2001 From: JamieS1211 Date: Sat, 22 Feb 2020 00:09:41 +0000 Subject: [PATCH] Update types to allow discriminated union --- SendBird.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SendBird.d.ts b/SendBird.d.ts index b76755d..787f91c 100644 --- a/SendBird.d.ts +++ b/SendBird.d.ts @@ -284,7 +284,6 @@ declare namespace SendBird { channelUrl: string; channelType: string; messageId: number; - messageType: string; data: string; customType: string; metaArrays: Array; @@ -310,6 +309,7 @@ declare namespace SendBird { } interface AdminMessage extends BaseMessageInstance { + messageType: "admin"; message: string; translations: Object; } @@ -337,6 +337,7 @@ declare namespace SendBird { pushNotificationDeliveryOption: "default" | "suppress"; } interface UserMessage extends BaseMessageInstance { + messageType: "user"; message: string; sender: Sender; reqId: string; @@ -367,6 +368,7 @@ declare namespace SendBird { pushNotificationDeliveryOption: "default" | "suppress"; } interface FileMessage extends BaseMessageInstance { + messageType: "file"; sender: Sender; reqId: string; url: string;