import type { FunnelStepId } from '../runtime/funnel-runtime.js'; import type { FunnelUserAnswers } from '../sdk/userAnswers.js'; import type { FunnelNavigationOutcome } from '../runtime/funnel-step-lifecycle.js'; /** A single record of a completed step, stored in the user's history. */ export type StepCompletionRecord = { stepId: string; stepName: string; completedAt: string; choices: FunnelUserAnswers; }; export type FunnelUser = { id: string; name: string; email: string; attributes: FunnelUserAnswers; document?: Record; /** Ordered history of every step the user has completed. */ completedSteps?: StepCompletionRecord[]; }; export type EmailCaptureOptions = { lifecycleConsent?: { consentTextVersion: string; }; }; export type FunnelContextValue = { activeStepId: FunnelStepId; featureFlags: Record; isBuilder: boolean; isReturningSubscriber: boolean; goToStep: (stepId: string, outcome: FunnelNavigationOutcome) => void; goNext: () => void; goChoice: (choice: 'yes' | 'no', stepId?: string) => void; getChoiceTargets: (stepId?: string) => { yes?: FunnelStepId; no?: FunnelStepId; } | null; setAnswer: (key: K, value: FunnelUserAnswers[K]) => void; getAnswer: (key: K) => FunnelUserAnswers[K] | undefined; answers: FunnelUserAnswers; setAttribute: (key: string, value: unknown) => void; attributes: FunnelUserAnswers; user: FunnelUser; userBootstrapped: boolean; setUser: (user: FunnelUser) => void; submitEmailCapture: (email: string, options?: EmailCaptureOptions) => Promise; /** Manually record a step as completed (used by custom step components). */ completeStep: (stepId: string, choices?: Record) => void; /** Complete the active terminal step and emit the canonical funnel conversion once. */ completeFunnel: (stepId: string) => void; }; type FunnelProviderProps = { value: FunnelContextValue; children: React.ReactNode; }; export declare function FunnelProvider({ value, children }: FunnelProviderProps): import("react/jsx-runtime").JSX.Element; export declare function useFunnel(): FunnelContextValue; export declare function useOptionalFunnel(): FunnelContextValue | null; export {};