import { ReactNode } from 'react'; import { Beat } from '../core'; import { DismissType } from './components/DismissInsightDialog'; import { FeedbackDialogCloseReason } from './components/FeedbackDialog'; export type InsightMenuAction = 'helpful' | 'not_helpful' | 'hide'; export type InsightRating = 'helpful' | 'not_helpful'; export interface MenuActionHandlers { onAction: (action: InsightMenuAction) => void; onOpen?: () => void; disabled?: boolean; } export interface UpdateParams { beatGuid: string; } export interface FeedbackParams { beatGuid: string; source: InsightRating | 'hide' | 'cta'; option: string; detail?: string; } export interface DismissParams { beatGuid: string; type: DismissType; } export interface AnalyticsEventPayload { action?: string; category?: string; label?: string; postHog?: { eventName: string; properties?: Record; }; } /** A host-side CTA effect. See ctaActions/README.md. */ export interface CtaActionParams { beatGuid: string; name: string; params?: Record; } /** Host callbacks for a beat card. */ export interface BeatActions { onMenuAction?: MenuActionHandlers; onUpdate?: (params: UpdateParams) => void; onSubmitFeedback?: (params: FeedbackParams) => void | Promise; onDismissInsight?: (params: DismissParams) => void; onUndoDismiss?: (params: { beatGuid: string; }) => void; onFeedbackDialogClose?: (reason: FeedbackDialogCloseReason) => void; onFeedbackDialogBack?: () => void; onFeedbackTextFocus?: () => void; onAnalyticsEvent?: (payload: AnalyticsEventPayload) => void; onContactSupport?: () => void; onCtaAction?: (params: CtaActionParams) => Promise | void; } interface BeatActionsContextValue extends BeatActions { beat?: Beat; } export declare const BeatActionsProvider: ({ value, children, }: { value: BeatActionsContextValue; children: ReactNode; }) => import("react/jsx-runtime").JSX.Element; export declare const useBeatActions: () => BeatActionsContextValue; export {};