From 801e2b9f6c978c97141c40c78cfd24e38d80b50e Mon Sep 17 00:00:00 2001 From: Jaap Date: Mon, 27 Jan 2020 13:31:25 -0700 Subject: [PATCH 1/2] fix types for channel.sendReaction --- types/stream-chat/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/stream-chat/index.d.ts b/types/stream-chat/index.d.ts index 5d0b5a111..4e58eefbe 100644 --- a/types/stream-chat/index.d.ts +++ b/types/stream-chat/index.d.ts @@ -113,6 +113,9 @@ export interface Reaction { [propName: string]: any; } +export interface ReactionRequest { + type: string; +} export interface ReactionResponse extends Reaction { created_at: string; updated_at: string; @@ -311,7 +314,7 @@ export class Channel { sendEvent(chatEvent: Event): Promise>; sendReaction( messageID: string, - reaction: Reaction, + reaction: ReactionRequest, user_id?: string, ): Promise; getReactions(message_id: string, options: object): Promise; From 2e0452c039b57a2f3520dcbeab41b297f7100178 Mon Sep 17 00:00:00 2001 From: Jaap Date: Wed, 29 Jan 2020 07:17:42 -0700 Subject: [PATCH 2/2] updated Reaction interface for optional serverside requests --- types/stream-chat/index.d.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/types/stream-chat/index.d.ts b/types/stream-chat/index.d.ts index 4e58eefbe..bcb746a47 100644 --- a/types/stream-chat/index.d.ts +++ b/types/stream-chat/index.d.ts @@ -106,16 +106,13 @@ export interface ConnectionChangeEvent { export interface Reaction { type: string; - message_id: string; + message_id?: string; user_id?: string; - user: User; - score: number; + user?: User; + score?: number; [propName: string]: any; } -export interface ReactionRequest { - type: string; -} export interface ReactionResponse extends Reaction { created_at: string; updated_at: string; @@ -314,7 +311,7 @@ export class Channel { sendEvent(chatEvent: Event): Promise>; sendReaction( messageID: string, - reaction: ReactionRequest, + reaction: Reaction, user_id?: string, ): Promise; getReactions(message_id: string, options: object): Promise;