UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

45 lines 2.17 kB
import React from 'react'; import type { PropsWithChildren } from 'react'; import type { AppSettingsAPIResponse, Channel, Mute, SearchController } from 'stream-chat'; import type { ChatProps } from '../components/Chat/Chat'; import type { ChannelsQueryState } from '../components/Chat/hooks/useChannelsQueryState'; type CSSClasses = 'chat' | 'chatContainer' | 'channel' | 'channelList' | 'message' | 'messageList' | 'thread' | 'threadList' | 'virtualMessage' | 'virtualizedMessageList'; export type CustomClasses = Partial<Record<CSSClasses, string>>; type ChannelConfId = string; export type ChatContextValue = { /** * Indicates, whether a channels query has been triggered within ChannelList by its channels pagination controller. */ channelsQueryState: ChannelsQueryState; getAppSettings: () => Promise<AppSettingsAPIResponse> | null; latestMessageDatesByChannels: Record<ChannelConfId, Date>; mutes: Array<Mute>; /** Instance of SearchController class that allows to control all the search operations. */ searchController: SearchController; /** * Sets active channel to be rendered within Channel component. * @param newChannel * @param watchers * @param event */ setActiveChannel: (newChannel?: Channel, watchers?: { limit?: number; offset?: number; }, event?: React.BaseSyntheticEvent) => void; useImageFlagEmojisOnWindows: boolean; /** * Active channel used to render the contents of the Channel component. */ channel?: Channel; /** * Object through which custom classes can be set for main container components of the SDK. */ customClasses?: CustomClasses; } & Partial<Pick<ChatProps, 'isMessageAIGenerated'>> & Required<Pick<ChatProps, 'theme' | 'client'>>; export declare const ChatContext: React.Context<ChatContextValue | undefined>; export declare const ChatProvider: ({ children, value, }: PropsWithChildren<{ value: ChatContextValue; }>) => import("react/jsx-runtime").JSX.Element; export declare const useChatContext: (componentName?: string) => ChatContextValue; export {}; //# sourceMappingURL=ChatContext.d.ts.map