export type MessageFeedbackRating = 'positive' | 'negative'; export type MessageFeedbackSubmitResult = { ok: true; } | { ok: false; message?: string; }; export type MessageFeedbackConfig = { /** Reason chips offered on a positive vote. Empty or omitted: 👍 submits directly. */ positiveReasons?: readonly string[]; /** Reason chips offered on a negative vote. */ negativeReasons?: readonly string[]; /** Require a justification on a negative vote: at least one reason chip when negativeReasons are configured, otherwise a non-empty comment. */ requireReason?: boolean; /** * Persists a vote. While this promise is pending the form remains open and * disabled; it closes only after `{ ok: true }`. On failure, return a safe * user-facing message and the draft remains available for retry. */ submit?: MessageFeedbackSubmitHandler; }; export type MessageFeedbackPayload = { conversationId: string; messageId: string; rating: MessageFeedbackRating; reasons: string[]; comment: string; }; export type MessageFeedbackHandler = (payload: MessageFeedbackPayload) => void; export type MessageFeedbackSubmitHandler = (payload: MessageFeedbackPayload) => Promise; export declare function dispatchMessageFeedback(payload: MessageFeedbackPayload, submit: MessageFeedbackSubmitHandler | undefined, emit: MessageFeedbackHandler): Promise; export declare function provideMessageFeedback(handler: MessageFeedbackHandler): void; export declare function useMessageFeedback(): { emit(payload: MessageFeedbackPayload): void; };