/** * Core Book - Provides book action data via render props * NO AsChildSlot, NO asChild - that belongs in high-level component */ import React from 'react'; import { type BookingError } from '../../../services/booking/book-action/types.js'; /** * Data exposed by Book component via render props */ export interface BookData { isLoading: boolean; error: BookingError | null; canBook: boolean; onClick: () => Promise; disabled: boolean; } /** * Props for core Book component */ export interface BookProps { children: (data: BookData) => React.ReactNode; /** * Called when checkout is required for payment. * Return a Promise to keep loading state active until it resolves. */ onCheckout?: (result: { cartId: string; }) => void | Promise; /** * Called when booking completes without requiring checkout. * Return a Promise to keep loading state active until it resolves. */ onComplete?: (result: { orderId: string; }) => void | Promise; onError?: (error: BookingError) => void; disabled?: boolean; } /** * Core Book component - provides book action data via render props. * Used internally by higher-level Booking.Actions.Book component. * * The onCheckout callback receives the checkoutId for internal use. * The high-level component wraps this to provide a simpler API with * navigateToCheckout() that has the checkoutId already captured. * * @example * ```tsx * { * // Use checkoutId to navigate to checkout * navigateToCheckout(checkoutId); * }} * onComplete={({ orderId }) => { * // Use orderId to navigate to thank you page * navigate(`/thank-you?orderId=${orderId}`); * }} * > * {({ isLoading, error, canBook, onClick, disabled }) => ( * * )} * * ``` */ export declare function Book(props: BookProps): React.ReactNode;