/** * 读取订单行规格:优先 OS v2 的 product_sku.option,回落 legacy product_option_item。 * * @example * getLineProductOptions({ product_sku: { option: [{ name: 'Large' }] } }); * // => [{ name: 'Large' }] */ export declare function getLineProductOptions(line?: Record | null): any[]; /** * 读取 booking detail 规格:优先 product_sku.option,回落 legacy product_option_item。 * * @example * getDetailProductOptions({ product_sku: { option: [{ id: 1 }] } }); */ export declare function getDetailProductOptions(detail?: Record | null): any[]; /** * 计算单个规格项单价合计:add_price/price × num。 * * @example * normalizeOptionUnitPrice({ add_price: 79.2, num: 1 }); // 79.2 */ export declare function normalizeOptionUnitPrice(option?: { add_price?: any; price?: any; num?: any; quantity?: any; } | null): number; /** * 计算订单行规格加价合计,对齐 OS sumOptionUnitPrice。 * * @example * sumLineOptionUnitPrice({ product_sku: { option: [{ add_price: 2, num: 3 }] } }); // 6 */ export declare function sumLineOptionUnitPrice(line?: Record | null): number; /** * 将 OS 规格项映射为购物车 UI 可直接消费的 shape(name / price / num)。 * * @example * normalizeOptionForDisplay({ name: 'Large', add_price: 1, num: 2 }); */ export declare function normalizeOptionForDisplay(option: any): any; /** * 构造 updateOrderProduct 所需的 product_sku patch。 * * @example * buildProductSkuPatch(line, [{ option_group_item_id: 1, add_price: 2, num: 1 }]); */ export declare function buildProductSkuPatch(line: Record | null | undefined, options: any[]): Record; /** * 解析编辑 patch 里的规格项:优先 product_sku.option,其次 legacy product_option_item,最后回落行内规格。 * * @example * resolvePatchProductOptions(orderLine, { product_sku: { option: [{ id: 1 }] } }); */ export declare function resolvePatchProductOptions(orderLine?: Record | null, productPatch?: Record | null): any[];