@@ -30,7 +30,7 @@ interface Props extends UIKitFeaturesInSendbirdChatContext, React.PropsWithChild
30
30
imageCompressionConfig : ImageCompressionConfig ;
31
31
}
32
32
33
- type Context = {
33
+ export type SendbirdChatContextType = {
34
34
sdk : SendbirdChatSDK ;
35
35
emojiManager : EmojiManager ;
36
36
mentionManager : MentionManager ;
@@ -59,7 +59,7 @@ type Context = {
59
59
} ;
60
60
} ;
61
61
62
- export const SendbirdChatContext = React . createContext < Context | null > ( null ) ;
62
+ export const SendbirdChatContext = React . createContext < SendbirdChatContextType | null > ( null ) ;
63
63
export const SendbirdChatProvider = ( {
64
64
children,
65
65
sdkInstance,
@@ -77,13 +77,13 @@ export const SendbirdChatProvider = ({
77
77
const forceUpdate = useForceUpdate ( ) ;
78
78
const appFeatures = useAppFeatures ( sdkInstance ) ;
79
79
80
- const setCurrentUser : Context [ 'setCurrentUser' ] = useCallback ( ( user ) => {
80
+ const setCurrentUser : SendbirdChatContextType [ 'setCurrentUser' ] = useCallback ( ( user ) => {
81
81
// NOTE: Sendbird SDK handle User object is always same object, so force update after setCurrentUser
82
82
_setCurrentUser ( user ) ;
83
83
forceUpdate ( ) ;
84
84
} , [ ] ) ;
85
85
86
- const updateCurrentUserInfo : Context [ 'updateCurrentUserInfo' ] = useCallback (
86
+ const updateCurrentUserInfo : SendbirdChatContextType [ 'updateCurrentUserInfo' ] = useCallback (
87
87
async ( nickname , profile ) => {
88
88
let user = currentUser ;
89
89
@@ -115,7 +115,7 @@ export const SendbirdChatProvider = ({
115
115
[ sdkInstance , currentUser , setCurrentUser ] ,
116
116
) ;
117
117
118
- const markAsDeliveredWithChannel : Context [ 'markAsDeliveredWithChannel' ] = useCallback (
118
+ const markAsDeliveredWithChannel : SendbirdChatContextType [ 'markAsDeliveredWithChannel' ] = useCallback (
119
119
( channel : SendbirdGroupChannel ) => {
120
120
if ( appFeatures . deliveryReceiptEnabled ) confirmAndMarkAsDelivered ( [ channel ] ) ;
121
121
} ,
@@ -128,7 +128,7 @@ export const SendbirdChatProvider = ({
128
128
else if ( status === 'background' ) sdkInstance . connectionState === 'OPEN' && sdkInstance . setBackgroundState ( ) ;
129
129
} ) ;
130
130
131
- const value : Context = {
131
+ const value : SendbirdChatContextType = {
132
132
sdk : sdkInstance ,
133
133
emojiManager,
134
134
mentionManager,
0 commit comments