import { Cart } from './Cart.js'; import { CartItem, CartItemOption } from './CartItem.js'; import { Option, Product, ProductPrice } from './Product.js'; import { Webshop } from './Webshop.js'; export type StockLookupData = { product: Product; oldItem?: CartItem | null | undefined; cart: Cart; webshop: Webshop; admin: boolean; amount?: number; }; export type StockDefinition = { /** * How much actually left in stock, not taking into account what is in the cart (except the reserved items in the cart) */ stock: number; /** * The maximum amount we can select with the current options when editing our item */ remaining: number | null; text: string | null; shortText?: string | null; }; export declare class CartStockHelper { static getProductStock({ oldItem, cart, product, admin, amount }: StockLookupData): StockDefinition | null; static getPriceStock({ productPrice, oldItem, cart, product, admin, amount }: StockLookupData & { productPrice: ProductPrice; }): StockDefinition | null; static getOptionStock({ option, oldItem, cart, product, admin, amount }: StockLookupData & { option: Option; }): StockDefinition | null; static getSeatsStock({ oldItem, cart, product, webshop, admin, amount }: StockLookupData): StockDefinition | null; static getOrderMaximum({ amount, oldItem, cart, product, admin }: StockLookupData): StockDefinition | null; static getAllowMultiple({ amount, oldItem, cart, product, admin }: StockLookupData): StockDefinition | null; static getFixedStockDefinitions(data: StockLookupData, options?: { excludeOrder?: boolean; }): StockDefinition[]; /** * Return all the stock definitions for this cart item with the currently selected options * = calculate how much you can order with these options */ static getAvailableStock(data: StockLookupData & { productPrice: ProductPrice; options: CartItemOption[]; }): StockDefinition[]; static getRemainingAcrossOptions(data: StockLookupData, options?: { inMultipleCartItems?: boolean; excludeOrder?: boolean; }): number | null; static getRemaining(definitions: StockDefinition[]): number | null; } //# sourceMappingURL=CartStockHelper.d.ts.map