/** * Erreur générée par l'API Altazion Commerce (HTTP 4xx / 5xx). */ export declare class AltazionApiError extends Error { readonly status: number; readonly problem: ProblemDetails; constructor(status: number, problem: ProblemDetails); } /** Produit associé avec ses détails — même structure que WebProduct */ export declare type AssociatedProductWithDetails = WebProduct; /** Niveau de disponibilité : 0=Disponible, 1=Limité, 2=Indisponible */ export declare type AvailabilityLevel = 0 | 1 | 2; /** Source de la disponibilité */ export declare type AvailabilitySource = 'DB' | 'DO' | 'US'; /** * Erreur liée à une opération sur le cache (IndexedDB, SharedWorker). */ export declare class CacheError extends Error { readonly cause: unknown; constructor(message: string, cause?: unknown); } declare class CacheStrategy { private readonly bridge; private readonly http; constructor(bridge: WorkerBridge, http: CommerceHttpAdapter); /** * Exécute la requête selon la stratégie choisie. * * @param key Clé de cache (généralement le path + params) * @param fetcher Fonction qui effectue la requête HTTP * @param strategy Stratégie à appliquer * @param ttlMs TTL du cache (override la valeur par défaut) */ execute(key: string, fetcher: () => Promise, strategy: CacheStrategyName, ttlMs?: number): Promise; private networkFirst; private cacheFirst; private staleWhileRevalidate; } /** * Stratégies de cache disponibles pour les requêtes HTTP. */ export declare type CacheStrategyName = 'network-only' | 'network-first' | 'cache-first' | 'stale-while-revalidate'; export declare interface Cart { guid: string; orderNumber?: string | null; expectedDestinationPostalCode?: string | null; expectedDestinationCountryCode?: string | null; state: CartStatus; customerGuid?: string | null; billingAddress: CustomerAddress; shippingAddresses?: CustomerAddress[] | null; pickupPointAddresses?: PickupPointAddressDetails[] | null; customerName?: string | null; isCustomerLoggedIn: boolean; content?: CartContent[] | null; activeBenefitCode?: string | null; totalAmountWithTax: number; totalAmountWithoutTax: number; totalQuantity: number; createdDate: string; lastModifiedDate: string; associatedDeviceGuid?: string | null; tags?: string[] | null; payments?: CartPayment[] | null; pickupPersonName?: string | null; } export declare interface CartBenefit { offerGuid?: string | null; couponGuid?: string | null; } export declare interface CartBundleComposition { label?: string | null; price: number; image?: string | null; parentGuid: string; productGuids?: string[] | null; } /** Groupe de lignes du panier (par mode de livraison / prestataire) */ export declare interface CartContent { lines?: CartLine[] | null; contentType: CartContentType; /** Ligne de frais de livraison associée */ shippingFees: CartLine; benefitsLines?: CartLine[] | null; associatedBenefits?: CartBenefit[] | null; isValidatable: boolean; requiresShippingFees: boolean; cartErrors?: CartError[] | null; incentiveMessage?: string | null; deliveryModeGuid?: string | null; deliveryModeIsPickupPoint?: boolean | null; shippingAddressGuid: string; pickupPointAddressGuid?: string | null; totalAmountWithTax: number; totalAmountWithTaxFormatted?: string | null; preferredProcess?: string | null; groupInfo: CartGroup; totalPromotionDiscount: number; } /** Type de contenu d'un groupe de lignes du panier */ export declare type CartContentType = 'MainLines' | 'ShipFromStoreLines' | 'StorePickupLines' | 'VendorLines' | 'DropShipLines'; export declare interface CartError { errorCode: number; severity: CartErrorSeverity; message?: string | null; isBlocking: boolean; correctionMessage?: string | null; correctionUrl?: string | null; isAutomaticRedirection: boolean; } /** Sévérité d'erreur : 0=Info, 1=Erreur */ export declare type CartErrorSeverity = 0 | 1; export declare interface CartGroup { code?: string | null; label?: string | null; details?: string | null; associatedProcessType?: string | null; isExternal: boolean; } export declare interface CartLine { itemType: ProductMetaType; id: string; parentLineId?: string | null; label?: string | null; reference?: string | null; productGuid: string; quantity: number; originalNonDiscountedUnitPriceExclTax: number; originalNonDiscountedUnitPriceInclTax: number; originalUnitPriceExclTax: number; originalUnitPriceInclTax: number; finalUnitPriceInclTax: number; finalUnitPriceExclTax: number; unitDiscountExclTax: number; unitDiscountInclTax: number; imageUrl?: string | null; intermediateImageUrl?: string | null; isUpdated: boolean; brand?: string | null; storeGuid?: string | null; isNotEditable: boolean; distinguishingAttributes?: string[] | null; customData?: string[] | null; ancillaryFeesDetails?: string[] | null; isAvailableInStore?: boolean | null; quantityAvailableInStore?: number | null; isAvailableInCentral?: boolean | null; quantityAvailableInCentral?: number | null; maxOrderableQuantity?: number | null; associatedItemBundles?: CartBundleComposition[] | null; fullfilmentInfo: FullfilmentCartInfo; appliedDiscounts?: CartLineDiscount[] | null; dimensions: ProductDimensionsBase; } export declare interface CartLineDiscount { offerGuid?: string | null; offerCode?: string | null; quantityOffered?: number | null; unitDiscountExclTax: number; unitDiscountInclTax: number; } declare class CartModule { private readonly http; private readonly cache; private readonly connectivity; private readonly summaryStore; constructor(http: CommerceHttpAdapter, cache: CacheStrategy, connectivity: ConnectivityManager, bridge: WorkerBridge); /** Récupère le panier en cours */ getCart(): Promise; /** Retourne le dernier résumé panier disponible sans forcer un accès réseau */ peekSummary(): CartSummarySnapshot | null; /** Retourne le résumé panier local et lance une revalidation lazy si nécessaire */ getSummary(): Promise; /** Force le rechargement du panier puis du résumé local */ refreshSummary(): Promise; /** Supprime le résumé panier local mis en cache côté navigateur */ clearSummary(): Promise; /** Récupère le statut de validation du panier */ getValidationStatus(): Promise; /** Ajoute un article au panier */ addItem(reference: string, quantity: number, options?: Record): Promise; /** Met à jour la quantité d'une ligne */ updateItem(lineId: string, quantity: number): Promise; /** Supprime une ligne du panier */ removeItem(lineId: string): Promise; /** Applique un coupon */ applyCoupon(code: string): Promise; /** Retire un coupon */ removeCoupon(code: string): Promise; private ensureOnline; private getExistingQuantity; private findLineByReference; private buildAddItemUrl; } export declare interface CartPayment { paymentGuid: string; amount: number; paymentMethodGuid: string; isCompleted: boolean; pspReference?: string | null; } /** État du panier : 0=Actif, 1=Complété, 2=En préparation, 127=Verrouillé */ export declare type CartStatus = 0 | 1 | 2 | 127; export declare interface CartSummaryContentSnapshot { contentType: CartContentType; totalAmountWithTax: number; mainReferencesCount: number; mainLinesCount: number; mainQuantity: number; } export declare interface CartSummarySnapshot { cartGuid?: string | null; sourceCartLastModifiedDate?: string | null; cachedAt: string; staleAt: string; totalAmountWithTax: number; totalQuantity: number; mainReferencesCount: number; mainQuantity: number; contents: CartSummaryContentSnapshot[]; } export declare interface CartValidationStatus { canBeOrdered: boolean; canBeCompleted: boolean; unavailableProducts?: InvalidProduct[] | null; validationErrors?: CartError[] | null; } declare class CatalogModule { private readonly http; private readonly cache; constructor(http: CommerceHttpAdapter, cache: CacheStrategy); /** Récupère le détail d'un produit par sa référence */ getProduct(reference: string): Promise; /** Récupère une liste de produits par leurs références */ getProducts(references: string[]): Promise; /** Récupère les produits d'une catégorie */ getCategory(categoryCode: string, pageIndex?: number, pageSize?: number): Promise; /** Effectue une recherche full-text */ search(request: SearchRequest): Promise; /** Récupère les suggestions de recherche (autocomplete) */ suggest(query: string): Promise; } /** * Point d'entrée principal du SDK Altazion Commerce. * * Usage : * ```ts * const client = new CommerceClient({ baseUrl: 'https://api.monsite.com', siteUrl: window.location.href }) * await client.initialize() * * const cart = await client.cart.getCart() * ``` */ export declare class CommerceClient { readonly context: CommerceContext; readonly connectivity: ConnectivityManager; readonly session: SessionModule; readonly cart: CartModule; readonly catalog: CatalogModule; readonly shipping: ShippingModule; readonly marketing: MarketingModule; readonly stores: StoresModule; readonly payments: PaymentsModule; readonly devices: DeviceManager; private readonly http; private readonly workerBridge; private readonly cacheStrategy; private readonly sessionManager; constructor(options: CommerceContextOptions); /** * Initialise le SDK : * - Crée la session si nécessaire (mode browser uniquement) */ initialize(): Promise; /** * Retourne vrai si le SDK est hors-ligne. */ get isOffline(): boolean; /** * Force le vidage du cache. */ clearCache(): Promise; /** * Libère les ressources (listeners, worker). */ dispose(): void; } /** * Contexte partagé du SDK, instancié une seule fois et transmis * à tous les sous-systèmes (HttpAdapter, SessionManager, modules…). */ export declare class CommerceContext { readonly baseUrl: string; readonly siteUrl: string | undefined; readonly sitePk: number | undefined; readonly rjsId: number | undefined; readonly locale: string; readonly currency: string; readonly mode: CommerceMode; constructor(options: CommerceContextOptions); private static detectMode; } export declare interface CommerceContextOptions { /** URL de base de l'API (ex. : "https://api.monsite.com") */ baseUrl: string; /** Identifiant ou URL du site web pour la création de session (mode browser) */ siteUrl?: string; /** * Clé primaire du site (alternative à siteUrl). * Requiert aussi rjsId. */ sitePk?: number; /** Identifiant du tenant RJS (nécessaire avec sitePk) */ rjsId?: number; /** Locale par défaut (ex. : "fr-FR") */ locale?: string; /** Devise par défaut (ex. : "EUR") */ currency?: string; } /** * Adaptateur HTTP basé sur fetch natif. * * Responsabilités : * - Construction des URLs à partir du baseUrl du contexte * - Ajout des headers standard (Content-Type, Accept, locale) * - credentials: 'include' pour la transmission automatique des cookies (modes browser et kiosk) * - Parse des réponses ProblemDetails en AltazionApiError * - Retry limité sur les erreurs réseau (TypeError), jamais sur les 4xx/5xx */ declare class CommerceHttpAdapter { private readonly context; constructor(context: CommerceContext); request(path: string, options?: RequestOptions): Promise; private handleResponse; /** Effectue un GET et retourne T */ get(path: string, headers?: Record): Promise; /** Effectue un POST avec un body JSON et retourne T */ post(path: string, body?: unknown, headers?: Record): Promise; /** Effectue un PUT avec un body JSON et retourne T */ put(path: string, body?: unknown, headers?: Record): Promise; /** Effectue un PATCH avec un body JSON et retourne T */ patch(path: string, body?: unknown, headers?: Record): Promise; /** Effectue un DELETE et retourne T */ delete(path: string, headers?: Record): Promise; } /** * Mode d'exécution du SDK. * - `browser` : navigateur classique — le SDK gère la création de session et le cookie. * - `kiosk` : borne avec "Altazion Device Shell" — le browser embarqué gère les cookies. */ export declare type CommerceMode = 'browser' | 'kiosk'; export declare type ConnectivityListener = (status: ConnectivityStatus) => void; /** * Surveille l'état de la connexion réseau. * * - Utilise navigator.onLine comme valeur initiale * - Écoute les événements window 'online' / 'offline' * - Permet d'abonner des listeners (pattern observable léger) */ export declare class ConnectivityManager { private status; private readonly listeners; constructor(); get isOnline(): boolean; get isOffline(): boolean; /** * Abonne un listener aux changements de connectivité. * Retourne une fonction de désabonnement. */ subscribe(listener: ConnectivityListener): () => void; /** Libère les event listeners sur window. */ dispose(): void; private readOnlineStatus; private readonly handleOnline; private readonly handleOffline; private emit; } export declare type ConnectivityStatus = 'online' | 'offline'; /** Adresse client stockée (table gestcom_clients_adresses) */ export declare interface CustomerAddress { addressGuid: string; customerGuid: string; isActive: boolean; title?: string | null; company?: string | null; fullName?: string | null; streetAddress?: string | null; postalCode?: string | null; city?: string | null; countryCode?: string | null; phone?: string | null; email?: string | null; isBillingAddress: boolean; siteId: number; isDefault: boolean; region?: string | null; isTemporary: boolean; mobile?: string | null; } /** Jour de la semaine (convention .NET) : 0=Dimanche … 6=Samedi */ export declare type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6; /** Type de service de livraison : 0=Standard, 1=Express, 2=SameDayDelivery */ export declare type DeliveryServiceType = 0 | 1 | 2; export declare class DeviceManager { private initialized; private globalListener?; private peripherals; private readonly host; private readonly hostListener; constructor(); get isHostAvailable(): boolean; registerGlobalCallback(callback: DeviceNotificationListener): void; initialize(mockMode?: boolean): void; init(mockMode?: boolean): void; dispose(): void; findPeripheral(guid: string): PeripheralBase | null; findPeripheralByType(type: string): PeripheralBase[]; findPeripheralsByType(type: string): PeripheralBase[]; notify(notification: DeviceNotification): void; changeShellState(newState: string): void; sendAppStatusUpdate(currentApp: string, currentStatus: string, value?: string | null): void; private resolveHost; private normalizeNotification; private createPeripherals; private createPeripheral; private readStatus; private dispatchPeripheralNotification; } export declare interface DeviceNormalizedPayload { associatedDevice?: string; status?: string; orderGuid?: string; orderNumber?: string; mrgGuid?: string; amount?: number; currency?: string; reasonCode?: string; reasonMessage?: string; transactionId?: string; barcode?: string; symbology?: string; raw: Record; } export declare class DeviceNotification { kind: string; associatedDevice?: string; jsonData?: string; rawData?: unknown; getData(): T | null; getRecordData(): Record | null; getNormalizedPayload(): DeviceNormalizedPayload | null; } export declare type DeviceNotificationListener = (notification: DeviceNotification) => void; export declare type DeviceOperationListener = (type: string, orderGuid: string, notification: DeviceNotification) => void; export declare interface FullfilmentCartInfo { fullfilmentKind?: string | null; fullfilmentCode?: string | null; fullfilmentPartnerId?: string | null; fullfilmentPartnerName?: string | null; } /** Produit indisponible dans le panier */ export declare interface InvalidProduct extends WebProduct { availableSubstitutions?: WebProduct[] | null; } export declare interface MarketingItem { linkItem?: MarketingLinkItem; xmlData?: unknown; htmlData?: unknown; } export declare interface MarketingLinkItem { guid: string; stepGuid: string; mimeType?: string | null; imageUrl?: string | null; targetSelectionGuid?: string | null; targetUrl?: string | null; keyword?: string | null; width?: number | null; height?: number | null; altData?: string | null; htmlContent?: string | null; kind?: string | null; } declare class MarketingModule { private readonly http; private readonly cache; constructor(http: CommerceHttpAdapter, cache: CacheStrategy); /** Récupère un item marketing par son code */ getItem(code: string): Promise; /** Récupère plusieurs items marketing par leurs codes */ getItems(codes: string[]): Promise; } /** * Erreur levée lorsque le SDK est hors-ligne et ne peut pas * satisfaire la requête depuis le cache. */ export declare class OfflineError extends Error { constructor(message?: string); } export declare type PaymentMethodKind = number; export declare interface PaymentPreparationData extends PaymentRequestData { inputData?: Record; } export declare interface PaymentPreparationResult { validation: PaymentValidationResult; preparation: PaymentWebPreparationResult; } export declare interface PaymentRedirectStartResult { preparationResult: PaymentPreparationResult; cart: Cart; redirectUrl: string; pspReference?: string | null; } export declare interface PaymentRequestData { paymentMethodGuid: string; amount: number; referenceNumber?: string | null; autoValidated?: boolean; } declare class PaymentsModule { private readonly http; constructor(http: CommerceHttpAdapter); getChoicesPrivate(): Promise; preparePaymentPrivate(request: PaymentPreparationData): Promise; registerPaymentPrivate(request: PaymentRequestData): Promise; startRedirectPayment(request: PaymentPreparationData): Promise; } export declare interface PaymentValidationResult { paymentMethodGuid: string; paymentMethodName?: string | null; requestedAmount: number; remainingAmountBefore: number; requestedAutoValidated: boolean; autoValidated: boolean; } export declare interface PaymentWebCapabilities { requiresInitialization: boolean; requiresUserInput: boolean; supportsAmountEditing: boolean; supportsPartialCoverage: boolean; supportsDeferredConfirmation: boolean; requiresStoreCollection: boolean; isOfflineSettlement: boolean; } export declare interface PaymentWebDescriptor { providerFamily: PaymentWebProviderFamily; providerCode?: string | null; renderMode: PaymentWebRenderMode; settlementMode: PaymentWebSettlementMode; publicLabel?: string | null; rendererKey?: string | null; capabilities: PaymentWebCapabilities; data?: Record | null; } export declare interface PaymentWebPreparationResult { isAvailable: boolean; requiresInitialization: boolean; initializationKind?: string | null; availableAmount?: number | null; maxApplicableAmount?: number | null; statusCode?: string | null; statusLabel?: string | null; data?: Record | null; } declare type PaymentWebProviderFamily = number | string; declare type PaymentWebRenderMode = number | string; declare type PaymentWebSettlementMode = number | string; export declare abstract class PeripheralBarCode extends PeripheralBase { protected globalListener?: DeviceNotificationListener; protected successListener?: DeviceOperationListener; protected failureListener?: DeviceOperationListener; on(callback: DeviceNotificationListener): void; onSuccess(callback: DeviceOperationListener): void; onError(callback: DeviceOperationListener): void; dispatchNotification(notification: DeviceNotification): void; dispatchSuccess(type: string, orderGuid: string, notification: DeviceNotification): void; dispatchFailure(type: string, orderGuid: string, notification: DeviceNotification): void; } export declare class PeripheralBase { name: string; guid: string; type: string; state: string | null; isAvailable(): boolean; IsAvailable(): boolean; } export declare abstract class PeripheralTpe extends PeripheralBase { protected globalListener?: DeviceNotificationListener; protected successListener?: DeviceOperationListener; protected failureListener?: DeviceOperationListener; on(callback: DeviceNotificationListener): void; onSuccess(callback: DeviceOperationListener): void; onFailure(callback: DeviceOperationListener): void; onError(callback: DeviceOperationListener): void; dispatchNotification(notification: DeviceNotification): void; dispatchSuccess(type: string, orderGuid: string, notification: DeviceNotification): void; dispatchFailure(type: string, orderGuid: string, notification: DeviceNotification): void; abstract makePayment(orderGuid: string, orderNumber: string, mrgGuid: string, amount: number, currency: string): void; abstract makeRefund(orderGuid: string, orderNumber: string, mrgGuid: string, amount: number, currency: string): void; abstract cancelPendingPayment(): void; } /** Point de livraison (point relais, locker, consigne) */ export declare interface PickupPoint { id: string; carrierId: number; name?: string | null; address?: string | null; postalCode?: string | null; city?: string | null; countryCode?: string | null; platformLevel1?: string | null; platformLevel2?: string | null; platformLevel3?: string | null; platformLevel4?: string | null; platformLevel5?: string | null; isPrimary: boolean; externalCode?: string | null; startDate: string; endDate: string; accessIndications?: string | null; availableServices?: string | null; longitude?: number | null; latitude?: number | null; phoneNumber?: string | null; isActive: boolean; } /** Point de livraison avec ses horaires d'ouverture */ export declare interface PickupPointAddressDetails extends PickupPoint { horaires?: unknown[] | null; moreInfo?: string | null; } /** * Représentation d'une réponse d'erreur ProblemDetails (RFC 9457) * telle que renvoyée par GlobalExceptionFilter.cs */ export declare interface ProblemDetails { type?: string; title?: string; status?: number; detail?: string; instance?: string; [key: string]: unknown; } export declare interface ProductAvailabilitySummary { notAvailableUntil?: string | null; notAvailableAfter?: string | null; statusCode?: string | null; status: AvailabilityLevel; web: ProductWebAvailability; local: ProductStoreAvailability; stores?: Record | null; source: AvailabilitySource; } export declare interface ProductCustomAttributeWithDefinition { enumeratedValue?: number | null; attributeGuid: string; decimalValue?: number | null; booleanValue?: boolean | null; textValue?: string | null; dateValue?: string | null; attributeLabel?: string | null; isPublic: boolean; } export declare interface ProductDetails extends WebProduct { dimensions: ProductDimensionsBase; taxes: ProductTaxBase[]; parent: WebProduct; availability: ProductAvailabilitySummary; instances: ProductInstance[]; documents: string[]; videos: string[]; moreImages: ProductImage[]; labels: string[]; customAttributes: ProductCustomAttributeWithDefinition[]; logosUrls: string[]; associatedProducts: Record; suggestionsAuto: WebProduct[]; reviews: ProductReview[]; url: string; fulfillmentConditions: ProductLogisticsInfoBase; } export declare interface ProductDimensionsBase { netHeight?: number | null; netWidth?: number | null; netLength?: number | null; netWeight?: number | null; netVolume?: number | null; grossHeight: number; grossWidth: number; grossLength: number; grossWeight: number; grossVolume: number; } export declare interface ProductImage { urlSmall?: string | null; urlBig?: string | null; } /** Instance de produit (variation) — même structure que WebProduct */ export declare type ProductInstance = WebProduct; declare interface ProductLogisticsInfoBase { fulfillmentTypeCode?: string | null; fulFillmentMandatoryZoneGuid?: string | null; isHighDemand: boolean; } /** Type de méta-produit (0-8) */ export declare type ProductMetaType = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; export declare interface ProductReview { guid: string; productGuid: string; reviewerName?: string | null; message?: string | null; customerGuid?: string | null; email?: string | null; hasBeenValidated: boolean; date: string; note: number; } export declare interface ProductStoreAvailability { isAvailable: boolean; quantity?: number | null; distance?: number | null; source: AvailabilitySource; } declare interface ProductTaxBase { guid: string; taxeDefinitionGuid: string; amount: number; } export declare interface ProductWebAvailability { isAvailable: boolean; isAvailableFromWarehouse: boolean; isAvailableFromOther: boolean; warehouseQuantity?: number | null; otherQuantity?: number | null; source: AvailabilitySource; } declare interface RequestOptions { method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; body?: unknown; headers?: Record; /** Nombre maximum de tentatives réseau (uniquement sur erreurs réseau, jamais sur 4xx) */ maxRetries?: number; } export declare interface SearchFacet { /** Nom de la facette */ n?: string | null; /** Valeurs de la facette */ i?: SearchFacetValue[] | null; } export declare interface SearchFacetValue { /** Valeur */ v?: string | null; /** Libellé */ n?: string | null; /** Nombre de résultats */ c: number; } export declare interface SearchRequest { /** Terme de recherche */ q?: string | null; /** Index de départ (pagination) */ offset: number; /** Nombre de résultats demandés */ length: number; /** Filtres sous forme de chaîne (format interne) */ filters?: string | null; } export declare interface SearchResult { totalCount: number; offset: number; length: number; elements?: SearchResultElement[] | null; facets?: SearchFacet[] | null; } export declare interface SearchResultElement { /** Produit */ p: WebProduct; /** Score de pertinence */ s?: number | null; } export declare interface SessionInfo { id: string; expiresOn?: string | null; loggedUserGuid?: string | null; loggedUserEmail?: string | null; associatedStoreGuid?: string | null; associatedDeviceGuid?: string | null; hasCart: boolean; cartId?: string | null; rjsId: number; sitePk: number; marketingTestDate?: string | null; } /** * Interface commune pour la gestion de session. * Deux implémentations : BrowserSessionManager (mode browser) et KioskSessionManager (mode borne). */ export declare interface SessionManager { /** * Initialise la session. * En mode browser : crée une session si elle n'existe pas encore. * En mode kiosk : no-op. */ initialize(): Promise; /** * Signale que la session a expiré. * En mode browser : peut tenter de recréer une session. * En mode kiosk : no-op. */ onSessionExpired(): Promise; } declare class SessionModule { private readonly http; private readonly cache; constructor(http: CommerceHttpAdapter, cache: CacheStrategy); /** Récupère les informations de la session en cours */ getSession(): Promise; /** Associe un magasin à la session */ associateStore(storeGuid: string): Promise; } /** Adresse de livraison pour le checkout */ export declare interface ShippingAddress { guid: string; title?: string | null; name?: string | null; streetAddress?: string | null; city?: string | null; phone?: string | null; mobile?: string | null; postalCode?: string | null; email?: string | null; isForInvoice: boolean; } export declare interface ShippingChoice { id?: string | null; isPickupPoint: boolean; carrierLabel?: string | null; reference?: string | null; priceExclTax: number; priceInclTax: number; originalPriceExclTax: number; originalPriceInclTax: number; discountExclTax: number; discountInclTax: number; formattedPrice?: string | null; formattedOriginalPrice?: string | null; formattedDiscount?: string | null; estimatedDeliveryDate: string; formattedEstimatedDeliveryDate?: string | null; destinationType: ShippingDestinationKind; serviceType: DeliveryServiceType; isActive: boolean; shippingProviderId: number; priority: number; publicLabel?: string | null; } export declare interface ShippingChoiceGroup { groupName?: string | null; minPrice?: number | null; maxPrice?: number | null; earliestDeliveryDate?: string | null; choices?: ShippingChoice[] | null; groupDestination: ShippingDestinationKind; groupServiceType: DeliveryServiceType; applicableCartContentTypes?: string[] | null; } /** Type de destination de livraison : 0=Adresse, 1=Magasin, 2=PointRelais */ export declare type ShippingDestinationKind = 0 | 1 | 2; declare class ShippingModule { private readonly http; private readonly cache; constructor(http: CommerceHttpAdapter, cache: CacheStrategy); /** Récupère les groupes de modes de livraison disponibles pour le panier en cours */ getAvailableModes(): Promise; /** Sélectionne un mode de livraison */ selectMode(shippingModeGuid: string): Promise; /** Met à jour l'adresse de livraison */ setAddress(address: ShippingAddress): Promise; /** Recherche des points relais à proximité */ getRelayPoints(postalCode: string, countryCode?: string, shippingModeGuid?: string): Promise; } /** Mode de gestion du stock : 0=Aucun, 1=Géré, 2=Infini */ export declare type StockManagementMode = 0 | 1 | 2; export declare interface StoreEvent { id: string; storeId: string; /** Date au format 'YYYY-MM-DD' */ eventDate: string; category?: string | null; title?: string | null; htmlDescription?: string | null; isArchived: boolean; crossChannelEventId?: string | null; exceptionalOpeningHours?: string | null; } export declare interface StoreOpeningHours { storeGuid: string; day: DayOfWeek; openingHoursPeriod1?: string | null; openingHoursPeriod2?: string | null; } declare class StoresModule { private readonly http; private readonly cache; constructor(http: CommerceHttpAdapter, cache: CacheStrategy); /** Recherche des magasins par coordonnées géographiques */ findByLocation(latitude: number, longitude: number, countryCode?: string, count?: number, feature?: string): Promise; /** Recherche des magasins par code postal */ findByPostalCode(postalCode: string, countryCode?: string, count?: number, feature?: string): Promise; /** Récupère le détail d'un magasin par son GUID */ getStore(storeGuid: string): Promise; /** Récupère le magasin associé à la session en cours (null si aucun) */ getSessionStore(): Promise; } export declare interface StoreWithOpeningHours { guid: string; code?: string | null; label?: string | null; streetAddress?: string | null; postalCode?: string | null; city?: string | null; countryIso3LettersCode?: string | null; latitude?: number | null; longitude?: number | null; geoZone?: string | null; phone?: string | null; email?: string | null; messageForClients?: string | null; isClickNMortarEnable: boolean; isShippingDestination: boolean; acceptsPickup: boolean; acceptsShipFromStore: boolean; storeType?: string | null; openingDate?: string | null; } export declare interface UsablePaymentMethod { guid: string; name?: string | null; isPrimary: boolean; priority: number; type: PaymentMethodKind; merchantKey?: string | null; autoValidable: boolean; merchantKeyComplement?: string | null; additionalData?: string | null; forTypes?: CartContentType[] | null; maxAmount: number; } export declare interface UsablePaymentMethodWebDescriptor { paymentMethod: UsablePaymentMethod; descriptor: PaymentWebDescriptor; } /** Produit web (utilisé dans les listings et résultats de recherche) */ export declare interface WebProduct { id: number; guid: string; priceWOTax: number; /** Prix TTC */ price: number; vat: number; discountedPriceWOTax?: number | null; discountedPrice?: number | null; discountStartDate?: string | null; discountEndDate?: string | null; creationDate: string; label?: string | null; sku?: string | null; familyId: number; description?: string | null; subFamilyId?: number | null; brandId: number; vatId: number; productTypeId: number; usableOnDigitalTools: boolean; isForInvoicableElements: boolean; isMultiVariations: boolean; isMainVariation: boolean; isAssembly: boolean; isExternalVendorEnabled: boolean; isProductComplete: boolean; currentCreationStep: number; recommendedPriceWOTax?: number | null; recommendedPrice?: number | null; metaType: ProductMetaType; riskScore: number; parentProductId?: number | null; isHighDemand: boolean; isShippable: boolean; isSubscription: boolean; isPackage: boolean; isImported: boolean; allowsDecimalQuantity: boolean; externalCode?: string | null; compositionType?: string | null; isSimplified: boolean; lockedByUserId?: string | null; unitId?: number | null; quantityPerUnit?: number | null; stockManagementMode: StockManagementMode; priceIndexId?: string | null; priceIndexMultiplier?: number | null; priceIndexFeesRate?: number | null; externalDppUrl?: string | null; mainImage?: string | null; smallImage?: string | null; intermediateImage?: string | null; availableForOrder: boolean; availableForShipping: boolean; availableForPickup: boolean; allTags?: string[] | null; externalUrl?: string | null; mainCategoryId?: number | null; availabilityThreshold?: number | null; limitedAvailabilityThreshold?: number | null; reviewsNote?: number | null; qtyByParentUnit: number; reasonCode?: string | null; relevance: number; attributs?: Record | null; attributsPrives?: Record | null; importance: number; } /** * Abstraction du canal de communication avec le SharedWorker de cache. * * - Utilise un SharedWorker si le navigateur le supporte * - Fallback : Map in-memory (données non persistantes, perdues au reload) * * Chaque appel retourne une Promise, résolue/rejetée via la réponse du worker. */ declare class WorkerBridge { private worker; private port; private readonly pending; private requestCounter; private readonly fallback; private usingFallback; constructor(); private tryStartWorker; private readonly handleWorkerError; private readonly handlePortMessageError; private readonly handleMessage; private nextId; private send; get(key: string): Promise; set(key: string, data: unknown, ttlMs: number): Promise; invalidate(pattern: string): Promise; clearAll(): Promise; private activateFallback; private getFromFallback; private setInFallback; private invalidateFallback; dispose(): void; } export { }