import * as react_jsx_runtime from 'react/jsx-runtime'; import React$1 from 'react'; type ResponseMode = 'feedback' | 'vote' | 'poll' | 'nps'; 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; title?: React.CSSProperties; closeButton?: React.CSSProperties; starRating?: React.CSSProperties; star?: React.CSSProperties; voteButton?: React.CSSProperties; voteButtonSelected?: React.CSSProperties; pollOption?: React.CSSProperties; pollOptionSelected?: React.CSSProperties; npsButton?: React.CSSProperties; npsButtonSelected?: React.CSSProperties; npsLabels?: React.CSSProperties; successMessage?: React.CSSProperties; successIcon?: React.CSSProperties; errorMessage?: React.CSSProperties; bugFlag?: React.CSSProperties; backdrop?: React.CSSProperties; spinner?: React.CSSProperties; } interface SubmitResponsePayload { elementId: string; mode: ResponseMode; content?: string; title?: string; rating?: number; vote?: VoteType; pollOptions?: string[]; pollSelected?: string[]; isBug?: boolean; 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' | 'PARSE_ERROR'; interface ScoreData { elementId: string; averageRating: number | null; totalResponses: number; ratingCount: number; voteCount: { up: number; down: number; }; positiveRate: number | null; npsScore: number | null; } interface GotchaThemeColors { primary: string; primaryHover: string; primaryText: string; background: string; backgroundGradient: string; surface: string; surfaceHover: string; text: string; textSecondary: string; textDisabled: string; border: string; borderFocus: string; success: string; successSurface: string; error: string; errorSurface: string; errorBorder: string; warning: string; warningActive: string; warningSurface: string; warningBorder: string; starFilled: string; starEmpty: string; voteUp: string; voteUpSurface: string; voteUpBorder: string; voteDown: string; voteDownSurface: string; voteDownBorder: string; npsColors: string[]; buttonBackground: string; buttonBackgroundHover: string; buttonBackgroundDisabled: string; buttonColor: string; buttonColorDisabled: string; buttonBorder: string; buttonShadow: string; backdropColor: string; closeButton: string; closeButtonHover: string; closeButtonBg: string; glassBackground: string; glassBorder: string; glassColor: string; glassShadow: string; glassHoverShadow: string; inputBackground: string; inputBackgroundFocus: string; inputBorder: string; inputBorderFocus: string; inputFocusRing: string; pollBorder: string; pollSelectedBorder: string; pollBackground: string; pollSelectedBackground: string; pollColor: string; pollSelectedColor: string; pollCheckBorder: string; pollCheckSelectedBorder: string; pollCheckSelectedBg: string; } interface GotchaThemeTypography { fontFamily: string; fontSize: { xs: number; sm: number; md: number; lg: number; }; fontWeight: { normal: number; medium: number; semibold: number; bold: number; }; } interface GotchaThemeBorders { radius: { sm: number; md: number; lg: number; full: string; }; width: number; } interface GotchaThemeShadows { sm: string; md: string; lg: string; modal: string; button: string; } interface GotchaThemeAnimation { duration: { fast: string; normal: string; slow: string; }; easing: { default: string; spring: string; }; } interface GotchaThemeConfig { colors?: Partial; typography?: Partial; borders?: Partial; shadows?: Partial; animation?: Partial; } /** Create a custom theme by merging partial overrides onto a preset */ declare function createTheme(base: 'light' | 'dark', overrides: GotchaThemeConfig): GotchaThemeConfig; 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; /** Theme configuration overrides applied to all instances */ themeConfig?: GotchaThemeConfig; } declare function GotchaProvider({ apiKey, children, baseUrl, debug, disabled, defaultUser, themeConfig, }: 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; /** Show the text input in feedback mode (default: true) */ showText?: boolean; /** Show the star rating in feedback mode (default: true) */ showRating?: boolean; /** 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; /** Custom NPS question (default: "How likely are you to recommend us?") */ npsQuestion?: string; /** Show follow-up textarea after score selection (default: true) */ npsFollowUp?: boolean; /** Placeholder for NPS follow-up textarea */ npsFollowUpPlaceholder?: string; /** Label for low end of NPS scale (default: "Not likely") */ npsLowLabel?: string; /** Label for high end of NPS scale (default: "Very likely") */ npsHighLabel?: string; /** 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; /** Show "Report an issue" toggle in feedback form (default: false) */ enableBugFlag?: boolean; /** Custom label for the bug flag toggle (default: "Report an issue") */ bugFlagLabel?: string; /** When true and user has already responded, show submitted state and allow review/edit instead of new submission */ onePerUser?: boolean; /** Enable entrance animations on the button and modal (default: true) */ animated?: boolean; /** 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, showText, showRating, voteLabels, options, allowMultiple, npsQuestion, npsFollowUp, npsFollowUpPlaceholder, npsLowLabel, npsHighLabel, enableBugFlag, bugFlagLabel, onePerUser, animated, position, size, theme, customStyles, visible, showOnHover, touchBehavior, promptText, placeholder, submitText, thankYouMessage, onSubmit, onOpen, onClose, onError, }: GotchaProps): react_jsx_runtime.JSX.Element | null; type ScoreVariant = 'stars' | 'number' | 'compact' | 'votes'; interface GotchaScoreProps { elementId: string; variant?: ScoreVariant; showCount?: boolean; size?: Size; theme?: Theme; refreshInterval?: number; style?: React$1.CSSProperties; } declare function GotchaScore({ elementId, variant, showCount, size, theme, refreshInterval, style, }: GotchaScoreProps): 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; getScore(elementId: string): Promise; flagAsBug(responseId: string): Promise<{ ticketId: string; status: string; }>; 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, GotchaScore, type GotchaScoreProps, type GotchaStyles, type GotchaThemeConfig, type GotchaUser, type Position, type ResponseMode, type ScoreData, type Size, type Theme, type TouchBehavior, type VoteType, createTheme, useGotcha };