import { IkasProductOption, IkasProductOptionSet } from "../../../../storefront-models/src"; /** * Sets child options for each option in the option set by linking options that have a required parent option. * * @ai-category ProductOptionSet * @ai-related getDisplayedOptions, initOptionValues, initProductOptionSetValues * * @param optionSet - The product option set whose options will have their child options populated. * @returns void * * @example * ```typescript * import { setChildOptions } from "@ikas/bp-storefront"; * setChildOptions(product.optionSet); * ``` */ export declare function setChildOptions(optionSet: IkasProductOptionSet): void; /** * Initializes the values for all options within the given product option set. * * @ai-category ProductOptionSet * @ai-related initProductOptionSetValues, setChildOptions, getDisplayedOptions * * @param optionSet - The product option set whose option values will be initialized. * @returns void * * @example * ```typescript * import { initOptionValues } from "@ikas/bp-storefront"; * initOptionValues(product.optionSet); * ``` */ export declare function initOptionValues(optionSet: IkasProductOptionSet): void; /** * Returns the top-level displayed options from an option set, sorted by their order, excluding child options that depend on a parent. * * @ai-category ProductOptionSet * @ai-related setChildOptions, hasValidProductOptionSetValues, initOptionValues * * @param optionSet - The product option set to retrieve displayed options from. * @returns An array of top-level product options sorted by their order property. * * @example * ```typescript * import { getDisplayedOptions } from "@ikas/bp-storefront"; * const options = getDisplayedOptions(product.optionSet); * options.forEach(option => console.log(option.name)); * ``` */ export declare function getDisplayedOptions(optionSet: IkasProductOptionSet): IkasProductOption[]; /** * Checks whether the option set has any displayed (top-level) options. * * @ai-category ProductOptionSet * @ai-related getDisplayedOptions, hasValidProductOptionSetValues * * @param optionSet - The product option set to check. * @returns True if there is at least one displayed option, false otherwise. * * @example * ```typescript * import { hasDisplayedOptions } from "@ikas/bp-storefront"; * if (hasDisplayedOptions(product.optionSet)) { * // render option selector * } * ``` */ export declare function hasDisplayedOptions(optionSet: IkasProductOptionSet): boolean; /** * Initializes the values for all options in the product option set by delegating to the option-level initializer. * * @ai-category ProductOptionSet * @ai-related initOptionValues, setChildOptions, hasValidProductOptionSetValues * * @param optionSet - The product option set whose option values will be initialized. * @returns void * * @example * ```typescript * import { initProductOptionSetValues } from "@ikas/bp-storefront"; * initProductOptionSetValues(product.optionSet); * ``` */ export declare function initProductOptionSetValues(optionSet: IkasProductOptionSet): void; /** * Checks whether all displayed options in the product option set have valid values selected. * * @ai-category ProductOptionSet * @ai-related getDisplayedOptions, initProductOptionSetValues, initOptionValues * * @param optionSet - The product option set to validate. * @returns True if every displayed option has valid values, false otherwise. * * @example * ```typescript * import { hasValidProductOptionSetValues } from "@ikas/bp-storefront"; * if (hasValidProductOptionSetValues(product.optionSet)) { * // proceed to add to cart * } * ``` */ export declare function hasValidProductOptionSetValues(optionSet: IkasProductOptionSet): boolean;