/** * Location List Service Implementation * Manages location state, auto-detection, and BookingService integration * * @module Services/LocationList */ import type { ServiceFactoryConfig } from '@wix/services-definitions'; import { type Location } from './location-list.def.js'; export { getLocationById } from '../../api/query-locations/index.js'; /** * Configuration interface for LocationListService */ export interface LocationListServiceConfig { /** Locations array (can include any type: BUSINESS, CUSTOM, CUSTOMER) */ locations?: Location[]; /** Explicit flag for custom locations (overrides auto-detection) */ hasCustomLocations?: boolean; /** Explicit flag for customer locations (overrides auto-detection) */ hasCustomerLocations?: boolean; /** Custom label for CUSTOM location type (fallback when no name exists) */ customLocationLabel?: string; /** Custom label for CUSTOMER location type (fallback when no name exists) */ customerLocationLabel?: string; } /** * Implementation of the LocationList service * Manages location state and integrates with BookingService for selection (optional) */ export declare const LocationListService: import("@wix/services-definitions").ServiceFactory; /** * Result type for SSR loader */ export type LoadLocationListServiceResult = { type: 'success'; config: LocationListServiceConfig; } | { type: 'error'; error: string; }; /** * SSR Loader: Fetches locations from API for server-side rendering. * * @param options - Optional configuration * @returns Configuration result for LocationListService with pre-fetched locations * * @example * ```typescript * // Fetch from API * const result = await loadLocationListServiceInitialData(); * * if (result.type === 'error') { * return Astro.redirect('/500'); * } * * const locationListConfig = result.config; * ``` * * @example * ```typescript * // Pass locations directly (e.g., from service.locations) * const result = await loadLocationListServiceInitialData({ * locations: service.locations, * // hasCustom/hasCustomer will be auto-detected from array * }); * ``` */ export declare function loadLocationListServiceInitialData(options?: { /** Pass locations directly instead of fetching */ locations?: Location[]; /** Explicit flag for custom locations */ hasCustomLocations?: boolean; /** Explicit flag for customer locations */ hasCustomerLocations?: boolean; }): Promise; /** * Service binding helper for LocationListService. * Bundles definition, implementation, and config for ServicesManager. * * @param servicesConfigs - Object containing LocationListServiceDefinition config * @returns Tuple of [Definition, Implementation, Config] for addService() * * @example * ```typescript * const servicesManager = createServicesManager( * createServicesMap() * .addService(...locationListServiceBinding(configs)) * ); * ``` */ export declare const locationListServiceBinding: (servicesConfigs: T) => readonly [string & { __api: import("./location-list.def.js").LocationListServiceAPI; __config: {}; isServiceDefinition?: boolean; } & import("./location-list.def.js").LocationListServiceAPI, import("@wix/services-definitions").ServiceFactory, LocationListServiceConfig]; export { LocationListServiceDefinition, LocationType, type Location, type LocationListActions, type LocationListServiceAPI, } from './location-list.def.js';