/** * Core Service Components * Provides low-level access to ServiceService via render props */ import React from 'react'; import { type ServiceServiceConfig } from '../../../services/service/service.js'; import type { Service, Payment, BookingPolicy, Schedule, StaffMember, DurationRange } from '@wix/auto_sdk_bookings_services'; import type { MoneyData } from '@wix/headless-components/react'; /** * Props for Service.Root component */ export interface RootProps { children: React.ReactNode | ((props: { selected: boolean; bookable: boolean; }) => React.ReactNode); serviceServiceConfig: ServiceServiceConfig; } export declare function Root(props: RootProps): React.ReactNode; /** * Props for Service render prop component */ export interface ServiceProps { children: (data: { service: Service; isLoading: boolean; error: string | null; }) => React.ReactNode; } /** * Core component that provides access to full service data via render props. * * @component * @example * ```tsx * * {({ service, isLoading, error }) => ( * isLoading ?
Loading...
:
{service.name}
* )} *
* ``` */ export declare function Service(props: ServiceProps): React.ReactNode; /** * Props for Info render prop component */ export interface InfoProps { children: (data: { name: string; description: string; tagline?: string; duration?: number; /** * Typed range of supported session durations, derived from * `service.schedule.availabilityConstraints.sessionDurations`. Set when the * service supports two or more distinct durations; otherwise undefined and * the single-value `duration` field above should be used. Consumers branch * on `range.unitType` (the SDK `UnitType` enum) and read the matching * `range.hourOptions` / `range.dayOptions` config. */ durationRange?: DurationRange; type?: string; category?: { name?: string; _id?: string; }; locations?: Array[number]>; staff?: StaffMember[]; media?: Array<{ url?: string; _id?: string; }>; mainMedia?: { image?: string; }; coverMedia?: { image?: string; }; mediaItems?: Array<{ image?: string | null; altText?: string | null; }>; price?: { amount?: string; formattedAmount?: string; currency?: string; }; defaultCapacity?: number; selected: boolean; }) => React.ReactNode; } /** * Core component that provides access to service catalog info via render props. * Includes name, description, tagline, duration, type, category, locations, staff, media, and price. * * @component * @example * ```tsx * * {({ name, description, tagline, duration, type, category, locations, staff, media, price }) => ( *
*

{name}

*

{description}

* {tagline &&

{tagline}

} * {duration &&

Duration: {duration} minutes

} * {type &&

Type: {type}

} * {category &&

Category: {category.name}

} *
* )} *
* ``` */ export declare function Info(props: InfoProps): React.ReactNode; /** * Props for Price render prop component */ export interface PriceProps { children: (data: { servicePayment: Payment | undefined; rateType: Payment['rateType'] | undefined; money: MoneyData | null; minPrice: MoneyData | null; maxPrice: MoneyData | null; priceDescription: string | null; hasAddOns: boolean; hasPricingPlans: boolean; }) => React.ReactNode; } /** * Core component that provides access to service price via render props. * Returns comprehensive pricing data including money, rate type, and service capabilities. * * @component * @example * ```tsx * * {({ money, rateType, minPrice, maxPrice, priceDescription, hasAddOns, hasPricingPlans }) => ( * rateType === 'FIXED' && money ? ( * * ) : rateType === 'VARIED' && minPrice && maxPrice ? ( * - * ) : rateType === 'CUSTOM' && priceDescription ? ( * {priceDescription} * ) : rateType === 'NO_FEE' ? ( * Free * ) : null * )} * * ``` */ export declare function Price(props: PriceProps): React.ReactNode; /** * Props for Actions render prop component */ export interface ActionsProps { children: (actions: { select: () => void; add: () => void; remove: () => void; rawService: Service; bookable: boolean; selected: boolean; requiresAvailability: boolean; }) => React.ReactNode; } /** * Core component that provides booking selection actions via render props. * * @component * @example * ```tsx * * {({ select, add, remove, rawService, requiresAvailability }) => ( *
* * * *
* )} *
* ``` */ export declare function Actions(props: ActionsProps): React.ReactNode; /** * Props for Policy render prop component */ export interface PolicyProps { children: (data: { bookingPolicy: BookingPolicy | null; cancellationPolicyEnabled: boolean; limitLatestCancellationEnabled: boolean; latestCancellationInMinutes: number | undefined; latestBookingPolicyEnabled: boolean; latestBookingInMinutes: number | undefined; earliestBookingPolicyEnabled: boolean; earliestBookingInMinutes: number | undefined; reschedulePolicyEnabled: boolean; limitLatestRescheduleEnabled: boolean; latestRescheduleInMinutes: number | undefined; waitlistPolicyEnabled: boolean; waitlistCapacity: number | undefined; bookAfterStartEnabled: boolean; maxParticipantsPerBooking: number | undefined; }) => React.ReactNode; } /** * Core component that provides access to service booking policy via render props. * Computes all enabled flags and values from the booking policy. * * @component * @example * ```tsx * * {({ bookingPolicy, cancellationPolicyEnabled, latestCancellationInMinutes }) => ( * cancellationPolicyEnabled ? ( *
Cancel up to {latestCancellationInMinutes} minutes before
* ) : null * )} *
* ``` */ export declare function Policy(props: PolicyProps): React.ReactNode; /** * Props for Schedule render prop component */ export interface ScheduleProps { children: (data: { schedule: Schedule | null; isClassOrCourse: boolean; }) => React.ReactNode; } /** * Core component that provides access to service schedule via render props. * Uses the SDK's Schedule type directly. Only renders for CLASS or COURSE service types. * * @component * @example * ```tsx * * {({ schedule, isClassOrCourse }) => ( * schedule && isClassOrCourse ? ( *
* {schedule.firstSessionStart && ( * Starts: {new Date(schedule.firstSessionStart).toLocaleDateString()} * )} * {schedule.lastSessionEnd && ( * Ends: {new Date(schedule.lastSessionEnd).toLocaleDateString()} * )} *
* ) : null * )} *
* ``` */ export declare function Schedule(props: ScheduleProps): React.ReactNode;