import { ChatMessage } from "../../../interfaces/models/ChatMessage"; import { SpaceReputationContextParams } from "../../../interfaces/SpaceReputation"; export interface MessageFilters { /** * Filter to messages that have thread replies (not quotings). `true` returns * only messages with at least one thread reply; `false` returns only messages * with none. Omit for no reply-count filtering. */ hasReplies?: boolean; } export interface FetchManyChatMessagesProps extends SpaceReputationContextParams { conversationId: string; /** Restrict to replies of this message (thread view). */ parentId?: string | null; /** Keyset cursor (ISO timestamp): messages created before this. Mutually exclusive with `after`. */ before?: string | null; /** Keyset cursor (ISO timestamp): messages created after this. Mutually exclusive with `before`. */ after?: string | null; /** Page size (1–100, defaults to 50 server-side). */ limit?: number; sort?: "asc" | "desc"; /** When `true`, the server populates the `files` field on each message. */ includeFiles?: boolean; filters?: MessageFilters; } export interface FetchManyChatMessagesResponse { messages: ChatMessage[]; hasMore: boolean; oldestCreatedAt: string | null; newestCreatedAt: string | null; /** * Present only when a filter combination can't return results — e.g. * `hasReplies: true` together with `parentId` (thread replies are one level * deep and never have their own replies). */ notice?: string; } /** * Low-level, stateless fetcher for conversation messages. Returns a promise of * a single page — no Redux, no socket subscription. This is the single owner of * the messages endpoint URL and its query params; both the live store hook * (`useLiveChatMessages`) and the query hook (`useFetchManyChatMessagesWrapper`) * build on it. */ declare function useFetchManyChatMessages(): (props: FetchManyChatMessagesProps) => Promise; export default useFetchManyChatMessages;