import type { ThreadContextType } from '@pantheon-systems/css-client'; export interface UsePostCommentOptions { contextType: ThreadContextType; contextId: string; /** The thread to add to. Absent starts one on the context. */ threadId?: string; } export interface PostCommentState { /** * Sends the comment and resolves to whether it landed. Absent where there is no * editor to send it through. */ post?: (body: string) => Promise; posting: boolean; failed: boolean; } /** * Posts a comment on one context and writes it back where it is already shown: the * thread it lands in goes into the page's loaded listing, so the trigger's count moves, * and the comment goes into the open thread, so it appears without another fetch. * * A comment on a resolved thread reopens it, so a known thread is always posted to * directly; only a context with no thread yet starts one. */ export declare function usePostComment({ contextType, contextId, threadId }: UsePostCommentOptions): PostCommentState;