import * as CartTypes from "./types"; import { CartOps } from "./blueprint"; declare class CartManager implements CartOps { private errors; /** * To use getCart(), you can pass an options object to specify what data you want like so: * const cartData = await cartManager.getCart({ lines: true, total: true, currency: true, lineItemId: '1234567890' }); * This will return an object with the cart lines, total price, currency, and the specific line item with the given ID. */ getCart(options?: CartTypes.GetCartOptions): Promise; /** * To use addItem(), you can call it with an object specifying the item details like so: * await cartManager.addItem({ id: 1234567890, quantity: 2, properties: { color: 'blue', size: 'M' } }); * This will add 2 units of the product with ID 1234567890 to the cart, along with custom properties for color and size. */ addItem(item: CartTypes.CartItem): Promise; /** * To use addItems(), you can call it with an array of item objects like so: * await cartManager.addItems([ * { id: 1234567890, quantity: 2 }, * { id: 9876543210, quantity: 1 } * ]); */ addItems(items: CartTypes.CartItem[]): Promise>; /** * To use updateItem(), you can call it with an object specifying the updated item details like so: * await cartManager.updateItem({ id: 'line_item_id_123', quantity: 3, properties: { color: 'red' } }); */ updateItem(item: CartTypes.CartItem): Promise; /** * To use removeItem(), you can call it with an object specifying the item to remove like so: * await cartManager.removeItem({ id: 'line_item_id_123' }); */ removeItem(item: CartTypes.CartItem): Promise; /** * To use clearCart(), simply call it without any arguments: * await cartManager.clearCart(); */ clearCart(): Promise; /** * To use getAllCartAttributes(), you can call it without any arguments like so: * const attributes = await cartManager.getAllCartAttributes(); */ getAllCartAttributes(): Promise; /** * To use getCartAttribute(), you can call it with the attribute key you set for the discount like so: * const discountCode = await cartManager.getCartAttribute('discountCode'); */ getCartAttribute(attrKey: string): Promise; /** * Set a cart attribute. If attrVal is an array, it will be stored as a comma-separated string. * Example: await cartManager.setCartAttribute('discount', [1,2,3]); */ setCartAttribute(attrKey: string, attrVal: string | number | Array): Promise; /** * Remove a cart attribute by key. * Example: await cartManager.removeCartAttribute('discount'); */ removeCartAttribute(attrKey: string): Promise; /** * To use addCartNote(), you can call it with the note string like so: * await cartManager.addCartNote('Please deliver between 3-5 PM.'); */ addCartNote(note: string): Promise; /** * To use removeCartNote(), simply call it without any arguments: * await cartManager.removeCartNote(); */ removeCartNote(): Promise; /** * To use applyDiscount(), simply call it without any arguments: * await cartManager.applyDiscount(); */ applyDiscount(): Promise; /** * To use getCartSummary(), simply call it without any arguments: * const summary = await cartManager.getCartSummary(); * const summary: CartSummary = await cartManager.getCartSummary(); */ getCartSummary(): Promise; } /** * To use cartManager, you can import it and call its methods like so: * import { cartManager } from './path/to/cart'; */ export declare const cartManager: CartManager; export {};