UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

20 lines (19 loc) 1.16 kB
import React from 'react'; import type { ComponentType } from 'react'; import type { Options } from 'react-markdown/lib'; import type { UserResponse } from 'stream-chat'; import type { PluggableList } from 'unified'; import type { MentionProps } from './componentRenderers'; export type RenderTextPluginConfigurator = (defaultPlugins: PluggableList) => PluggableList; export declare const defaultAllowedTagNames: Array<keyof JSX.IntrinsicElements | 'emoji' | 'mention'>; export declare const markDownRenderers: RenderTextOptions['customMarkDownRenderers']; export type RenderTextOptions = { allowedTagNames?: Array<keyof JSX.IntrinsicElements | 'emoji' | 'mention' | (string & {})>; customMarkDownRenderers?: Options['components'] & Partial<{ emoji: ComponentType; mention: ComponentType<MentionProps>; }>; getRehypePlugins?: RenderTextPluginConfigurator; getRemarkPlugins?: RenderTextPluginConfigurator; }; export declare const renderText: (text?: string, mentionedUsers?: UserResponse[], { allowedTagNames, customMarkDownRenderers, getRehypePlugins, getRemarkPlugins, }?: RenderTextOptions) => React.JSX.Element | null;