///
import type { AssemblyOptionInput, ItemAdditionalInfo, MarketingData, SKUSpecification } from '../typings';
export interface Context {
/**
* @deprecated Use `addItems` instead
*/
addItem: AddItemFn;
addItems: AddItemsFn;
updateQuantity: UpdateQuantityFn;
removeItem: RemoveItemFn;
setManualPrice: SetManualPriceFn;
}
export type AddItemItemParam = {
id: string;
seller: string;
quantity: number;
options?: AssemblyOptionInput[];
index?: number;
} & OptimisticItemInfo;
type OptimisticItemInfo = {
productId?: string;
name?: string;
skuName?: string;
skuSpecifications?: SKUSpecification[];
imageUrl?: string;
price?: number;
listPrice?: number;
sellingPrice?: number;
measurementUnit?: string;
unitMultiplier?: number;
detailUrl?: string;
availability?: string;
additionalInfo?: ItemAdditionalInfo;
};
export type AddItemsOptions = {
marketingData?: Partial;
salesChannel?: string;
allowedOutdatedData?: string[];
splitItem?: boolean;
};
export type AddItemsFn = (items: AddItemItemParam[], options?: AddItemsOptions) => PromiseLike;
export type AddItemFn = (items: AddItemItemParam[], marketingData?: Partial, salesChannel?: string) => void;
interface ItemIdentificationById {
id: string;
uniqueId?: string;
index?: number;
}
interface ItemIdentificationByUniqueId {
id?: string;
uniqueId: string;
index?: number;
}
interface ItemIdentificationByIndex {
id?: string;
uniqueId?: string;
index: number;
}
type ItemIdentification = ItemIdentificationById | ItemIdentificationByUniqueId | ItemIdentificationByIndex;
type UpdateQuantityItemParam = {
seller: string;
quantity: number;
} & ItemIdentification;
export type UpdateQuantityOptions = {
allowedOutdatedData?: string[];
splitItem?: boolean;
};
export type UpdateQuantityFn = (item: UpdateQuantityItemParam, options?: UpdateQuantityOptions) => PromiseLike;
type RemoveItemParam = {
seller: string;
} & ItemIdentification;
export type RemoveItemFn = (input: RemoveItemParam, options?: UpdateQuantityOptions) => void;
export type SetManualPriceFn = (price: number, itemIndex: number) => void;
export declare const OrderItemsContext: import("react").Context;
export declare const useOrderItems: () => Context;
export {};
//# sourceMappingURL=OrderItemsContext.d.ts.map