import type { ThreadOverview } from '@pantheon-systems/css-client'; import type { ThreadContextType } from './types.js'; import { type DocumentThreads } from './document-threads.js'; export interface DocumentThreadsState { /** Empty until the listing arrives, and for a page nobody has commented on. */ threads: DocumentThreads; /** False while the listing is still in flight, which an empty map alone doesn't tell you. */ loaded: boolean; /** The listing could not be read, so the threads are unknown rather than absent. */ failed: boolean; /** Ask for the listing again. */ retry: () => void; } /** * Loads the threads on the current page and keeps them for as long as it is open. * * Nothing is asked for until threads are on and a document is loaded. Switching * documents asks for the new page's threads; switching branches asks again for the * same page. Threads are not branch-scoped, so that second refetch is a cheap check * that nothing has drifted rather than a correctness need. */ export declare function useDocumentThreads(): DocumentThreadsState; /** * The thread already on one context, read from whatever the loader has fetched. * * Triggers are drawn in the block overlays, which a host may render without the * editor's providers around them, so this reads the cache directly and answers * "none" wherever there is nothing to read from. */ export declare function useThreadOverview(contextType: ThreadContextType, contextId: string): ThreadOverview | undefined;