UNPKG

@valantic/spartacus-mock

Version:

This project offers you the possibility to mock the OCC Endpoints of your Composable Storefront (Spartacus). It uses the Mock Service Worker to mock the API calls.

20 lines (19 loc) 1 kB
import { Occ } from '@spartacus/core'; export declare enum CartUserType { OCC_USER_ID_ANONYMOUS = "anonymous", OCC_USER_ID_GUEST = "guest", OCC_USER_ID_CURRENT = "current" } interface ProductAddToCart { code: string; } export declare const getCart: (cartGuid: string, cartUserType: CartUserType, forceEntries?: boolean) => Occ.Cart; export declare const getCarts: (cartUserType: CartUserType) => Occ.CartList; export declare const addToCart: (product: ProductAddToCart, quantity: number) => Occ.CartModification; export declare const updateEntries: (_cartId: string, entryNumber: number, quantity: number) => Occ.CartModification; export declare const removeEntries: (_cartId: string, entryNumber: number) => void; export declare const deleteCart: () => void; export declare const setGuestCheckout: (newState: boolean) => void; export declare const getUserForCart: (userType?: CartUserType) => Occ.User; export declare const getUserTypeById: (userId: string) => CartUserType; export {};