/** * Time Slot List API * Fetches available time slots for booking services from Wix Bookings */ import { type TimeSlot, type CursorPaging, type CursorPagingMetadata } from '@wix/auto_sdk_bookings_availability-time-slots'; import { type Service } from '@wix/auto_sdk_bookings_services'; import { ViewMode, type Location } from '../../services/time-slot-list/time-slot-list.def.js'; export interface FetchAvailabilityOptions { services: Service[]; fromLocalDate?: string | null; toLocalDate?: string | null; timeZone?: string | null; location?: Location; /** Filter by specific staff member IDs (passed as resourceIds to API) */ staffMemberIds?: string[]; cursorPaging?: CursorPaging; viewMode?: ViewMode; /** Filter by bookable status. If undefined, returns both bookable and non-bookable */ bookable?: boolean; /** Filter by booking policy violations */ bookingPolicyViolations?: { tooEarlyToBook?: boolean; tooLateToBook?: boolean; bookOnlineDisabled?: boolean; }; } /** * Response from fetchAvailability with grouped time slots */ export interface FetchAvailabilityResponse { /** time slots */ timeSlots: TimeSlot[]; /** Cursor pagination metadata for loading more results */ cursorPagingMetadata?: CursorPagingMetadata; } /** * Main entry point for fetching availability * Detects flow type and calls appropriate API * * @param options - Fetch options including services, date range, timezone, and view mode * @returns Promise with grouped time slots * * @example * ```typescript * const response = await fetchAvailability({ * services: [service], * fromLocalDate: '2024-01-15T00:00:00', * toLocalDate: '2024-01-22T00:00:00', * timeZone: 'America/New_York', * viewMode: ViewMode.CLASSIC, * }); * // response.timeSlots are grouped by time * ``` */ export declare function fetchAvailability({ services: selectedServices, viewMode, fromLocalDate, toLocalDate, timeZone, location, staffMemberIds, cursor, slotsPerPage, bookable, bookingPolicyViolations, timeSlotsPerDay, }: { services: Service[]; fromLocalDate: Date; toLocalDate: Date; timeZone?: string; location?: Location; staffMemberIds?: string[]; cursor?: string; viewMode?: ViewMode; bookable?: boolean; bookingPolicyViolations?: { tooEarlyToBook?: boolean; tooLateToBook?: boolean; bookOnlineDisabled?: boolean; }; slotsPerPage?: number; timeSlotsPerDay?: number; }): Promise;