import { IkasDisplayedPackage, IkasOrder } from "../../../storefront-models/src"; /** * Initializes an IkasOrder by filtering deleted line items and enriching adjustments and gift package lines with currency information. * * @ai-category Order * @ai-related getIkasOrderDistinctItemCount, getIkasOrderTotalItemCount * * @param data - The raw IkasOrder data to initialize * @returns A new IkasOrder object with filtered line items and enriched currency fields * * @example * ```typescript * import { initIkasOrder } from "@ikas/bp-storefront"; * const order = initIkasOrder(rawOrderData); * ``` */ export declare function initIkasOrder(data: IkasOrder): IkasOrder; /** * Returns the total amount covered by the gift cards (and store credits) applied to the order or cart. * * This is a derived value, the API does not return it: it sums `amount` over `order.giftCardLines`. * Subtract it from `order.totalFinalPrice` to get the amount still due. * * @ai-category Order, Cart * @ai-related removeGiftCardLine, saveCouponCode * * @param order - The IkasOrder or IkasCart holding the gift card lines * @returns The summed gift card amount, or 0 when no gift card is applied * * @example * ```typescript * import { getIkasOrderGiftCardTotalPrice } from "@ikas/bp-storefront"; * * const giftCardTotal = getIkasOrderGiftCardTotalPrice(cart); * const remainingPrice = cart.totalFinalPrice - giftCardTotal; * ``` */ export declare function getIkasOrderGiftCardTotalPrice(order: IkasOrder): number; /** * Returns the number of distinct line items in the order. * * @ai-category Order, OrderDetail * @ai-related getIkasOrderTotalItemCount, getIkasOrderUnfullfilledItems * * @param order - The IkasOrder to count distinct items for * @returns The number of distinct order line items * * @example * ```typescript * import { getIkasOrderDistinctItemCount } from "@ikas/bp-storefront"; * const distinctCount = getIkasOrderDistinctItemCount(order); * ``` */ export declare function getIkasOrderDistinctItemCount(order: IkasOrder): number; /** * Returns the total quantity of all line items in the order, summing individual item quantities. * * @ai-category Order, OrderDetail * @ai-related getIkasOrderDistinctItemCount, getIkasOrderUnfullfilledItems * * @param order - The IkasOrder to count total items for * @returns The sum of quantities across all order line items * * @example * ```typescript * import { getIkasOrderTotalItemCount } from "@ikas/bp-storefront"; * const totalCount = getIkasOrderTotalItemCount(order); * ``` */ export declare function getIkasOrderTotalItemCount(order: IkasOrder): number; /** * Builds the list of displayed packages for an order, including unfulfilled items, active packages, and cancelled items as separate grouped entries. * * @ai-category Order, Shipping * @ai-related getIkasOrderUnfullfilledItems, getIkasOrderPackageStatusTranslation * * @param order - The IkasOrder to build displayed packages for * @returns An array of IkasDisplayedPackage objects representing the order's package groups * * @example * ```typescript * import { getIkasOrderDisplayedPackages } from "@ikas/bp-storefront"; * const packages = getIkasOrderDisplayedPackages(order); * packages.forEach(pkg => console.log(pkg.statusTranslation)); * ``` */ export declare function getIkasOrderDisplayedPackages(order: IkasOrder): IkasDisplayedPackage[]; /** * Returns order line items that are eligible for refund based on item status and the merchant's refund day limit settings. * * @ai-category Order, Payment * @ai-related isIkasOrderRefundable, getIkasOrderRefundedItems * * @param order - The IkasOrder to retrieve refundable items from * @returns An array of order line items eligible for refund, or an empty array if refunds are disabled * * @example * ```typescript * import { getIkasOrderRefundableItems } from "@ikas/bp-storefront"; * const refundableItems = getIkasOrderRefundableItems(order); * ``` */ export declare function getIkasOrderRefundableItems(order: IkasOrder): import("../../../storefront-models/src").IkasOrderLineItem[]; /** * Checks whether the order has any line items that are eligible for refund and still have refundable quantity remaining. * * @ai-category Order, Payment * @ai-related getIkasOrderRefundableItems, getIkasOrderRefundedItems * * @param order - The IkasOrder to check refundability for * @returns True if at least one line item can be refunded, false otherwise * * @example * ```typescript * import { isIkasOrderRefundable } from "@ikas/bp-storefront"; * if (isIkasOrderRefundable(order)) { * // show refund button * } * ``` */ export declare function isIkasOrderRefundable(order: IkasOrder): boolean; /** * Returns order line items that have not yet been fulfilled. * * @ai-category Order, Shipping * @ai-related getIkasOrderDisplayedPackages, getIkasOrderRefundedItems * * @param order - The IkasOrder to filter unfulfilled items from * @returns An array of order line items with status "UNFULFILLED" * * @example * ```typescript * import { getIkasOrderUnfullfilledItems } from "@ikas/bp-storefront"; * const unfulfilledItems = getIkasOrderUnfullfilledItems(order); * ``` */ export declare function getIkasOrderUnfullfilledItems(order: IkasOrder): import("../../../storefront-models/src").IkasOrderLineItem[]; /** * Returns order line items that are in any refund-related status, including refunded, refund requested, accepted, or rejected. * * @ai-category Order, Payment * @ai-related getIkasOrderRefundableItems, isIkasOrderRefundable * * @param order - The IkasOrder to filter refunded items from * @returns An array of order line items in a refund-related status * * @example * ```typescript * import { getIkasOrderRefundedItems } from "@ikas/bp-storefront"; * const refundedItems = getIkasOrderRefundedItems(order); * ``` */ export declare function getIkasOrderRefundedItems(order: IkasOrder): import("../../../storefront-models/src").IkasOrderLineItem[]; /** * Calculates the total tax amount by summing all tax line prices on the order. * * @ai-category Order, Payment * @ai-related getIkasOrderFormattedTotalTax, getIkasOrderShippingTotal * * @param order - The IkasOrder to calculate total tax for * @returns The total tax amount as a number * * @example * ```typescript * import { getIkasOrderTotalTax } from "@ikas/bp-storefront"; * const totalTax = getIkasOrderTotalTax(order); * ``` */ export declare function getIkasOrderTotalTax(order: IkasOrder): number; /** * Returns the total tax amount formatted as a currency string using the order's currency code and symbol. * * @ai-category Order, Payment * @ai-related getIkasOrderTotalTax, getIkasOrderFormattedShippingTotal * * @param order - The IkasOrder to format total tax for * @returns A formatted currency string representing the total tax * * @example * ```typescript * import { getIkasOrderFormattedTotalTax } from "@ikas/bp-storefront"; * const formattedTax = getIkasOrderFormattedTotalTax(order); // e.g. "$12.50" * ``` */ export declare function getIkasOrderFormattedTotalTax(order: IkasOrder): string; /** * Calculates the total shipping cost by summing the final prices of all shipping lines on the order. * * @ai-category Order, Shipping * @ai-related getIkasOrderFormattedShippingTotal, getIkasOrderTotalTax * * @param order - The IkasOrder to calculate shipping total for * @returns The total shipping cost as a number * * @example * ```typescript * import { getIkasOrderShippingTotal } from "@ikas/bp-storefront"; * const shippingTotal = getIkasOrderShippingTotal(order); * ``` */ export declare function getIkasOrderShippingTotal(order: IkasOrder): number; /** * Returns the total shipping cost formatted as a currency string using the order's currency code and symbol. * * @ai-category Order, Shipping * @ai-related getIkasOrderShippingTotal, getIkasOrderFormattedTotalTax * * @param order - The IkasOrder to format shipping total for * @returns A formatted currency string representing the total shipping cost * * @example * ```typescript * import { getIkasOrderFormattedShippingTotal } from "@ikas/bp-storefront"; * const formattedShipping = getIkasOrderFormattedShippingTotal(order); // e.g. "$5.99" * ``` */ export declare function getIkasOrderFormattedShippingTotal(order: IkasOrder): string; /** * Returns the order's total final price (after discounts and adjustments) formatted as a currency string. * * @ai-category Order, Payment * @ai-related getIkasOrderFormattedTotalPrice, getIkasOrderFormattedTotalTax * * @param order - The IkasOrder to format total final price for * @returns A formatted currency string representing the total final price * * @example * ```typescript * import { getIkasOrderFormattedTotalFinalPrice } from "@ikas/bp-storefront"; * const formattedTotal = getIkasOrderFormattedTotalFinalPrice(order); // e.g. "$99.99" * ``` */ export declare function getIkasOrderFormattedTotalFinalPrice(order: IkasOrder): string; /** * Returns the order's total price (before adjustments) formatted as a currency string. * * @ai-category Order, Payment * @ai-related getIkasOrderFormattedTotalFinalPrice, getIkasOrderFormattedTotalTax * * @param order - The IkasOrder to format total price for * @returns A formatted currency string representing the total price * * @example * ```typescript * import { getIkasOrderFormattedTotalPrice } from "@ikas/bp-storefront"; * const formattedPrice = getIkasOrderFormattedTotalPrice(order); // e.g. "$120.00" * ``` */ export declare function getIkasOrderFormattedTotalPrice(order: IkasOrder): string; /** * Checks whether the order is associated with a registered customer (not a guest checkout). * * @ai-category Order, OrderDetail * @ai-related hasValidIkasOrderCustomerEmail, getIkasOrderCustomerFullName * * @param order - The IkasOrder to check for a customer * @returns True if the order has a non-guest customer with a valid ID, false otherwise * * @example * ```typescript * import { hasIkasOrderCustomer } from "@ikas/bp-storefront"; * if (hasIkasOrderCustomer(order)) { * // show customer details * } * ``` */ export declare function hasIkasOrderCustomer(order: IkasOrder): boolean; /** * Checks whether the order's customer has a valid email address. * * @ai-category Order, OrderDetail * @ai-related hasIkasOrderCustomer, getIkasOrderCustomerFullName * * @param order - The IkasOrder to validate customer email for * @returns True if the customer has a non-empty, valid email address, false otherwise * * @example * ```typescript * import { hasValidIkasOrderCustomerEmail } from "@ikas/bp-storefront"; * if (hasValidIkasOrderCustomerEmail(order)) { * // send confirmation email * } * ``` */ export declare function hasValidIkasOrderCustomerEmail(order: IkasOrder): boolean; /** * Returns the full name of the order's customer by combining first and last name. * * @ai-category Order, OrderDetail * @ai-related hasIkasOrderCustomer, hasValidIkasOrderCustomerEmail * * @param order - The IkasOrder to retrieve customer full name from * @returns The customer's full name as a string (first name + last name) * * @example * ```typescript * import { getIkasOrderCustomerFullName } from "@ikas/bp-storefront"; * const fullName = getIkasOrderCustomerFullName(order); // e.g. "John Doe" * ``` */ export declare function getIkasOrderCustomerFullName(order: IkasOrder): string; /** * Returns the order's last updated date formatted as a human-readable string. * * @ai-category Order, OrderHistory * @ai-related getIkasOrderFormattedOrderedAt * * @param order - The IkasOrder to format the updated date for * @returns A formatted date string representing when the order was last updated * * @example * ```typescript * import { getIkasOrderFormattedDate } from "@ikas/bp-storefront"; * const updatedAt = getIkasOrderFormattedDate(order); // e.g. "01/15/2025" * ``` */ export declare function getIkasOrderFormattedDate(order: IkasOrder): string; /** * Returns the order's placement date formatted as a human-readable string, or null if no ordered date exists. * * @ai-category Order, OrderHistory * @ai-related getIkasOrderFormattedDate * * @param order - The IkasOrder to format the ordered date for * @returns A formatted date string representing when the order was placed, or null if unavailable * * @example * ```typescript * import { getIkasOrderFormattedOrderedAt } from "@ikas/bp-storefront"; * const orderedAt = getIkasOrderFormattedOrderedAt(order); // e.g. "01/10/2025" or null * ``` */ export declare function getIkasOrderFormattedOrderedAt(order: IkasOrder): string | null; /** * Returns the translated display label for an order's package fulfillment status. * * @ai-category Order, Shipping * @ai-related getIkasOrderDisplayedPackages, getIkasOrderUnfullfilledItems * * @param order - The IkasOrder containing the orderPackageStatus to translate * @returns The translated status string, or an empty string if the status is unknown or missing * * @example * ```typescript * import { getIkasOrderPackageStatusTranslation } from "@ikas/bp-storefront"; * const statusLabel = getIkasOrderPackageStatusTranslation(order); // e.g. "Delivered" * ``` * * NOTE: Pass the `IkasOrder` directly — NOT an `IkasDisplayedPackage` returned by * `getIkasOrderDisplayedPackages()`. The function reads `order.orderPackageStatus` from the * order itself. */ export declare function getIkasOrderPackageStatusTranslation(order: IkasOrder): string; /** * Finds and returns the coupon-based adjustment applied to the order, if any. * * @ai-category Order, Payment * @ai-related getIkasOrderNonCouponAdjustments, getIkasOrderDisplayedAdjustments * * @param order - The IkasOrder to search for a coupon adjustment * @returns The coupon adjustment object, or undefined if no coupon was applied * * @example * ```typescript * import { getIkasOrderCouponAdjustment } from "@ikas/bp-storefront"; * const coupon = getIkasOrderCouponAdjustment(order); * if (coupon) { * console.log("Coupon applied:", coupon.couponId); * } * ``` */ export declare function getIkasOrderCouponAdjustment(order: IkasOrder): import("../../../storefront-models/src").IkasOrderAdjustment | undefined; /** * Returns all order adjustments that are not coupon-based (e.g., campaigns, promotions). * * @ai-category Order, Payment * @ai-related getIkasOrderCouponAdjustment, getIkasOrderDisplayedAdjustments * * @param order - The IkasOrder to filter non-coupon adjustments from * @returns An array of adjustments that do not have a coupon ID, or undefined if no adjustments exist * * @example * ```typescript * import { getIkasOrderNonCouponAdjustments } from "@ikas/bp-storefront"; * const promotions = getIkasOrderNonCouponAdjustments(order); * ``` */ export declare function getIkasOrderNonCouponAdjustments(order: IkasOrder): import("../../../storefront-models/src").IkasOrderAdjustment[] | undefined; /** * Extracts file IDs from order line item variants that have associated downloadable files, excluding refunded items. * * @ai-category Order, OrderDetail * @ai-related getIkasOrderRefundedItems, getIkasOrderDistinctItemCount * * @param order - The IkasOrder to extract product file IDs from * @returns An array of file ID strings for downloadable products * * @example * ```typescript * import { getIkasOrderProductFiles } from "@ikas/bp-storefront"; * const fileIds = getIkasOrderProductFiles(order); * ``` */ export declare function getIkasOrderProductFiles(order: IkasOrder): string[]; /** * Returns order adjustments meant for display, excluding free shipping adjustments and renaming interest-type adjustments with their display name. * * @ai-category Order, Payment * @ai-related getIkasOrderCouponAdjustment, getIkasOrderNonCouponAdjustments * * @param order - The IkasOrder to retrieve displayed adjustments from * @returns An array of adjusted order adjustment objects suitable for display, or undefined if no adjustments exist * * @example * ```typescript * import { getIkasOrderDisplayedAdjustments } from "@ikas/bp-storefront"; * const adjustments = getIkasOrderDisplayedAdjustments(order); * adjustments?.forEach(adj => console.log(adj.name)); * ``` */ export declare function getIkasOrderDisplayedAdjustments(order: IkasOrder): import("../../../storefront-models/src").IkasOrderAdjustment[] | undefined; /** * Generates the storefront URL path to the order detail page, including the route prefix. * * @ai-category Order, OrderHistory * @ai-related getIkasOrderFormattedDate, getIkasOrderFormattedOrderedAt * * @param order - The IkasOrder to generate the URL for * @returns The prefixed URL path string to the order detail page * * @example * ```typescript * import { getIkasOrderHref } from "@ikas/bp-storefront"; * const href = getIkasOrderHref(order); // e.g. "/en/account/orders/abc123" * ``` */ export declare function getIkasOrderHref(order: IkasOrder): string; /** * Returns a comma-separated string of all variant names from the order's line items. * * @ai-category Order, OrderDetail * @ai-related getIkasOrderDistinctItemCount, getIkasOrderTotalItemCount * * @param order - The IkasOrder to extract variant names from * @returns A comma-separated string of variant names * * @example * ```typescript * import { getIkasOrderVariantNames } from "@ikas/bp-storefront"; * const names = getIkasOrderVariantNames(order); // e.g. "Red T-Shirt, Blue Jeans" * ``` */ export declare function getIkasOrderVariantNames(order: IkasOrder): string;