stream-chat-react
Version:
React components to create chat conversations or livestream style chat
38 lines (37 loc) • 2 kB
TypeScript
import React from 'react';
import { SearchController } from 'stream-chat';
import type { PropsWithChildren } from 'react';
import type { StreamChat } from 'stream-chat';
import type { CustomClasses } from '../../context/ChatContext';
import { type MessageContextValue } from '../../context';
import type { SupportedTranslations } from '../../i18n/types';
import type { Streami18n } from '../../i18n/Streami18n';
export type ChatProps = {
/** The StreamChat client object */
client: StreamChat;
/** Object containing custom CSS classnames to override the library's default container CSS */
customClasses?: CustomClasses;
/** Sets the default fallback language for UI component translation, defaults to 'en' for English */
defaultLanguage?: SupportedTranslations;
/** Instance of Stream i18n */
i18nInstance?: Streami18n;
/** Initial status of mobile navigation */
initialNavOpen?: boolean;
/** Instance of SearchController class that allows to control all the search operations. */
searchController?: SearchController;
/** Used for injecting className/s to the Channel and ChannelList components */
theme?: string;
/**
* Windows 10 does not support country flag emojis out of the box. It chooses to render these emojis as characters instead. Stream
* Chat can override this behavior by loading a custom web font that will render images instead (PNGs or SVGs depending on the platform).
* Set this prop to true if you want to use these custom emojis for Windows users.
*
* Note: requires importing `stream-chat-react/css/v2/emoji-replacement.css` style sheet
*/
useImageFlagEmojisOnWindows?: boolean;
} & Partial<Pick<MessageContextValue, 'isMessageAIGenerated'>>;
/**
* Wrapper component for a StreamChat application. Chat needs to be placed around any other chat components
* as it provides the ChatContext.
*/
export declare const Chat: (props: PropsWithChildren<ChatProps>) => React.JSX.Element | null;