import { IBuybackLogic, IBuybackPrice, ICardFinishTag, ICardPricesResult, ILangOption, ITcgAttributes, ITcgExternalServiceParams, ItemNameVariantEnum } from '../Interfaces/TCG'; import { TCGCardFinishEnum } from '../Interfaces/TCG'; import { IIndexedDeclinationAlgolia } from '../Interfaces/Algolia'; import IInventoryItem from '../Interfaces/Product/IInventoryItem'; import { ICartItem, IIndexedDeclination } from '../Interfaces/Cart'; import IAttribute from '../Interfaces/Attribute'; import IDeclination, { IDeclinationAttribute } from '../Interfaces/Declination'; import IProduct from '../Interfaces/Product'; import IStore from '../Interfaces/Store'; import ITranslation from '../Interfaces/Translation'; export declare const getDefaultTcgExternalServiceParams: () => ITcgExternalServiceParams; /** * Get show order for a given value * @param finishAttrValue */ export declare const getTcgFinishAttrOrder: (finishAttrValue?: TCGCardFinishEnum) => number; export declare const getGradientForFinish: (finish: TCGCardFinishEnum) => "normal" | "other" | "multi" | "cold" | "gold"; /** * Get currently available declinations, ordered by finish attribute (TCG), and by current POS space lang (language attribute TCG) * @param declinationData - Array of data used to order entries + full entry to return * @param locale * @param allInventories */ export declare const filterAndOrderDeclinations: (declinationData: { sku: string; attributes: { [key: string]: string[]; }; fullDecli: T; }[] | undefined, locale: string | undefined, allInventories: IInventoryItem[], skipInventoryCheck?: boolean) => T[]; /** * Construct all options for Language attribute (TCG), based on available declinations * @param declinations * @param allTcgAttrLabels All constructed labels based on expected TCG attributes * @param locale Current POS locale * @param defaultLangToReturn Optionnal. If a default value should be returned, even if declination array is empty. Corresponds to the value for the specific language attribute (ex. tcg_lang_en) */ export declare const constructAllLangOptions: (declinations: IIndexedDeclinationAlgolia[] | IIndexedDeclination[], allTcgAttrLabels: ITcgAttributes | undefined, locale: string | undefined, defaultLangToReturn?: string) => ILangOption[]; /** * Construct all unique finish and condition attribute combinations (TCG), based on available declinations * @param declinations * @param allTcgAttrLabels */ export declare const constructAllFinishOptions: (declinations: IIndexedDeclinationAlgolia[] | IIndexedDeclination[], allTcgAttrLabels: ITcgAttributes | undefined, locale: string | undefined) => ICardFinishTag[]; /** * Get set label for a given card attributes in specified locale * @param prodAttributes * @param allAttributes * @param locale */ export declare const getProductSetLabel: (prodAttributes: { [key: string]: string[]; } | undefined, allAttributes: IAttribute[], locale: string | undefined) => string; /** * Get set label ITranslation array for a given card attributes * @param prodAttributes Indexed product attributes to check * @param allAttributes Full IAttribute array * @param spaceSupportedLocales Optionnal. Defaults to ['fr', 'en'] */ export declare const getProductSetLabelTranslationObj: (prodAttributes: { [key: string]: string[]; } | undefined, allAttributes: IAttribute[], spaceSupportedLocales?: string[]) => ITranslation[]; /** * Get first found declination from list where passed attribute values found in decli * @param decliList * @param attributesToCheck Values of chosen TCG attributes to check for in decli. */ export declare const findCorrespondingDecliByAttributes: (decliList: T[], attributesToCheck: { [attrSlug: string]: string | undefined; }) => T | undefined; /** * Construct sku for declinations from parent product slug and TCG attributes (one segment per attribute's * default_tag, in the order given, e.g. ___) * @param baseSlug The parent product slug * @param declinationsToUse Array of declinations to use, in Addio DeclinationAttribut form */ export declare const constructTcgSkuFromAttributes: (baseSlug: string, declinationsToUse: IDeclinationAttribute[]) => string; /** * Construct declination attributes (TCG finish / condition / language) based on a cart item's own attributes * @param itemAttributes The cart item's attributes to check */ export declare const constructTcgDeclinationAttributesFromCartItem: (itemAttributes: ICartItem['attributes'] | undefined) => IDeclinationAttribute[]; /** * Build a new declination for a TCG product variant that doesn't exist yet on the product, based on a cart item * that references it. Returns undefined if the item isn't a valid TCG variant reference (missing attributes, or * the resulting sku doesn't actually correspond to the cart item's sku) * @param item The cart item referencing the missing variant * @param productData The parent TCG product */ export declare const constructTcgDeclinationFromCartItem: (item: ICartItem, productData: IProduct) => IDeclination | undefined; /** * Build an empty (no quantities) inventory item for a newly created TCG declination * @param declination The declination the inventory item is for * @param productData The parent product * @param stores All current stores for space. Used to poppulate inventories property * @param userId The current user behind the request */ export declare const constructEmptyTcgInventoryItem: (declination: IDeclination, productData: IProduct, stores: IStore[], userId: string) => IInventoryItem; /** * Get the available inventory for the currently selected store (found in local storage) * @param inventoryItem */ export declare const getAvailableInventoryForCurrentStore: (inventoryItem: IInventoryItem) => number; /** * Construct product or decli name to show (mostly for cart item retroactions) * @param item - The cart item * @param locale * @param type - Which name(s) to use (either parent name, decli name, or both) */ export declare const getProductNameToUse: (item: ICartItem, locale: string | undefined, type?: ItemNameVariantEnum) => string; /** * Construct labels for TCG Service attributes from full array of space attributes * @param allAttributes */ export declare const constructTcgAttributeLabels: (allAttributes: IAttribute[]) => ITcgAttributes; /** * Construct and return attribute string for cart item based on TCG attribute values * @param itemAttributes Current item attributes * @param allTcgAttributes All potential TCG attribute values * @returns {string} Pertinent attribute values seperated by '-'. Attributes options returned are : FINISH - CONDITION - LANG */ export declare const getTcgAttributesToShow: (itemAttributes: ICartItem['attributes'], allTcgAttributes: ITcgAttributes | undefined) => string; /** * Calculate buyback prices for a list of tcg card price data * @param cards The tcg card prices to check */ export declare function getBuybackPricesForTcgCards(logicReferenceObj: IBuybackLogic, cards: ICardPricesResult): { [slug: string]: IBuybackPrice[]; };