// Types for engine.js (used by the admin editor's example-cart preview). export interface EngineScope { variantIds?: Set; productIds?: Set; collectionIds?: Set } export interface EngineOffer { id: string; type: "fixed" | "mix" | "bxgy" | string; maxUses?: number; discountType?: string; value?: number; lines?: { variantId?: string; productId?: string; quantity: number }[]; qty?: number; scope?: EngineScope; buyQty?: number; getQty?: number; getPercent?: number; buyScope?: EngineScope; getScope?: EngineScope; } export interface EngineUnit { lineId: string; variantId: string; productId: string; collectionIds: string[]; price: number } export interface EngineApplication { offerId: string; discount: number; units: EngineUnit[]; getUnits: EngineUnit[] | null } export function bundleDiscount(regular: number, discountType: string, value: number): number; export function applyOffers(units: EngineUnit[], offers: EngineOffer[]): EngineApplication[]; export function allocateByLine(apps: EngineApplication[], options?: { bxgyGetUnitsOnly?: boolean }): Map; export function largestRemainderCents(amounts: number[]): number[]; export function toUnits(lines: { id: string; variantId: string; productId: string; collectionIds?: string[]; unitPrice: number; quantity: number }[]): EngineUnit[];