Skip to content

Commit 0ca83ab

Browse files
author
Sravan S
authored
fix: Add UIKitConfigTypes to type defn (#677)
Fixes: https://sendbird.atlassian.net/browse/CLNP-305
1 parent 70360f6 commit 0ca83ab

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

scripts/index_d_ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ declare module "SendbirdUIKitGlobal" {
77
import type React from 'react';
88
import type SendbirdChat from '@sendbird/chat';
99
import { GroupChannelModule, ModuleNamespaces, OpenChannelModule } from '@sendbird/chat/lib/__definition';
10+
import { SBUConfig } from '@sendbird/uikit-tools';
1011
import type {
1112
SendbirdError,
1213
SessionHandler,
@@ -43,6 +44,33 @@ declare module "SendbirdUIKitGlobal" {
4344
SendbirdOpenChat,
4445
} from '@sendbird/chat/openChannel';
4546

47+
export type PartialDeep<T> = T extends object
48+
? T extends (...args: any[]) => any
49+
? T
50+
: {
51+
[P in keyof T]?: PartialDeep<T[P]>;
52+
}
53+
: T;
54+
55+
export interface CommonUIKitConfigProps {
56+
replyType?: 'NONE' | 'QUOTE_REPLY' | 'THREAD';
57+
isMentionEnabled?: boolean;
58+
isReactionEnabled?: boolean;
59+
disableUserProfile?: boolean;
60+
isVoiceMessageEnabled?: boolean;
61+
isTypingIndicatorEnabledOnChannelList?: boolean;
62+
isMessageReceiptStatusEnabledOnChannelList?: boolean;
63+
showSearchIcon?: boolean;
64+
}
65+
66+
export type UIKitOptions = PartialDeep<{
67+
common: SBUConfig['common'];
68+
groupChannel: SBUConfig['groupChannel']['channel'];
69+
groupChannelList: SBUConfig['groupChannel']['channelList'];
70+
groupChannelSettings: SBUConfig['groupChannel']['setting'];
71+
openChannel: SBUConfig['openChannel']['channel'];
72+
}>;
73+
4674
export type ReplyType = "NONE" | "QUOTE_REPLY" | "THREAD";
4775
export interface AppProps {
4876
appId: string;
@@ -84,6 +112,7 @@ declare module "SendbirdUIKitGlobal" {
84112
isReactionEnabled?: boolean;
85113
isTypingIndicatorEnabledOnChannelList?: boolean;
86114
isMessageReceiptStatusEnabledOnChannelList?: boolean;
115+
uikitOptions?: UIKitOptions;
87116
}
88117

89118
export type Logger = {
@@ -262,6 +291,7 @@ declare module "SendbirdUIKitGlobal" {
262291
};
263292
isTypingIndicatorEnabledOnChannelList?: boolean;
264293
isMessageReceiptStatusEnabledOnChannelList?: boolean;
294+
uikitOptions?: UIKitOptions;
265295
}
266296

267297
export interface SendBirdStateConfig {
@@ -297,6 +327,18 @@ declare module "SendbirdUIKitGlobal" {
297327
isTypingIndicatorEnabledOnChannelList?: boolean;
298328
isMessageReceiptStatusEnabledOnChannelList?: boolean;
299329
replyType: ReplyType;
330+
showSearchIcon?: boolean;
331+
// Remote configs set from dashboard by UIKit feature configuration
332+
groupChannel: {
333+
enableOgtag: SBUConfig['groupChannel']['channel']['enableOgtag'];
334+
enableTypingIndicator: SBUConfig['groupChannel']['channel']['enableTypingIndicator'];
335+
enableDocument: SBUConfig['groupChannel']['channel']['input']['enableDocument'];
336+
threadReplySelectType: SBUConfig['groupChannel']['channel']['threadReplySelectType'];
337+
},
338+
openChannel: {
339+
enableOgtag: SBUConfig['openChannel']['channel']['enableOgtag'];
340+
enableDocument: SBUConfig['openChannel']['channel']['input']['enableDocument'];
341+
},
300342
}
301343
export interface SdkStore {
302344
error: boolean;

0 commit comments

Comments
 (0)