/** * Query Locations API * Fetches business locations from Wix Bookings Services * * @module API/QueryLocations */ import type { Service } from '@wix/auto_sdk_bookings_services'; /** * LocationData type - from Service['locations'][number] */ export type LocationData = NonNullable[number]; /** * Result from querying locations */ export interface QueryLocationsResult { /** Business locations array */ locations: LocationData[]; /** Whether custom locations exist for any service */ hasCustomLocations: boolean; /** Whether customer locations (at customer's place) exist for any service */ hasCustomerLocations: boolean; } /** * Query all locations connected to services. * Returns business locations array and existence flags for custom/customer locations. * * @returns Promise resolving to locations and existence flags * * @example * ```ts * const { locations, hasCustomLocations, hasCustomerLocations } = await queryLocations(); * * // locations contains all business locations * // hasCustomLocations indicates if any service uses custom locations * // hasCustomerLocations indicates if any service is at customer's place * ``` */ export declare function queryLocations(): Promise; /** * Fetches a single location by its business location ID * @param locationId - The business location ID (GUID) * @returns Promise resolving to the location or null if not found * * @example * ```ts * const location = await getLocationById('12345678-1234-1234-1234-123456789012'); * if (location) { * console.log(location.business?.name); * } * ``` */ export declare function getLocationById(locationId: string): Promise;