import { type QueryClient } from '@tanstack/react-query'; export type QueueState = { currentMessageId: string | null; queuedMessages: Array<{ messageId: string; position: number; }>; queueLength: number; isRunning: boolean; }; export declare function getQueueStateQueryKey(sessionId: string | undefined): readonly ["project", string, "queueState", string]; export declare function normalizeQueueState(state: { currentMessageId: string | null; queuedMessages: Array<{ messageId: string; position: number; }>; isRunning?: boolean; }): QueueState; /** * Adds a message id to a cached queue state under an explicit query key. * Used by the stream engine, which captures its query keys at start so * background engines keep writing to the right project scope. */ export declare function queueMessageIdInCache(queryClient: QueryClient, queryKey: readonly unknown[], messageId: string): void; export declare function optimisticallyQueueMessage(queryClient: QueryClient, sessionId: string, messageId: string): void; /** Removes a message id from the cached queue state and re-indexes positions. */ export declare function removeQueuedMessageFromCache(queryClient: QueryClient, sessionId: string, messageId: string): void; /** * Swaps an optimistic queue entry for the server-assigned message id once the * send request resolves. Drops the optimistic entry when the real id is * already present (queue.updated arrived first). */ export declare function replaceQueuedMessageIdInCache(queryClient: QueryClient, sessionId: string, fromMessageId: string, toMessageId: string): void; export declare function useQueueState(sessionId: string | undefined): QueueState; export declare function useMessageQueuePosition(sessionId: string | undefined, messageId: string): { isQueued: boolean; isRunning: boolean; position: number | null; }; //# sourceMappingURL=useQueueState.d.ts.map