UNPKG

swap-chat-react

Version:
21 lines (20 loc) 931 B
import React, { PropsWithChildren } from 'react'; import type { ChannelResponse, MessageResponse } from 'web2-mq'; export declare type MessageItem = MessageResponse; export declare type ChannelState = { messageList: MessageItem[] | null; threadList: MessageItem[] | null; allThreadList: MessageItem[] | null; message: MessageItem | null; replyMsgInfo: MessageItem | null; activeChannel: ChannelResponse | null; openAllThread: boolean; msgLoading: boolean; threadLoading: boolean; }; export declare type ChannelStateContextValue = ChannelState; export declare const ChannelStateContext: React.Context<ChannelState | undefined>; export declare const ChannelStateProvider: ({ children, value, }: React.PropsWithChildren<{ value: ChannelStateContextValue; }>) => JSX.Element; export declare const useChannelStateContext: (componentName?: string | undefined) => ChannelState;