stream-chat-react
Version:
React components to create chat conversations or livestream style chat
20 lines (19 loc) • 956 B
TypeScript
import React from 'react';
import type { PropsWithChildren } from 'react';
import type { RenderedMessage } from '../components';
export type MessageListContextValue = {
/** Enriched message list, including date separators and intro message (if enabled) */
processedMessages: RenderedMessage[];
/** The scroll container within which the messages and typing indicator are rendered */
listElement: HTMLDivElement | null;
/** Function that scrolls the `listElement` to the bottom. */
scrollToBottom: () => void;
};
export declare const MessageListContext: React.Context<MessageListContextValue | undefined>;
/**
* Context provider for components rendered within the `MessageList`
*/
export declare const MessageListContextProvider: ({ children, value, }: PropsWithChildren<{
value: MessageListContextValue;
}>) => React.JSX.Element;
export declare const useMessageListContext: (componentName?: string) => MessageListContextValue;