import type { FacetEntity, FacetEntityWithChildren, FacetGroupDenormalized, FacetGroupsNormalized, ProductEntity, ProductEntityDenormalized, ProductListingEntity } from '../../entities/types/index.js'; import type { FacetGroup } from '@farfetch/blackout-client'; import type { StoreState } from '../../types/index.js'; /** * Retrieves the current product listing hash. * * @param state - Application state. * * @returns product listing identifier composed by a list identifier (listing or sets), slug and query. */ export declare const getProductListingHash: (state: StoreState) => string | null; /** * Retrieves the error thrown by current product listing. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Product list error. */ export declare const getProductListingError: (state: StoreState, hash?: string | number | null) => import("@farfetch/blackout-client").BlackoutError | undefined; /** * Retrieves the hydration condition from current product listing. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Whether a product listing is hydrated or not. */ export declare const isProductListingHydrated: (state: StoreState, hash?: string | number | null) => boolean | undefined; /** * Retrieves the loading condition from current product listing. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Whether a product listing is loading or not. */ export declare const isProductListingLoading: (state: StoreState, hash?: string | number | null) => boolean | undefined; /** * Retrieves the fetched status to a specific product listing. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Whether a product listing is fetched or not. */ export declare const isProductListingFetched: (state: StoreState, hash?: string | number | null) => boolean; /** * Retrieves the result of a specific product listing identified by its hash or id. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns - Product list result. */ export declare const getProductListingResult: (state: StoreState, hash?: string | number | null) => ProductListingEntity | undefined; /** * Retrieves product id's from the current product listing. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns List of product ids. */ export declare const getProductListingProductsIds: (state: StoreState, hash?: string | number | null) => ProductEntity['id'][] | undefined; /** * Retrieves a list of products for the current product listing. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Array of products. */ export declare const getProductListingProducts: (state: StoreState, hash?: string | number | null) => ProductEntityDenormalized[] | undefined; /** * Retrieves a list of all products of multiple pages (of a single product listing - * listings or sets) to allow the tenant to build an infinite scroll layout. This * join every product listing with the same pathname/hash in the store, but with a * different page index. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Array of products. */ export declare const getProductListingProductsFromAllPages: (state: StoreState, hash?: string | number | null) => ProductEntityDenormalized[]; /** * Retrieves pagination information about current product listing. * * @example * ``` * // Object returned * { * number: 1, // Current page * pageSize: 20, // Number of products per page * totalItems: 89, // Total of products * totalPages: 5 // Total of pages * }; * ``` * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Pagination object. */ export declare const getProductListingPagination: (state: StoreState, hash?: string | number | null) => { number: ProductListingEntity['products']['number']; pageSize: ProductListingEntity['config']['pageSize']; totalItems: ProductListingEntity['products']['totalItems']; totalPages: ProductListingEntity['products']['totalPages']; } | undefined; /** * Retrieves breadcrumbs information about current product listing. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Breadcrumbs info. * * // Array returned for an accessories product listing * [ * \{ * text: "Woman", * slug: null, * link: '/en-pt/shopping/woman' * parent: false * \}, * \{ * text: "Accessories", * slug: null, * link: '/en-pt/shopping/woman/accessories' * parent: false * \}, * ]. */ export declare const getProductListingBreadcrumbs: (state: StoreState, hash?: string | number | null) => import("@farfetch/blackout-client").ProductsBreadcrumb[] | undefined; /** * Retrieves if a product listing is cached by its hash. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Whether the product listing is cached or not. */ export declare const isProductListingCached: (state: StoreState, hash?: string | number | null) => boolean; /** * Retrieves the current applied filters (known as `filterSegments`) of the current * product listing. * * @example * ``` * // Array returned for a product listing with active filters on colors and * // categories * { * colors: [3, 11], * categories: [187345] * } * ``` * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Applied filters in the format of `{ facetKey: [valueId] }`. */ export declare const getProductListingActiveFilters: (state: StoreState, hash?: string | number | null) => Record> | undefined; /** * Retrieves the count of the current selected filters by the user - i.e. Number of * filters applied that are also facets, meaning the user can select and unselect * them in the product listing filters. This not only considers "fromQueryString" * filters, but also filter slugs. This may be useful to know when to show a "Clear * filters" button. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Total count of selected filters. */ export declare const getProductListingSelectedFiltersCount: (state: StoreState, hash?: string | number | null) => number | undefined; /** * Retrieves the current product listing sorting order. * * @param state - Application state. * @param hash - Product list identifier composed by a list identifier (listing or sets), slug and * query. Could be a string (listing or sets hash) or a number (set id). * * @returns Sort and sort direction. */ export declare const getProductListingSort: (state: StoreState, hash?: string | number | null) => { sort: ProductListingEntity['config']['sort'] | undefined; sortDirection: ProductListingEntity['config']['sortDirection'] | undefined; }; /** * Find all facets groups belonging to the specific type. * * @param state - Application state. * @param facetGroupType - Facet group type to find. * @param hash - Product list identifier composed by a list identifier (listing or sets), * slug and query. Could be a string (listing or sets hash) or a number (set * id). * * @returns Array with all facets groups filtered by the type received, undefined otherwise. */ export declare const getProductListingFacetsGroupsByType: (state: StoreState, facetGroupType: FacetGroup['type'], hash?: string | number | null) => FacetGroupsNormalized | undefined; /** * Returns a specific facet by its id. * * @param state - Application state. * @param facetId - Facet id. * * @returns Facet normalized. */ export declare const getFacet: (state: StoreState, facetId: FacetEntity['id']) => FacetEntity | undefined; /** * Returns all facets from state. * * @param state - Application state. * * @returns Object with key values pairs representing facetId and facet properties. */ export declare const getFacets: (state: StoreState) => Record | undefined; /** * Returns required facets by ids received by parameter. * * @param state - Application state. * @param facetIds - Facets ids. * * @returns Array with all facets content requested. */ export declare const getFacetsByIds: (state: StoreState, facetIds: Array) => FacetEntity[] | undefined; /** * Find all facets belonging to the specific facet group type. * * @param state - Application state. * @param facetGroupType - Facet group type to find. * @param hash - Product list identifier composed by a list identifier (listing or sets), * slug and query. Could be a string (listing or sets hash) or a number (set * id). * * @returns Array with all facets content filtered by the type received, undefined otherwise. */ export declare const getProductListingFacetsByFacetGroupType: (state: StoreState, facetGroupType: FacetGroup['type'], hash?: string | number | null) => FacetEntity[] | undefined; /** * Construct all hierarchical facets with children. As the name states, this only * works with filters of the 'hierarchical' format (which are the ones that have a * parent/children relationship). This is particularly useful if you want to build, * for example, a category filter tree to display. Something like: [ ] Clothing [ ] * Jackets [ ] Blazers [ ] Pants [ ] Tailored pants [ ] Regular-Fit & Straight Leg * Pants This will not work with any other format because the `parentId` is * always 0. * * @param state - Application state. * @param facetGroupType - Facet group type to find. * @param options - Additional options to refine the desired facets. * * @returns - All facets built with children, undefined otherwise. */ export declare const getHierarchicalFacetsWithChildren: (state: StoreState, facetGroupType: FacetGroup['type'], options?: { hash?: string | number | null; initialDepth?: number; dynamic?: number; }) => FacetEntityWithChildren[] | undefined; export declare const getProductListingFacetGroups: (state: StoreState, hash?: string | number | null) => FacetGroupDenormalized[] | undefined; /** * Returns all facets by parent type. * * @param state - Application state. * @param facetGroupType - Facet group type to find. * * @returns Array with all facets content requested by group type. */ export declare const getFacetsByGroupType: (state: StoreState, facetGroupType: FacetGroup['type']) => FacetEntity[]; /** * Returns the error of the fetch listing facets request. * * @param state - Application state. * * @returns Listing Facets error. */ export declare const getListingFacetsError: (state: StoreState) => import("../../types/nullable.types.js").Nullable; /** * Returns the result of the fetch listing facets request. * * @param state - Application state. * * @returns Array of listing facets. */ export declare const getListingFacetsResult: (state: StoreState) => import("../../types/nullable.types.js").Nullable; /** * Returns the loading status of the fetch listing facets request. * * @param state - Application state. * * @returns Listing facets loading status. */ export declare const areListingFacetsLoading: (state: StoreState) => boolean;