import * as react_jsx_runtime from 'react/jsx-runtime'; import React$1 from 'react'; type ResponseMode = 'feedback' | 'vote' | 'poll' | 'feature-request' | 'ab'; type VoteType = 'up' | 'down'; interface GotchaUser { id?: string; [key: string]: string | number | boolean | null | undefined; } type Position = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'inline'; type Size = 'sm' | 'md' | 'lg'; type Theme = 'light' | 'dark' | 'auto' | 'custom'; type TouchBehavior = 'always-visible' | 'tap-to-reveal'; interface GotchaStyles { button?: React.CSSProperties; modal?: React.CSSProperties; input?: React.CSSProperties; submitButton?: React.CSSProperties; } interface SubmitResponsePayload { elementId: string; mode: ResponseMode; content?: string; title?: string; rating?: number; vote?: VoteType; pollOptions?: string[]; pollSelected?: string[]; experimentId?: string; variant?: string; user?: GotchaUser; context?: { url?: string; userAgent?: string; }; } interface GotchaResponse { id: string; status: 'created' | 'duplicate' | 'updated'; createdAt: string; results?: PollResults; } interface ExistingResponse { id: string; mode: ResponseMode; content?: string | null; title?: string | null; rating?: number | null; vote?: VoteType | null; pollOptions?: string[] | null; pollSelected?: string[] | null; createdAt: string; } interface PollResults { [option: string]: number; } interface GotchaError { code: ErrorCode; message: string; status: number; } type ErrorCode = 'INVALID_API_KEY' | 'ORIGIN_NOT_ALLOWED' | 'RATE_LIMITED' | 'QUOTA_EXCEEDED' | 'INVALID_REQUEST' | 'USER_NOT_FOUND' | 'INTERNAL_ERROR'; interface GotchaProviderProps { /** Your Gotcha API key */ apiKey: string; /** React children */ children: React$1.ReactNode; /** Override the API base URL (for testing/staging) */ baseUrl?: string; /** Enable debug logging */ debug?: boolean; /** Disable all Gotcha buttons globally */ disabled?: boolean; /** Default user metadata applied to all submissions */ defaultUser?: GotchaUser; } declare function GotchaProvider({ apiKey, children, baseUrl, debug, disabled, defaultUser, }: GotchaProviderProps): react_jsx_runtime.JSX.Element; interface GotchaProps { /** Unique identifier for this element */ elementId: string; /** User metadata for segmentation */ user?: GotchaUser; /** Feedback mode */ mode?: ResponseMode; /** Required if mode is 'ab' */ experimentId?: string; /** Current A/B variant shown to user */ variant?: string; /** Custom labels for vote buttons (default: Like/Dislike) */ voteLabels?: { up: string; down: string; }; /** Required if mode is 'poll' (2-6 options) */ options?: string[]; /** Allow selecting multiple options */ allowMultiple?: boolean; /** Show results after voting */ showResults?: boolean; /** Button position relative to parent */ position?: Position; /** Button size */ size?: Size; /** Color theme */ theme?: Theme; /** Custom style overrides */ customStyles?: GotchaStyles; /** Control visibility programmatically */ visible?: boolean; /** Only show when parent is hovered (default: true) */ showOnHover?: boolean; /** Mobile behavior (default: 'always-visible') */ touchBehavior?: TouchBehavior; /** Custom prompt text */ promptText?: string; /** Input placeholder text */ placeholder?: string; /** Submit button text */ submitText?: string; /** Post-submission message */ thankYouMessage?: string; /** Called after successful submission */ onSubmit?: (response: GotchaResponse) => void; /** Called when modal opens */ onOpen?: () => void; /** Called when modal closes */ onClose?: () => void; /** Called on error */ onError?: (error: GotchaError) => void; } declare function Gotcha({ elementId, user, mode, experimentId, variant, voteLabels, options, allowMultiple, showResults, position, size, theme, customStyles, visible, showOnHover, touchBehavior, promptText, placeholder, submitText, thankYouMessage, onSubmit, onOpen, onClose, onError, }: GotchaProps): react_jsx_runtime.JSX.Element | null; /** * Hook to access Gotcha context * Must be used within a GotchaProvider */ declare function useGotcha(): { /** The API client for manual submissions */ client: { submitResponse(payload: Omit): Promise; checkExistingResponse(elementId: string, userId: string): Promise; updateResponse(id: string, payload: { content?: string; title?: string; rating?: number; vote?: VoteType; pollSelected?: string[]; }, userId?: string): Promise; getBaseUrl(): string; }; /** Whether Gotcha is globally disabled */ disabled: boolean; /** Default user metadata */ defaultUser: GotchaUser; /** Whether debug mode is enabled */ debug: boolean; /** Submit feedback programmatically */ submitFeedback: (payload: Omit) => Promise; }; export { Gotcha, type GotchaError, type GotchaProps, GotchaProvider, type GotchaProviderProps, type GotchaResponse, type GotchaStyles, type GotchaUser, type Position, type ResponseMode, type Size, type Theme, type TouchBehavior, type VoteType, useGotcha };