import type { AdaptProductSizes, ComposePurchaseChannels, GetAttributesBySizeId } from './types/index.js'; /** * Generate an object with a composed key like size#scale#merchantId, which will be * unique per product/merchant. * * @example * ``` * const purchaseChannels = composePurchaseChannels(variants); * Result of purchaseChannels === { * '21#206#10973': 0, * '23#206#10973': 0, * '25#206#10973': 0, * '27#206#10973': 0 * } * * ``` * * @param variants - [[]] Product variants to add additional info to sizes. * * @returns With keys (size#scale#merchantId), where the value represents a purchaseChannel. */ export declare const composePurchaseChannels: ComposePurchaseChannels; /** * Construct attributes for a given size, using the respective variant. * * @example * ``` * const attributes = getAttributesBySizeId(sizeId, variants); * Result of attributes === { * Size: '23', * SizeDescription: '37', * Scale: '206', * ScaleDescription: 'Italy', * ScaleAbbreviation: 'IT' * } * * ``` * * @param sizeId - Size id. * @param variants - Variants to fill the respective size attributes. * * @returns Size attributes of the given size. */ export declare const getAttributesBySizeId: GetAttributesBySizeId; /** * Returns a array with all sizes adapted to fit all site areas, for the sake of * consistency. * * @example * ``` * const sizes = adaptProductSizes(sizes, variants); * Result of sizes === [ * { * id: 21, * isOneSize: false, * name: '36', * scale: 206, * scaleAbbreviation: 'IT', * scaleDescription: 'Italy', * stock: [{ * merchantId: 10973, * quantity: 1, * price: { formatted: [Object] }, * purchaseChannel: 0 * }] * }, * { * id: 27, * isOneSize: false, * name: '39', * scale: 206, * scaleAbbreviation: 'IT', * scaleDescription: 'Italy', * stock: {...} * } * ]; * * ``` * * @param sizes - Product sizes to adapt. * @param variants - [[]] Product variants to add additional info to sizes. * * @returns Sizes adapted. */ declare const adaptProductSizes: AdaptProductSizes; export default adaptProductSizes;