import { BigNumberInput, CartLineItemDTO } from "@medusajs/framework/types";
/**
 * The properties of a new line item that determine whether it can be merged
 * into an existing cart line item.
 */
export interface MatchableLineItem {
    metadata?: Record<string, unknown> | null;
    unit_price?: BigNumberInput;
    is_custom_price?: boolean;
}
type ExistingLineItem = Pick<CartLineItemDTO, "metadata" | "unit_price" | "is_custom_price">;
/**
 * The line item fields that must be selected when looking for existing cart
 * line items a new item can be merged into.
 */
export declare const lineItemFieldsForMerging: string[];
/**
 * Finds the line item, among the existing items of the same variant, that a new
 * item should be merged into. Items are merged when their metadata matches and
 * either both carry the same custom price, or neither has a custom price.
 */
export declare function findMatchingLineItem<T extends ExistingLineItem>(existingItems: T[] | undefined, newItem: MatchableLineItem): T | undefined;
export {};
//# sourceMappingURL=find-matching-line-item.d.ts.map