UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

38 lines (37 loc) 1.4 kB
/// <reference types="node" /> /// <reference types="node" /> /// <reference types="node" /> /// <reference types="node" /> /// <reference types="node" /> import type { Dispatch, SetStateAction } from 'react'; import type { ChannelState, MessageResponse, StreamChat } from 'stream-chat'; import type { ChannelNotifications } from '../../context/ChannelStateContext'; export declare const makeAddNotifications: (setNotifications: Dispatch<SetStateAction<ChannelNotifications>>, notificationTimeouts: NodeJS.Timeout[]) => (text: string, type: 'success' | 'error') => void; /** * Utility function for jumpToFirstUnreadMessage * @param targetId * @param msgSet */ export declare const findInMsgSetById: (targetId: string, msgSet: ReturnType<ChannelState['formatMessage']>[]) => { index: number; target: import("stream-chat").LocalMessage; } | { index: number; target?: undefined; }; /** * Utility function for jumpToFirstUnreadMessage * @param targetDate * @param msgSet * @param exact */ export declare const findInMsgSetByDate: (targetDate: Date, msgSet: MessageResponse[] | ReturnType<ChannelState['formatMessage']>[], exact?: boolean) => { index: number; target: import("stream-chat").LocalMessage | MessageResponse; } | { index: number; target?: undefined; }; export declare const generateMessageId: ({ client }: { client: StreamChat; }) => string;