import { Product } from '@salla.sa/twilight/types/common';
import { OrderEditItem, OrderEditPayload, OrderEditPayloadAddItem, OrderEditProductOption, OrderEditSelectedOptions } from './interfaces';
export type TrackedOrderEditPayloadAddItem = OrderEditPayloadAddItem & {
    itemId: string | number;
};
export type OrderEditPayloadState = {
    items: {
        update: OrderEditPayload['items']['update'];
        remove: OrderEditPayload['items']['remove'];
        add: TrackedOrderEditPayloadAddItem[];
    };
};
export declare function cloneOrderEditProduct<T>(product: T): T;
export declare function buildSavePayload(payload: OrderEditPayloadState): OrderEditPayload;
export declare function createAddedOrderItem(product: Product, quantity: number, optionDefinitions: OrderEditProductOption[], selectedOptions?: OrderEditSelectedOptions): OrderEditItem;
export declare function getOrderItemSelectedOptions(item?: OrderEditItem): OrderEditSelectedOptions;
export declare function findMergeableItem(items: OrderEditItem[], productId: number | string, selectedOptions?: OrderEditSelectedOptions): OrderEditItem | undefined;
export declare function getOrderEditProductMaxQuantity(product?: Pick<Product, 'max_quantity' | 'max_quantity_per_order'> | null): number | undefined;
export declare function clampOrderEditQuantity(quantity: number, maxQuantity?: number): number;
export declare function patchOrderItem(item: OrderEditItem, quantity: number, optionDefinitions?: OrderEditProductOption[], selectedOptions?: OrderEditSelectedOptions): OrderEditItem;
export declare function updateOrderItems(items: OrderEditItem[], itemId: string | number, quantity: number, optionDefinitions?: OrderEditProductOption[], selectedOptions?: OrderEditSelectedOptions): OrderEditItem[];
export declare function removeOrderItems(items: OrderEditItem[], itemId: string | number): OrderEditItem[];
export declare function mergePayloadItems(items: OrderEditPayloadState['items'], patch: Partial<OrderEditPayloadState['items']>): OrderEditPayloadState['items'];
export declare function upsertPayloadUpdateList(updateList: OrderEditPayload['items']['update'], itemId: string | number, quantity: number, options?: OrderEditSelectedOptions): OrderEditPayload['items']['update'];
export declare function updateAddedPayloadList(addList: TrackedOrderEditPayloadAddItem[], itemId: string | number, quantity: number, options?: OrderEditSelectedOptions): TrackedOrderEditPayloadAddItem[];
