import { IkasProductOption, IkasProductOptionSelectValue } from "../../../../../storefront-models/src"; /** * Returns the visible child options of a product option, filtered by selection state and sorted by order. * * @ai-category ProductOption, Customization * @ai-related hasValidProductOptionValues, clearValues, initIkasProductOptionValues * * @param option - The parent product option whose child options to retrieve. * @returns An array of child options that should be displayed based on current selections. * * @example * ```typescript * import { getDisplayedChildOptions } from "@ikas/bp-storefront"; * const visibleChildren = getDisplayedChildOptions(option); * ``` */ export declare function getDisplayedChildOptions(option: IkasProductOption): IkasProductOption[]; /** * Checks whether a product option and all its displayed child options have valid values based on their type and settings. * * @ai-category ProductOption, Customization * @ai-related hasError, getDisplayedChildOptions, isProductOptionSelectValueSelected * * @param option - The product option to validate. * @returns True if the option and all its child options have valid values, false otherwise. * * @example * ```typescript * import { hasValidProductOptionValues } from "@ikas/bp-storefront"; * const isValid = hasValidProductOptionValues(option); * if (!isValid) { * console.log("Please fill in all required option fields."); * } * ``` */ export declare function hasValidProductOptionValues(option: IkasProductOption): boolean; /** * Determines whether a product option has a validation error by checking if its values are invalid. * * @ai-category ProductOption, Customization * @ai-related hasValidProductOptionValues, getDisplayedChildOptions * * @param option - The product option to check for errors. * @returns True if the option has invalid values, false if all values are valid. * * @example * ```typescript * import { hasError } from "@ikas/bp-storefront"; * if (hasError(option)) { * console.log("This option has a validation error."); * } * ``` */ export declare function hasError(option: IkasProductOption): boolean; /** * Sets the values of a product option and clears child option values when the parent is cleared. * * @ai-category ProductOption, Customization * @ai-related clearValues, setTextValue, setCheckboxValue, selectValue * * @param option - The product option to update. * @param values - The new values to assign to the option. * * @example * ```typescript * import { setValues } from "@ikas/bp-storefront"; * setValues(option, ["value1", "value2"]); * ``` */ export declare function setValues(option: IkasProductOption, values: string[]): void; /** * Retrieves the text value of a TEXT or TEXT_AREA product option, returning an empty string for other types. * * @ai-category ProductOption, Customization * @ai-related setTextValue, isTextOption, isTextAreaOption * * @param option - The product option to get the text value from. * @returns The text value string, or an empty string if the option is not a text type. * * @example * ```typescript * import { getTextValue } from "@ikas/bp-storefront"; * const text = getTextValue(option); * ``` */ export declare function getTextValue(option: IkasProductOption): string; /** * Sets the text value of a product option, or clears it if no value is provided. * * @ai-category ProductOption, Customization * @ai-related getTextValue, isTextOption, isTextAreaOption, setValues * * @param option - The product option to update. * @param value - The text value to set, or undefined to clear the value. * * @example * ```typescript * import { setTextValue } from "@ikas/bp-storefront"; * setTextValue(option, "Custom engraving text"); * ``` */ export declare function setTextValue(option: IkasProductOption, value?: string): void; /** * Checks whether a checkbox product option is currently checked (has a "true" value). * * @ai-category ProductOption, Customization * @ai-related setCheckboxValue, isCheckboxOption * * @param option - The product option to check. * @returns True if the option is a checkbox type and is checked, false otherwise. * * @example * ```typescript * import { isChecked } from "@ikas/bp-storefront"; * if (isChecked(option)) { * console.log("Gift wrapping is selected."); * } * ``` */ export declare function isChecked(option: IkasProductOption): boolean; /** * Sets the checked state of a checkbox product option. * * @ai-category ProductOption, Customization * @ai-related isChecked, isCheckboxOption, setValues * * @param option - The checkbox product option to update. * @param checked - Whether the checkbox should be checked or unchecked. * * @example * ```typescript * import { setCheckboxValue } from "@ikas/bp-storefront"; * setCheckboxValue(option, true); * ``` */ export declare function setCheckboxValue(option: IkasProductOption, checked: boolean): void; /** * Toggles the selection of a choice value on a product option, respecting max selection limits. * * @ai-category ProductOption, Customization * @ai-related isProductOptionSelectValueSelected, isChoiceOption, isChoiceOptionSelectType, isChoiceOptionSwatchType, isChoiceOptionBoxType * * @param option - The product option to update. * @param value - The select value to toggle on or off. * * @example * ```typescript * import { selectValue } from "@ikas/bp-storefront"; * selectValue(option, selectedValue); * ``` */ export declare function selectValue(option: IkasProductOption, value: IkasProductOptionSelectValue): void; /** * Checks whether a product option is of type TEXT (single-line text input). * * @ai-category ProductOption, Customization * @ai-related isTextAreaOption, getTextValue, setTextValue * * @param option - The product option to check. * @returns True if the option type is TEXT, false otherwise. * * @example * ```typescript * import { isTextOption } from "@ikas/bp-storefront"; * if (isTextOption(option)) { * console.log("Render a single-line text input."); * } * ``` */ export declare function isTextOption(option: IkasProductOption): boolean; /** * Checks whether a product option is of type TEXT_AREA (multi-line text input). * * @ai-category ProductOption, Customization * @ai-related isTextOption, getTextValue, setTextValue * * @param option - The product option to check. * @returns True if the option type is TEXT_AREA, false otherwise. * * @example * ```typescript * import { isTextAreaOption } from "@ikas/bp-storefront"; * if (isTextAreaOption(option)) { * console.log("Render a multi-line textarea input."); * } * ``` */ export declare function isTextAreaOption(option: IkasProductOption): boolean; /** * Checks whether a product option is of type CHECKBOX. * * @ai-category ProductOption, Customization * @ai-related isChecked, setCheckboxValue * * @param option - The product option to check. * @returns True if the option type is CHECKBOX, false otherwise. * * @example * ```typescript * import { isCheckboxOption } from "@ikas/bp-storefront"; * if (isCheckboxOption(option)) { * console.log("Render a checkbox input."); * } * ``` */ export declare function isCheckboxOption(option: IkasProductOption): boolean; /** * Checks whether a product option is of type COLOR_PICKER. * * @ai-category ProductOption, Customization * @ai-related isChoiceOption, isChoiceOptionSwatchType * * @param option - The product option to check. * @returns True if the option type is COLOR_PICKER, false otherwise. * * @example * ```typescript * import { isColorPickerOption } from "@ikas/bp-storefront"; * if (isColorPickerOption(option)) { * console.log("Render a color picker input."); * } * ``` */ export declare function isColorPickerOption(option: IkasProductOption): boolean; /** * Checks whether a product option is of type CHOICE (select, swatch, or box). * * @ai-category ProductOption, Customization * @ai-related isChoiceOptionSelectType, isChoiceOptionSwatchType, isChoiceOptionBoxType, selectValue * * @param option - The product option to check. * @returns True if the option type is CHOICE, false otherwise. * * @example * ```typescript * import { isChoiceOption } from "@ikas/bp-storefront"; * if (isChoiceOption(option)) { * console.log("Render a choice-based selection UI."); * } * ``` */ export declare function isChoiceOption(option: IkasProductOption): boolean; /** * Checks whether a product option is a CHOICE type with SELECT display style (dropdown). * * @ai-category ProductOption, Customization * @ai-related isChoiceOption, isChoiceOptionSwatchType, isChoiceOptionBoxType, selectValue * * @param option - The product option to check. * @returns True if the option is a CHOICE type with SELECT display, false otherwise. * * @example * ```typescript * import { isChoiceOptionSelectType } from "@ikas/bp-storefront"; * if (isChoiceOptionSelectType(option)) { * console.log("Render a dropdown select input."); * } * ``` */ export declare function isChoiceOptionSelectType(option: IkasProductOption): boolean; /** * Checks whether a product option is a CHOICE type with SWATCH display style (color/image swatches). * * @ai-category ProductOption, Customization * @ai-related isChoiceOption, isChoiceOptionSelectType, isChoiceOptionBoxType, selectValue * * @param option - The product option to check. * @returns True if the option is a CHOICE type with SWATCH display, false otherwise. * * @example * ```typescript * import { isChoiceOptionSwatchType } from "@ikas/bp-storefront"; * if (isChoiceOptionSwatchType(option)) { * console.log("Render color/image swatches."); * } * ``` */ export declare function isChoiceOptionSwatchType(option: IkasProductOption): boolean; /** * Checks whether a product option is a CHOICE type with BOX display style (button boxes). * * @ai-category ProductOption, Customization * @ai-related isChoiceOption, isChoiceOptionSelectType, isChoiceOptionSwatchType, selectValue * * @param option - The product option to check. * @returns True if the option is a CHOICE type with BOX display, false otherwise. * * @example * ```typescript * import { isChoiceOptionBoxType } from "@ikas/bp-storefront"; * if (isChoiceOptionBoxType(option)) { * console.log("Render clickable box options."); * } * ``` */ export declare function isChoiceOptionBoxType(option: IkasProductOption): boolean; /** * Checks whether a product option is of type DATE_PICKER. * * @ai-category ProductOption, Customization * @ai-related isTextOption, isCheckboxOption, isChoiceOption, isFileOption * * @param option - The product option to check. * @returns True if the option type is DATE_PICKER, false otherwise. * * @example * ```typescript * import { isDatePickerOption } from "@ikas/bp-storefront"; * if (isDatePickerOption(option)) { * console.log("Render a date picker input."); * } * ``` */ export declare function isDatePickerOption(option: IkasProductOption): boolean; /** * Checks whether a product option is of type FILE (file upload). * * @ai-category ProductOption, Customization * @ai-related isImageOption, productOptionFileUpload * * @param option - The product option to check. * @returns True if the option type is FILE, false otherwise. * * @example * ```typescript * import { isFileOption } from "@ikas/bp-storefront"; * if (isFileOption(option)) { * console.log("Render a file upload input."); * } * ``` */ export declare function isFileOption(option: IkasProductOption): boolean; /** * Checks whether a product option is of type IMAGE. * * @ai-category ProductOption, Customization * @ai-related isFileOption, productOptionFileUpload * * @param option - The product option to check. * @returns True if the option type is IMAGE, false otherwise. * * @example * ```typescript * import { isImageOption } from "@ikas/bp-storefront"; * if (isImageOption(option)) { * console.log("Render an image upload input."); * } * ``` */ export declare function isImageOption(option: IkasProductOption): boolean; /** * Returns the formatted price string for a product option using its currency settings. * * @ai-category ProductOption, ProductDetail * @ai-related getProductOptionFormattedLabel * * @param option - The product option whose price to format. * @returns A formatted currency string representing the option's price. * * @example * ```typescript * import { getProductOptionFormattedPrice } from "@ikas/bp-storefront"; * const priceText = getProductOptionFormattedPrice(option); * // e.g. "$5.00" * ``` */ export declare function getProductOptionFormattedPrice(option: IkasProductOption): string; /** * Returns a formatted label for a product option including its name, required indicator, and price if applicable. * * @ai-category ProductOption, ProductDetail * @ai-related getProductOptionFormattedPrice * * @param option - The product option whose label to format. * @returns A formatted string like "Option Name*" or "Option Name ($5.00)". * * @example * ```typescript * import { getProductOptionFormattedLabel } from "@ikas/bp-storefront"; * const label = getProductOptionFormattedLabel(option); * // e.g. "Gift Wrapping* ($5.00)" * ``` */ export declare function getProductOptionFormattedLabel(option: IkasProductOption): string; /** * Clears all values from a product option, and optionally clears all child option values recursively. * * @ai-category ProductOption, Customization * @ai-related setValues, initIkasProductOptionValues, getDisplayedChildOptions * * @param option - The product option to clear. * @param clearChildOptions - Whether to also recursively clear all child option values. * * @example * ```typescript * import { clearValues } from "@ikas/bp-storefront"; * clearValues(option, true); * ``` */ export declare function clearValues(option: IkasProductOption, clearChildOptions: boolean): void; /** * Checks whether a specific select value is currently selected within a product option. * * @ai-category ProductOption, Customization * @ai-related selectValue, isChoiceOption, hasValidProductOptionValues * * @param option - The product option to check. * @param value - The select value to check for selection. * @returns True if the value is currently selected, false otherwise. * * @example * ```typescript * import { isProductOptionSelectValueSelected } from "@ikas/bp-storefront"; * const selected = isProductOptionSelectValueSelected(option, value); * ``` */ export declare function isProductOptionSelectValueSelected(option: IkasProductOption, value: IkasProductOptionSelectValue): boolean; /** * Initializes (resets) the values of a product option and all its child options recursively to empty arrays. * * @ai-category ProductOption, ProductOptionSet * @ai-related clearValues, setValues, getDisplayedChildOptions * * @param option - The product option to initialize. * * @example * ```typescript * import { initIkasProductOptionValues } from "@ikas/bp-storefront"; * initIkasProductOptionValues(option); * ``` */ export declare function initIkasProductOptionValues(option: IkasProductOption): void; /** * Uploads files for a FILE-type product option, respecting max quantity settings, and returns the uploaded file URLs. * * @ai-category ProductOption, Customization * @ai-related isFileOption, isImageOption, setValues * * @param option - The file product option to upload files for. * @param files - An array of File objects to upload. * @returns A promise that resolves to an array of uploaded file URL strings. * * @example * ```typescript * import { productOptionFileUpload } from "@ikas/bp-storefront"; * const uploadedUrls = await productOptionFileUpload(option, fileList); * ``` */ export declare function productOptionFileUpload(option: IkasProductOption, files: File[]): Promise;