Skip to content

Commit da699d1

Browse files
author
Maciej Siwek
committed
fix context provider hoc typings
1 parent 7b5864e commit da699d1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

types/index.d.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import * as SeamlessImmutable from 'seamless-immutable';
1212
//
1313
//================================================================================================
1414
//================================================================================================
15-
declare function withChatContext(): React.FC;
15+
declare function withChatContext<T>(
16+
OriginalComponent: React.ElementType<T>,
17+
): React.ElementType<T>;
1618
export interface ChatContext extends React.Context<ChatContextValue> {}
1719
export interface ChatContextValue {
1820
client?: Client.StreamChat;
@@ -25,7 +27,9 @@ export interface ChatContextValue {
2527
connectionRecovering?: boolean;
2628
}
2729

28-
declare function withSuggestionsContext(): React.FC;
30+
declare function withSuggestionsContext<T>(
31+
OriginalComponent: React.ElementType<T>,
32+
): React.ElementType<T>;
2933
export interface SuggestionsContext
3034
extends React.Context<SuggestionsContextValue> {}
3135
export interface SuggestionsContextValue {
@@ -47,7 +51,9 @@ export interface SuggestionsContextValue {
4751
updateSuggestions?(suggestions: Array<object>): void;
4852
}
4953

50-
declare function withChannelContext(): React.FC;
54+
declare function withChannelContext<T>(
55+
OriginalComponent: React.ElementType<T>,
56+
): React.ElementType<T>;
5157
export interface ChannelContext extends React.Context<ChannelContextValue> {}
5258
export interface ChannelContextValue {
5359
Message?: React.ElementType<MessageUIComponentProps>;

0 commit comments

Comments
 (0)