import type { Product } from '../../../api/commerce/common/product.js'; import { type Template, type TemplateCondition } from '../../templates/templates-manager.js'; export type ProductTemplate = Template; export type ProductTemplateCondition = TemplateCondition; export interface ProductTemplatesManager { /** * Registers any number of product templates in the manager. * @param templates (...Template) A list of templates to register. */ registerTemplates: (...templates: Template[]) => void; /** * Selects the highest priority template for which the given product satisfies all conditions. * In the case where satisfied templates have equal priority, the template that was registered first is returned. * @param product (Product) The product for which to select a template. * @returns (Content) The content of the selected template, or null if no template can be selected for the given product. */ selectTemplate: (product: Product) => Content | null; /** * Selects the highest priority link template for which the given product satisfies all conditions. * In the case where satisfied templates have equal priority, the template that was registered first is returned. * @param product (Product) The product for which to select a template. * @returns (Content) The content of the selected template, or null if no template can be selected for the given product. */ selectLinkTemplate: (product: Product) => LinkContent | null; } /** * A manager in which product templates can be registered and selected based on a list of conditions and a priority index. * @returns (ProductTemplatesManager) A new product template manager. */ export declare function buildProductTemplatesManager(): ProductTemplatesManager;