-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: replace StreamChatGenerics with module augmentation #2634
Changes from all commits
263abdd
42627ac
2c8d692
dcb3da0
edad023
5397399
32715dd
af896ef
1731718
21e9925
5fb880a
2ef3bfe
9500f99
239997c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,35 +40,10 @@ const filters: ChannelFilters = { | |
const options: ChannelOptions = { limit: 5, presence: true, state: true }; | ||
const sort: ChannelSort = { pinned_at: 1, last_message_at: -1, updated_at: -1 }; | ||
|
||
type LocalAttachmentType = Record<string, unknown>; | ||
type LocalChannelType = Record<string, unknown>; | ||
type LocalCommandType = string; | ||
type LocalEventType = Record<string, unknown>; | ||
type LocalMemberType = Record<string, unknown>; | ||
type LocalMessageType = Record<string, unknown>; | ||
type LocalPollOptionType = Record<string, unknown>; | ||
type LocalPollType = Record<string, unknown>; | ||
type LocalReactionType = Record<string, unknown>; | ||
type LocalUserType = Record<string, unknown>; | ||
|
||
type StreamChatGenerics = { | ||
attachmentType: LocalAttachmentType; | ||
channelType: LocalChannelType; | ||
commandType: LocalCommandType; | ||
eventType: LocalEventType; | ||
memberType: LocalMemberType; | ||
messageType: LocalMessageType; | ||
pollOptionType: LocalPollOptionType; | ||
pollType: LocalPollType; | ||
reactionType: LocalReactionType; | ||
userType: LocalUserType; | ||
}; | ||
|
||
const isMessageAIGenerated = (message: StreamMessage<StreamChatGenerics>) => | ||
!!message?.ai_generated; | ||
const isMessageAIGenerated = (message: StreamMessage) => !!message?.ai_generated; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, perhaps the |
||
|
||
const App = () => { | ||
const chatClient = useCreateChatClient<StreamChatGenerics>({ | ||
const chatClient = useCreateChatClient({ | ||
apiKey, | ||
tokenOrProvider: userToken, | ||
userData: { id: userId }, | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import 'stream-chat'; | ||
|
||
declare module 'stream-chat' { | ||
interface CustomChannelData { | ||
image?: string; | ||
name?: string; | ||
subtitle?: string; | ||
} | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've yet to see a more beautiful sight than this :D