import { type Comment } from '@pantheon-systems/css-client'; export interface ThreadCommentsState { /** * Oldest first. Empty until the thread arrives. An agent the latest comment mentions * is shown as working until it speaks for itself, or as failed once it has taken too * long to start. */ comments: readonly Comment[]; /** The thread is being asked for and nothing has come back yet. */ loading: boolean; /** The thread could not be read, so the comments are unknown rather than absent. */ failed: boolean; /** Ask for the thread again. */ retry: () => void; } /** * Whether the thread is waiting on an agent: one has said it is working, or the latest * comment mentions one and nothing has come back yet. Nothing pushes changes into the * canvas, so while this holds the thread is asked for again on a short clock. Both * conditions run out, so a turn that never finished does not keep the thread polling. */ export declare function awaitingAgent(comments: readonly Comment[], now: number): boolean; /** * Loads one thread's comments while the reader has it open. * * Nothing is asked for without a thread id, so a context nobody has commented on costs * no request, and a host can pass `undefined` to stand down while the view is closed. * Like the triggers, this may be mounted outside the editor's providers, so it reads the * query cache directly and answers "nothing" wherever there is nothing to read from. */ export declare function useThreadComments(threadId: string | undefined): ThreadCommentsState;