import React, { PropsWithChildren } from 'react'; import type { APIErrorResponse, Attachment, ErrorFromResponse, Message, MessageResponse, UpdatedMessage, UpdateMessageAPIResponse, UserResponse } from 'open-chat-js'; import type { StreamMessage } from './ChannelStateContext'; import type { ChannelStateReducerAction } from '../components/Channel/channelState'; import type { CustomMentionHandler } from '../components/Message/hooks/useMentionsHandler'; import type { ChannelUnreadUiState, DefaultStreamChatGenerics, SendMessageOptions, UnknownType, UpdateMessageOptions } from '../types/types'; export type MarkReadWrapperOptions = { /** * Signal, whether the `channelUnreadUiState` should be updated. * By default, the local state update is prevented when the Channel component is mounted. * This is in order to keep the UI indicating the original unread state, when the user opens a channel. */ updateChannelUiUnreadState?: boolean; }; export type MessageAttachments = Array>; export type MessageToSend = { attachments?: MessageAttachments; error?: ErrorFromResponse; errorStatusCode?: number; id?: string; mentioned_users?: UserResponse[]; parent?: StreamMessage; parent_id?: string; status?: string; text?: string; }; export type RetrySendMessage = (message: StreamMessage) => Promise; export type ChannelActionContextValue = { addNotification: (text: string, type: 'success' | 'error') => void; closeThread: (event?: React.BaseSyntheticEvent) => void; deleteMessage: (message: StreamMessage) => Promise>; dispatch: React.Dispatch>; editMessage: (message: UpdatedMessage, options?: UpdateMessageOptions) => Promise | void>; jumpToFirstUnreadMessage: (queryMessageLimit?: number) => Promise; jumpToLatestMessage: () => Promise; jumpToMessage: (messageId: string, limit?: number) => Promise; loadMore: (limit?: number) => Promise; loadMoreNewer: (limit?: number) => Promise; loadMoreThread: () => Promise; markRead: (options?: MarkReadWrapperOptions) => void; onMentionsClick: CustomMentionHandler; onMentionsHover: CustomMentionHandler; openThread: (message: StreamMessage, event?: React.BaseSyntheticEvent) => void; removeMessage: (message: StreamMessage) => void; retrySendMessage: RetrySendMessage; sendMessage: (message: MessageToSend, customMessageData?: Partial>, options?: SendMessageOptions) => Promise; setChannelUnreadUiState: React.Dispatch>; setQuotedMessage: React.Dispatch | undefined>>; updateMessage: (message: StreamMessage) => void; }; export declare const ChannelActionContext: React.Context | undefined>; export declare const ChannelActionProvider: ({ children, value, }: React.PropsWithChildren<{ value: ChannelActionContextValue; }>) => React.JSX.Element; export declare const useChannelActionContext: (componentName?: string) => ChannelActionContextValue; /** * Typescript currently does not support partial inference, so if ChannelActionContext * typing is desired while using the HOC withChannelActionContext, the Props for the * wrapped component must be provided as the first generic. */ export declare const withChannelActionContext:

(Component: React.ComponentType

) => { (props: Omit>): React.JSX.Element; displayName: string; }; //# sourceMappingURL=ChannelActionContext.d.ts.map