import { IkasApplicableProductFilterValue, IkasFilterCategory, IkasProductFilter, IkasProductFilterNumberRangeListOption, IkasProductList, IkasProductListSortType, IkasSearchSuggestion } from "../../../storefront-models/src"; /** * Initializes a new product list with default values merged with the provided partial data. * * @ai-category ProductList * @ai-related initProductListOnBrowser, getProductListInitialData * * @param data - Partial product list data to merge with defaults * @returns A fully initialized IkasProductList instance * * @example * ```typescript * import { initProductList } from "@ikas/bp-storefront"; * const list = initProductList({ limit: 20, type: "CATEGORY" }); * ``` */ export declare function initProductList(data: Partial): IkasProductList; /** * Initializes a product list in the browser by restoring scroll position, applying query param filters, and fetching initial data as needed. * * @ai-category ProductList * @ai-related initProductList, getProductListInitialData, isProductListFilterable * * @param list - The product list to initialize on the browser * @returns void * * @example * ```typescript * import { initProductListOnBrowser } from "@ikas/bp-storefront"; * initProductListOnBrowser(productList); * ``` */ export declare function initProductListOnBrowser(list: IkasProductList): void; /** * Searches the product list by keyword with debounced filtering and analytics tracking. * * @ai-category ProductList, Filtering * @ai-related isProductListSearch, clearProductListFilters, hasProductListAppliedFilters * * @param list - The product list to search within * @param keyword - The search keyword to filter products by * @returns void * * @example * ```typescript * import { searchProductList } from "@ikas/bp-storefront"; * searchProductList(productList, "red shoes"); * ``` */ export declare function searchProductList(list: IkasProductList, keyword: string): void; /** * Checks whether the product list supports filtering (only ALL and CATEGORY types are filterable). * * @ai-category ProductList, Filtering * @ai-related isProductListFiltered, hasProductListAppliedFilters, clearProductListFilters * * @param list - The product list to check * @returns True if the product list type supports filtering * * @example * ```typescript * import { isProductListFilterable } from "@ikas/bp-storefront"; * if (isProductListFilterable(productList)) { * // Show filter UI * } * ``` */ export declare function isProductListFilterable(list: IkasProductList): boolean; /** * Checks whether the product list currently has any active filters, search keyword, or selected filter categories. * * @ai-category ProductList, Filtering * @ai-related isProductListFilterable, hasProductListAppliedFilters, clearProductListFilters * * @param list - The product list to check * @returns True if any filters, search keywords, or filter categories are actively applied * * @example * ```typescript * import { isProductListFiltered } from "@ikas/bp-storefront"; * if (isProductListFiltered(productList)) { * // Show "clear filters" button * } * ``` */ export declare function isProductListFiltered(list: IkasProductList): boolean; /** * Checks whether the product list is of the STATIC type (manually curated product selection). * * @ai-category ProductList * @ai-related isProductListDiscounted, isProductListRecommended, isProductListLastViewed * * @param list - The product list to check * @returns True if the product list type is STATIC * * @example * ```typescript * import { isProductListStatic } from "@ikas/bp-storefront"; * if (isProductListStatic(productList)) { * // Handle static product display * } * ``` */ export declare function isProductListStatic(list: IkasProductList): boolean; /** * Checks whether the product list is of the DISCOUNTED type (showing only discounted products). * * @ai-category ProductList * @ai-related isProductListStatic, isProductListRecommended, isProductListLastViewed * * @param list - The product list to check * @returns True if the product list type is DISCOUNTED * * @example * ```typescript * import { isProductListDiscounted } from "@ikas/bp-storefront"; * if (isProductListDiscounted(productList)) { * // Show discount badge * } * ``` */ export declare function isProductListDiscounted(list: IkasProductList): boolean; /** * Checks whether the product list is of the RECOMMENDED type (showing recommended products). * * @ai-category ProductList * @ai-related isProductListStatic, isProductListDiscounted, isProductListRelatedProducts * * @param list - The product list to check * @returns True if the product list type is RECOMMENDED * * @example * ```typescript * import { isProductListRecommended } from "@ikas/bp-storefront"; * if (isProductListRecommended(productList)) { * // Render recommendation section * } * ``` */ export declare function isProductListRecommended(list: IkasProductList): boolean; /** * Checks whether the product list is of the LAST_VIEWED type (showing recently viewed products). * * @ai-category ProductList * @ai-related isProductListStatic, isProductListRecommended, isProductListViewedTogether * * @param list - The product list to check * @returns True if the product list type is LAST_VIEWED * * @example * ```typescript * import { isProductListLastViewed } from "@ikas/bp-storefront"; * if (isProductListLastViewed(productList)) { * // Display "Recently Viewed" heading * } * ``` */ export declare function isProductListLastViewed(list: IkasProductList): boolean; /** * Checks whether the product list is of the RELATED_PRODUCTS type (showing products related to a specific product). * * @ai-category ProductList * @ai-related isProductListRecommended, isProductListViewedTogether, isProductListLastViewed * * @param list - The product list to check * @returns True if the product list type is RELATED_PRODUCTS * * @example * ```typescript * import { isProductListRelatedProducts } from "@ikas/bp-storefront"; * if (isProductListRelatedProducts(productList)) { * // Show "Related Products" section * } * ``` */ export declare function isProductListRelatedProducts(list: IkasProductList): boolean; /** * Checks whether the product list is of the VIEWED_TOGETHER type (showing products frequently viewed together). * * @ai-category ProductList * @ai-related isProductListRelatedProducts, isProductListRecommended, isProductListLastViewed * * @param list - The product list to check * @returns True if the product list type is VIEWED_TOGETHER * * @example * ```typescript * import { isProductListViewedTogether } from "@ikas/bp-storefront"; * if (isProductListViewedTogether(productList)) { * // Show "Frequently Viewed Together" section * } * ``` */ export declare function isProductListViewedTogether(list: IkasProductList): boolean; /** * Checks whether the product list is of the PURCHASED_TOGETHER type (showing products purchased together). * * @ai-category ProductList * @ai-related isProductListStatic, isProductListRecommended, isProductListViewedTogether * * @param list - The product list to check * @returns True if the product list type is PURCHASED_TOGETHER * * @example * ```typescript * import { isProductListPurchasedTogether } from "@ikas/bp-storefront"; * if (isProductListPurchasedTogether(productList)) { * // Show "Purchased Together" section * } * ``` */ export declare function isProductListPurchasedTogether(list: IkasProductList): boolean; /** * Checks whether the product list is of the SEARCH type (populated by search results). * * @ai-category ProductList, Filtering * @ai-related searchProductList, isProductListFilterable, isProductListFiltered * * @param list - The product list to check * @returns True if the product list type is SEARCH * * @example * ```typescript * import { isProductListSearch } from "@ikas/bp-storefront"; * if (isProductListSearch(productList)) { * // Show search results UI * } * ``` */ export declare function isProductListSearch(list: IkasProductList): boolean; /** * Checks whether the product list has a previous page available for infinite scroll or pagination. * * @ai-category ProductList, Pagination * @ai-related hasProductListNextPage, getProductListPrevPage, getProductListPage * * @param list - The product list to check * @returns True if a previous page exists (minPage > 1) and the list type supports pagination * * @example * ```typescript * import { hasProductListPrevPage } from "@ikas/bp-storefront"; * if (hasProductListPrevPage(productList)) { * // Show "Load Previous" button * } * ``` */ export declare function hasProductListPrevPage(list: IkasProductList): boolean; /** * Checks whether the product list has a next page available for infinite scroll or pagination. * * @ai-category ProductList, Pagination * @ai-related hasProductListPrevPage, getProductListNextPage, getProductListPage * * @param list - The product list to check * @returns True if more products exist beyond the current page and the list type supports pagination * * @example * ```typescript * import { hasProductListNextPage } from "@ikas/bp-storefront"; * if (hasProductListNextPage(productList)) { * // Show "Load More" button * } * ``` */ export declare function hasProductListNextPage(list: IkasProductList): boolean; /** * Returns the filter categories for the product list, excluding those with zero results. * * @ai-category ProductList, Filtering * @ai-related onFilterCategoryClick, isProductListFilterable, clearProductListFilters * * @param list - The product list to get filter categories from * @returns An array of filter categories that have at least one matching result * * @example * ```typescript * import { getProductListFilterCategories } from "@ikas/bp-storefront"; * const categories = getProductListFilterCategories(productList); * categories.forEach(category => console.log(category.name)); * ``` */ export declare function getProductListFilterCategories(list: IkasProductList): IkasFilterCategory[]; /** * Checks whether the product list has any actively applied filters or a search keyword. * * @ai-category ProductList, Filtering * @ai-related isProductListFiltered, isProductListFilterable, clearProductListFilters, getSelectedFilterValues * * @param list - The product list to check * @returns True if there is a search keyword or any filter with selected values * * @example * ```typescript * import { hasProductListAppliedFilters } from "@ikas/bp-storefront"; * if (hasProductListAppliedFilters(productList)) { * // Show active filter chips * } * ``` */ export declare function hasProductListAppliedFilters(list: IkasProductList): boolean; /** * Checks whether the featured (manual) sort option is enabled for the product list based on page-specific ordering configuration. * * @ai-category ProductList, Sorting * @ai-related getProductListSortOptions, setSortType, getProductListSortTypeTranslation * * @param list - The product list to check * @returns True if the page-specific order type is MANUALLY and the list type is ALL or CATEGORY * * @example * ```typescript * import { hasProductListFeaturedSortEnabled } from "@ikas/bp-storefront"; * if (hasProductListFeaturedSortEnabled(productList)) { * // Include "Featured" in sort dropdown * } * ``` */ export declare function hasProductListFeaturedSortEnabled(list: IkasProductList): boolean; /** * Sets the isFiltered flag on each product in the list based on the current filter state. * * @ai-category ProductList, Filtering * @ai-related isProductListFiltered, setProductListIsStaticForProducts, initProductList * * @param list - The product list whose products will have their isFiltered flag updated * @returns void * * @example * ```typescript * import { setProductListIsFilteredForProducts } from "@ikas/bp-storefront"; * setProductListIsFilteredForProducts(productList); * ``` */ export declare function setProductListIsFilteredForProducts(list: IkasProductList): void; /** * Sets the isFiltered flag on each product in the list based on whether the list is a static type. * * @ai-category ProductList * @ai-related isProductListStatic, setProductListIsFilteredForProducts, initProductList * * @param list - The product list whose products will have their isFiltered flag updated * @returns void * * @example * ```typescript * import { setProductListIsStaticForProducts } from "@ikas/bp-storefront"; * setProductListIsStaticForProducts(productList); * ``` */ export declare function setProductListIsStaticForProducts(list: IkasProductList): void; /** * Enables search suggestions for the product list, allowing the API to return suggestion results alongside products. * * @ai-category ProductList, Filtering * @ai-related searchProductList, getProductListSuggestionHref, isProductListSearch * * @param list - The product list to enable suggestions on * @returns void * * @example * ```typescript * import { enableProductListSuggestions } from "@ikas/bp-storefront"; * enableProductListSuggestions(productList); * ``` */ export declare function enableProductListSuggestions(list: IkasProductList): void; /** * Generates the URL href for a search suggestion, encoding category and brand IDs as query parameters. * * @ai-category ProductList, Filtering * @ai-related enableProductListSuggestions, searchProductList, isProductListSearch * * @param suggestion - The search suggestion to generate a URL for * @returns The search page URL with encoded suggestion parameters, or a plain search URL if no params * * @example * ```typescript * import { getProductListSuggestionHref } from "@ikas/bp-storefront"; * const href = getProductListSuggestionHref(suggestion); * // "/search?suggestion=%7B%22categoryId%22%3A%22abc%22%7D" * ``` */ export declare function getProductListSuggestionHref(suggestion: IkasSearchSuggestion): string; /** * Clears all applied filters, search keyword, and selected filter categories from the product list and re-fetches data. * * @ai-category ProductList, Filtering * @ai-related clearProductListFilter, hasProductListAppliedFilters, isProductListFiltered * * @param list - The product list to clear all filters from * @returns void * * @example * ```typescript * import { clearProductListFilters } from "@ikas/bp-storefront"; * clearProductListFilters(productList); * ``` */ export declare function clearProductListFilters(list: IkasProductList): void; /** * Clears a single specific filter from the product list and re-fetches data. * * @ai-category ProductList, Filtering * @ai-related clearProductListFilters, handleFilterValueClick, getSelectedFilterValues * * @param list - The product list containing the filter * @param filter - The specific product filter to clear * @returns void * * @example * ```typescript * import { clearProductListFilter } from "@ikas/bp-storefront"; * clearProductListFilter(productList, colorFilter); * ``` */ export declare function clearProductListFilter(list: IkasProductList, filter: IkasProductFilter): void; /** * Handles a click on a filter value by toggling its selection and re-fetching filtered product data. * * @ai-category ProductList, Filtering * @ai-related handleNumberRangeOptionClick, clearProductListFilter, getSelectedFilterValues * * @param list - The product list to apply the filter to * @param filter - The product filter containing the value * @param filterValue - The specific filter value that was clicked * @returns void * * @example * ```typescript * import { handleFilterValueClick } from "@ikas/bp-storefront"; * handleFilterValueClick(productList, colorFilter, redColorValue); * ``` */ export declare function handleFilterValueClick(list: IkasProductList, filter: IkasProductFilter, filterValue: IkasApplicableProductFilterValue): void; /** * Handles a click on a number range filter option by toggling its selection and re-fetching filtered product data. * * @ai-category ProductList, Filtering * @ai-related handleFilterValueClick, clearProductListFilter, getSelectedFilterValues * * @param list - The product list to apply the number range filter to * @param filter - The product filter containing the number range option * @param option - The specific number range option that was clicked * @returns void * * @example * ```typescript * import { handleNumberRangeOptionClick } from "@ikas/bp-storefront"; * handleNumberRangeOptionClick(productList, priceFilter, priceRangeOption); * ``` */ export declare function handleNumberRangeOptionClick(list: IkasProductList, filter: IkasProductFilter, option: IkasProductFilterNumberRangeListOption): void; /** * Returns the currently selected filter values for each active filter, including number range and list-based filters. * * @ai-category ProductList, Filtering * @ai-related hasProductListAppliedFilters, handleFilterValueClick, clearProductListFilter * * @param list - The product list to retrieve selected filter values from * @returns An array of selected filter value objects, or undefined if no filters have selected values * * @example * ```typescript * import { getSelectedFilterValues } from "@ikas/bp-storefront"; * const selectedFilters = getSelectedFilterValues(productList); * selectedFilters?.forEach(sf => { * console.log(sf.filter.name, sf.commaSeperatedValues); * }); * ``` */ export declare function getSelectedFilterValues(list: IkasProductList): IkasProductListSelectedFilterValues[] | undefined; /** * Fetches the initial product data for the list including filters, categories, brands, and products from the API. * * @ai-category ProductList, ProductListing * @ai-related initProductList, initProductListOnBrowser, getProductListNextPage, getProductListPrevPage * * @param list - The product list to fetch initial data for * @param queryParams - Optional URL search params to apply as filters before fetching * @param isInfiteScrollReturn - Whether this is a return to an infinite scroll position (preserves current page) * @returns True if data was successfully fetched and applied, undefined otherwise * * @example * ```typescript * import { getProductListInitialData } from "@ikas/bp-storefront"; * const success = await getProductListInitialData(productList); * ``` */ export declare function getProductListInitialData(list: IkasProductList, queryParams?: URLSearchParams, isInfiteScrollReturn?: boolean): Promise; export declare function productListToggleFilterCollapsed(filter: IkasProductFilter): void; /** * Fetches the previous page of products and prepends them to the current list data for infinite scroll. * * @ai-category ProductList, Pagination * @ai-related getProductListNextPage, getProductListPage, hasProductListPrevPage * * @param list - The product list to load the previous page for * @returns void * * @example * ```typescript * import { getProductListPrevPage } from "@ikas/bp-storefront"; * await getProductListPrevPage(productList); * ``` */ export declare function getProductListPrevPage(list: IkasProductList): Promise; /** * Fetches the next page of products and appends them to the current list data for infinite scroll. * * @ai-category ProductList, Pagination * @ai-related getProductListPrevPage, getProductListPage, hasProductListNextPage * * @param list - The product list to load the next page for * @returns void * * @example * ```typescript * import { getProductListNextPage } from "@ikas/bp-storefront"; * await getProductListNextPage(productList); * ``` */ export declare function getProductListNextPage(list: IkasProductList): Promise; /** * Fetches a specific page of products, replacing the current list data (standard pagination). * * @ai-category ProductList, Pagination * @ai-related getProductListNextPage, getProductListPrevPage, hasProductListNextPage, hasProductListPrevPage * * @param list - The product list to load the page for * @param page - The page number to fetch * @returns void * * @example * ```typescript * import { getProductListPage } from "@ikas/bp-storefront"; * await getProductListPage(productList, 3); * ``` */ export declare function getProductListPage(list: IkasProductList, page: number): Promise; /** * Sets the sort type for the product list and re-fetches data with the new sort order applied. * * @ai-category ProductList, Sorting * @ai-related getProductListSortOptions, getProductListSortTypeTranslation, translateProductListSortType * * @param list - The product list to change sorting for * @param sortType - The sort type to apply (e.g., "INCREASING_PRICE", "LAST_ADDED") * @returns void * * @example * ```typescript * import { setSortType } from "@ikas/bp-storefront"; * await setSortType(productList, "DECREASING_PRICE"); * ``` */ export declare function setSortType(list: IkasProductList, sortType: IkasProductListSortType): Promise; /** * Returns the translated label for the currently selected sort type of the product list. * * @ai-category ProductList, Sorting * @ai-related translateProductListSortType, setSortType, getProductListSortOptions * * @param list - The product list to get the current sort type label for * @returns The translated string label for the current sort type * * @example * ```typescript * import { getProductListSortTypeTranslation } from "@ikas/bp-storefront"; * const label = getProductListSortTypeTranslation(productList); * // e.g., "Price: Low to High" * ``` */ export declare function getProductListSortTypeTranslation(list: IkasProductList): string; /** * Translates a given sort type enum value into its localized display label. * * @ai-category ProductList, Sorting * @ai-related getProductListSortTypeTranslation, setSortType, getProductListSortOptions * * @param list - The product list (used for context) * @param sortType - The sort type to translate * @returns The translated string label for the given sort type * * @example * ```typescript * import { translateProductListSortType } from "@ikas/bp-storefront"; * const label = translateProductListSortType(productList, "INCREASING_PRICE"); * // e.g., "Price: Low to High" * ``` */ export declare function translateProductListSortType(list: IkasProductList, sortType: IkasProductListSortType): string; /** * Returns the available sort options for the product list, excluding any disabled sort types, with translated labels and selection state. * * @ai-category ProductList, Sorting * @ai-related setSortType, getProductListSortTypeTranslation, translateProductListSortType, hasProductListFeaturedSortEnabled * * @param list - The product list to generate sort options for * @returns An array of sort option objects with label, value, and isSelected properties * * @example * ```typescript * import { getProductListSortOptions } from "@ikas/bp-storefront"; * const options = getProductListSortOptions(productList); * options.forEach(opt => console.log(opt.label, opt.isSelected)); * ``` */ export declare function getProductListSortOptions(list: IkasProductList): IkasProductListSortOption[]; /** * Handles a click on a filter category, either toggling its selection and re-fetching data or navigating to the category page. * * @ai-category ProductList, Filtering * @ai-related getProductListFilterCategories, clearProductListFilters, handleFilterValueClick * * @param list - The product list to apply the filter category to * @param filterCategory - The filter category that was clicked * @param disableRoute - If true, toggles selection in-place without navigating; otherwise navigates to the category URL * @returns void * * @example * ```typescript * import { onFilterCategoryClick } from "@ikas/bp-storefront"; * await onFilterCategoryClick(productList, selectedCategory, true); * ``` */ export declare function onFilterCategoryClick(list: IkasProductList, filterCategory: IkasFilterCategory, disableRoute?: boolean): Promise; export declare function initProductListFilterCategories(list: IkasProductList): void; /** * Updates the visible page number for infinite scroll and synchronizes the URL query parameters. * * @ai-category ProductList, Pagination * @ai-related getProductListNextPage, getProductListPrevPage, hasProductListNextPage * * @param list - The product list to update the visible page for * @param page - The page number currently visible in the viewport * @returns void * * @example * ```typescript * import { setProductListVisiblePage } from "@ikas/bp-storefront"; * setProductListVisiblePage(productList, 2); * ``` */ export declare function setProductListVisiblePage(list: IkasProductList, page: number): void; /** * Returns the currency code (e.g., "USD", "EUR") for the product list based on the first product's variant price or the store default. * * @ai-category ProductList, ProductListing * @ai-related getProductListCurrencySymbol * * @param list - The product list to get the currency code from * @returns The currency code string * * @example * ```typescript * import { getProductListCurrencyCode } from "@ikas/bp-storefront"; * const currencyCode = getProductListCurrencyCode(productList); * // "USD" * ``` */ export declare function getProductListCurrencyCode(list: IkasProductList): string; /** * Returns the currency symbol (e.g., "$", "EUR") for the product list based on the first product's variant price or the store default. * * @ai-category ProductList, ProductListing * @ai-related getProductListCurrencyCode * * @param list - The product list to get the currency symbol from * @returns The currency symbol string * * @example * ```typescript * import { getProductListCurrencySymbol } from "@ikas/bp-storefront"; * const symbol = getProductListCurrencySymbol(productList); * // "$" * ``` */ export declare function getProductListCurrencySymbol(list: IkasProductList): string; export type IkasProductListSortOption = { label: string; value: string; isSelected: boolean; }; export type IkasProductListSelectedFilterValues = { filter: IkasProductFilter; values: string[]; commaSeperatedValues: string; };