import { InfiniteData, UseInfiniteQueryResult, UseQueryResult } from '@tanstack/react-query';
import { DataWithCursor, AgentChat } from '@multiplayer-app/ai-agent-types';

export declare const CHATS_PAGE_SIZE = 20;
export declare const chatKeys: {
    readonly all: readonly ["mp-agents", "chats"];
    readonly lists: () => readonly ["mp-agents", "chats", "list"];
    readonly list: (filters: Record<string, unknown>) => readonly ["mp-agents", "chats", "list", Record<string, unknown>];
    readonly infinites: () => readonly ["mp-agents", "chats", "infinite"];
    readonly infinite: (filters: Record<string, unknown>) => readonly ["mp-agents", "chats", "infinite", Record<string, unknown>];
    readonly detail: (id: string | undefined) => readonly ["mp-agents", "chats", "detail", string | undefined];
};
export type UseChatsInfiniteListResult = UseInfiniteQueryResult<InfiniteData<DataWithCursor<AgentChat>, unknown>, Error>;
export type UseChatsResult = UseChatsInfiniteListResult;
export interface UseChatsParams {
    pageSize?: number;
    sortField?: string;
    sortOrder?: 'asc' | 'desc';
    multiUser?: boolean;
    /** When false, query is disabled */
    enabled?: boolean;
}
export interface UseChatsListParams extends UseChatsParams {
    /** 1-based page number */
    page: number;
}
export type UseChatsListResult = UseQueryResult<DataWithCursor<AgentChat>, Error> & {
    page: number;
    pageSize: number;
    totalPages: number;
    total: number;
    hasNextPage: boolean;
    hasPreviousPage: boolean;
};
/** Flatten all pages from an infinite chats query into a single array. */
export declare const flattenInfiniteChats: (data: InfiniteData<DataWithCursor<AgentChat>, unknown> | undefined) => AgentChat[];
export declare const useChatsInfiniteList: (params?: UseChatsParams) => UseChatsInfiniteListResult;
export declare const useChats: (params?: UseChatsParams) => UseChatsInfiniteListResult;
export declare const useChatsList: (params: UseChatsListParams) => UseChatsListResult;
//# sourceMappingURL=useChats.d.ts.map