import React from "react";
import { type BlockApiConfig } from "../api";
import type { AutoAppliedDiscountPreview } from "../api/types";
import type { BookingFormConfig, BookingFormData, BookingFormService, BookingSelectedCollectionOptionKind } from "../nodes/booking-form.state";
import { type BookingPaymentSelectionViewModel } from "../shared/bookingPaymentOptions";
import { createBookingBlockApiConfig, type BookingAppointmentPackagesModel, type BookingFieldValue, type BookingFieldView, type BookingFlowActionResult, type BookingFlowFeedback, type BookingFlowStatus, type BookingFlowView, type BookingResourceView, type BookingFlowStep, type BookingFlowStepId, type BookingSlotSelection, type BookingSlotView, type BookingSubmitActionResult, type BookingSubmitOptions, type LoadState } from "./useHeadlessBookingFlow.state";
export type { BlockApiConfig };
export type { BookingAppointmentPackagesModel };
export { createBookingBlockApiConfig };
export type HeadlessBookingFlowOptions = Readonly<{
    siteId: string;
    formId: string;
    form: BookingFormConfig | null;
    services: readonly BookingFormService[];
    initialServiceId?: string;
    initialResourceId?: string;
    initialData?: Partial<BookingFormData>;
    requiresServiceSelection?: boolean;
    requiresResourceSelection?: boolean;
    shouldAutoSelectSingleResource?: boolean;
    enableAppointmentPackages?: boolean;
    spamProtectionEnabled?: boolean;
    successMessage?: string;
    anchorId?: string;
    viewerTimeZone?: string;
    navigateToCheckout?: (checkoutUrl: string) => void;
}>;
export type BookingServicesModel = Readonly<{
    items: readonly BookingFormService[];
    selected: BookingFormService | null;
    defaultServiceId?: string;
    requiresSelection: boolean;
}>;
export type BookingResourcesModel = Readonly<{
    items: readonly BookingResourceView[];
    selected: BookingResourceView | null;
    selectedResourceId?: string;
    state: LoadState<readonly BookingResourceView[]>;
    requiresSelection: boolean;
}>;
export type BookingAvailabilityModel = Readonly<{
    selectedDate?: string;
    availableDates: readonly string[];
    selectedSlot: BookingSlotView | null;
    slots: readonly BookingSlotView[];
    datesState: LoadState<readonly string[]>;
    slotsState: LoadState<readonly BookingSlotView[]>;
    timezone: string;
    hasMoreDates: boolean;
    loadMoreDates: () => void;
}>;
export type BookingFieldsModel = Readonly<{
    items: readonly BookingFieldView[];
    values: Readonly<Record<string, BookingFieldValue>>;
    errors: Readonly<Record<string, string>>;
    touched: Readonly<Record<string, boolean>>;
}>;
export type BookingPaymentModel = Readonly<{
    kind: "unsupported";
    mode: "unsupported";
    selection: null;
    selectedCollectionOptionKind?: BookingSelectedCollectionOptionKind;
    selectedAppointmentPackageId?: string;
    appointmentPackages: BookingAppointmentPackagesModel;
    errorMessage: string;
}> | Readonly<{
    kind: "ok";
    mode: "hidden" | "disclosure_only" | "choice_required";
    selection: BookingPaymentSelectionViewModel | null;
    selectedCollectionOptionKind?: BookingSelectedCollectionOptionKind;
    selectedAppointmentPackageId?: string;
    appointmentPackages: BookingAppointmentPackagesModel;
}>;
export type BookingDiscountModel = Readonly<{
    code: string;
    isOpen: boolean;
    manualCodeEntryAllowed: boolean;
    loading: boolean;
    autoAppliedDiscount: AutoAppliedDiscountPreview | null;
    setCode: (code: string) => void;
    setOpen: (isOpen: boolean) => void;
    clear: () => void;
}>;
export type BookingSpamProtectionModel = Readonly<{
    enabled: false;
}> | Readonly<{
    enabled: true;
    provider: "altcha";
    challenge: {
        url: string;
        auto: "onfocus";
    };
    solution: string | null;
}>;
export type BookingFlowActions = Readonly<{
    selectService: (serviceId: string) => void;
    selectResource: (resourceId: string | null) => void;
    selectDate: (date: string | null) => void;
    selectSlot: (slot: BookingSlotSelection | null) => void;
    updateField: (fieldId: string, value: BookingFieldValue) => void;
    markFieldTouched: (fieldId: string) => void;
    selectPaymentOption: (kind: BookingSelectedCollectionOptionKind | null) => void;
    selectAppointmentPackage: (packageId: string | null) => void;
    setDiscountCode: (code: string) => void;
    clearDiscountCode: () => void;
    setAltchaSolution: (solution: string | null) => void;
    invalidateSpamProtection: () => void;
    next: () => Promise<BookingFlowActionResult>;
    back: () => void;
    /**
     * Moves to a visible step without validating previous steps. Consumers that
     * want linear progression should consult `steps[].canEnter` or call `next()`.
     */
    goToStep: (stepId: BookingFlowStepId) => Promise<BookingFlowActionResult>;
    submit: (options?: BookingSubmitOptions) => Promise<BookingSubmitActionResult>;
    reset: () => void;
    clearFeedback: () => void;
}>;
export type HeadlessBookingFlow = Readonly<{
    status: BookingFlowStatus;
    view: BookingFlowView;
    steps: readonly BookingFlowStep[];
    currentStep: BookingFlowStep | null;
    data: Partial<BookingFormData>;
    services: BookingServicesModel;
    resources: BookingResourcesModel;
    availability: BookingAvailabilityModel;
    fields: BookingFieldsModel;
    payment: BookingPaymentModel;
    discount: BookingDiscountModel;
    spamProtection: BookingSpamProtectionModel;
    feedback: BookingFlowFeedback;
    actions: BookingFlowActions;
}>;
export type HeadlessBookingProviderProps = Readonly<{
    config: BlockApiConfig;
    children?: React.ReactNode;
}>;
export declare function HeadlessBookingProvider({ config, children, }: HeadlessBookingProviderProps): React.ReactElement;
export declare function useHeadlessBookingFlow(options: HeadlessBookingFlowOptions): HeadlessBookingFlow;
