import { ChatMessage } from "../../../interfaces/models/ChatMessage"; import { MessageFilters } from "./useFetchManyChatMessages"; import { SpaceReputationContextParams } from "../../../interfaces/SpaceReputation"; export interface UseFetchManyChatMessagesWrapperProps extends SpaceReputationContextParams { conversationId: string; /** Restrict to replies of this message (thread view). */ parentId?: string | null; /** Page size. Defaults to `50`. */ limit?: number; /** * Sort direction by creation time. Defaults to `"desc"` (newest first); * `loadMore` then fetches older messages. With `"asc"`, `loadMore` fetches * newer messages. */ sort?: "asc" | "desc"; /** When `true`, the server populates the `files` field on each message. */ includeFiles?: boolean; filters?: MessageFilters; } export interface UseFetchManyChatMessagesWrapperValues { messages: ChatMessage[]; loading: boolean; hasMore: boolean; loadMore: () => void; /** Re-fetch the first page from scratch (e.g. to pick up new matches). */ refetch: () => void; } /** * Batteries-included, self-contained list of conversation messages with * cursor pagination — keeps results in local component state, NOT Redux, and * does NOT subscribe to socket updates. Use this for read-only / filtered * queries (e.g. "messages that have replies"). For the live canonical * conversation stream, use `useLiveChatMessages` instead. */ declare function useFetchManyChatMessagesWrapper(props: UseFetchManyChatMessagesWrapperProps): UseFetchManyChatMessagesWrapperValues; export default useFetchManyChatMessagesWrapper;