import { ClaimableSettlement, PreAuthSettlement } from '@fanfare-io/fanfare-sdk-core/experiences'; import { DrawDisplayState } from '@fanfare-io/fanfare-sdk-core/internals'; import { GrantedSelection, SelectionAvailability, SelectionChoice, SelectionDraft, SelectionOptions } from '@fanfare-io/fanfare-sdk-core/selections'; import { ReadableAtom } from 'nanostores'; import { SelectionCheckoutDetails } from '../../lib/selection-display'; import { OutcomeAction } from '../compositions/outcome-panel'; import { OutcomeReason } from '../module'; export interface DrawModuleProps { display$?: ReadableAtom; sequencePhase: "enterable" | "participating" | "settling" | "granted" | "ended"; loyaltyBiasEnabled?: boolean; canEnter: boolean; canLeave: boolean; /** Enter action handler; carries the entry pick on a selection-bearing draw. */ onEnter: (selection?: SelectionChoice) => Promise; onLeave: () => Promise; isEntering: boolean; isLeaving: boolean; countdownTo?: Date; grant?: string; expiresAt?: number | Date; checkoutUrl?: string; /** * Activating the checkout CTA. Receives the pick the grant settled on, with the catalogue * objects behind it, whenever the panel has loaded the catalogue that carries them. */ onCheckoutClick?: (details?: SelectionCheckoutDetails) => void | Promise; /** Set when `onCheckoutClick` consumes the details, so the CTA waits for a catalogue still loading. */ awaitCheckoutDetails?: boolean; /** Granted-state selection arm; drives the panel's pick, reveal and summary states. */ grantedSelection?: GrantedSelection; /** How the win settles; selects the granted confirm label and payment affordance. */ settlement?: ClaimableSettlement | PreAuthSettlement; /** The draw captures a product choice at entry, so the entry branch renders the picker. */ selectionRequired?: boolean; /** Bound by the widget against the journey; must be referentially stable. */ loadSelectionOptions?: () => Promise; /** The choice already recorded for this entry, shown while the consumer waits. */ recordedSelection?: SelectionChoice | null; /** Live availability of the recorded pick, so a sold-out choice is said rather than discovered. */ selectionAvailability?: SelectionAvailability; /** Submits a changed choice while waiting. */ onSelectionChange?: (choice: SelectionChoice) => Promise; /** Submits the granted pick or re-pick. */ onSelect?: (choice: SelectionChoice) => Promise; /** Every local pick-surface transition, product-only drafts included; feeds the page-bridge event. */ onDraftChange?: (draft: SelectionDraft) => void; /** Locked copy for a resolved granted summary; "checkout" once checkout has started. */ selectionLockedReason?: "checkout" | "final"; /** Already-translated selection failure from the widget, rendered beside the acting control. */ selectError?: string | null; /** The refusal code behind `selectError`; a stock refusal refetches the catalogue once. */ selectErrorCode?: string | null; outcomeReason?: OutcomeReason; /** Host-provided action shown on the terminal panel. */ outcomeAction?: OutcomeAction; onReenter?: () => Promise; isReentering?: boolean; class?: string; className?: string; } export declare function DrawModule(props: DrawModuleProps): import("solid-js").JSX.Element; export declare namespace DrawModule { var displayName: string; }