import { MutableRefObject, RefObject } from 'react'; import { AnalyticsMetadata, FunnelType, SubStepConfiguration } from '../interfaces'; export type FunnelState = 'default' | 'validating' | 'complete' | 'cancelled'; export interface FunnelContextValue { funnelInteractionId: string | undefined; funnelIdentifier?: AnalyticsMetadata['instanceIdentifier']; funnelErrorContext?: AnalyticsMetadata['errorContext']; funnelFlowType?: AnalyticsMetadata['flowType']; funnelType: FunnelType; funnelNameSelector: string; optionalStepNumbers: number[]; totalFunnelSteps: number; funnelSubmit: () => void; funnelCancel: () => void; setFunnelInteractionId: (funnelInteractionId: string) => void; submissionAttempt: number; funnelNextOrSubmitAttempt: () => void; funnelState: RefObject; errorCount: MutableRefObject; loadingButtonCount: MutableRefObject; latestFocusCleanupFunction: MutableRefObject void)>; isInFunnel: boolean; wizardCount: MutableRefObject; } export interface FunnelStepContextValue { stepIdentifier?: AnalyticsMetadata['instanceIdentifier']; stepErrorContext?: AnalyticsMetadata['errorContext']; stepNameSelector: string; stepNumber: number; funnelStepProps?: Record; subStepCount: MutableRefObject; isInStep: boolean; funnelInteractionId: string | undefined; /** This function is called when the list of substeps in this step changes. */ onStepChange: () => void; subStepConfiguration: MutableRefObject | undefined>; } export interface FunnelSubStepContextValue { subStepIdentifier?: AnalyticsMetadata['instanceIdentifier']; subStepErrorContext?: AnalyticsMetadata['errorContext']; subStepId: string; subStepSelector: string; subStepNameSelector: string; subStepRef: MutableRefObject; mousePressed: MutableRefObject; /** * `isFocusedSubStep` is almost the same as checking if document.activeElement * is a child of the curren substep. However, `isFocusedSubStep` stays true * while the mouse button is pressed down, even though some browsers move the focus * to the body element during that time. */ isFocusedSubStep: MutableRefObject; /** * The focus cleanup function should be run when the user leaves the substep. */ focusCleanupFunction: MutableRefObject void)>; isNestedSubStep: boolean; funnelSubStepProps?: Record; } export declare const FunnelContext: import("react").Context; export declare const FunnelStepContext: import("react").Context; export declare const FunnelSubStepContext: import("react").Context; export declare const FunnelNameSelectorContext: import("react").Context;