import type { StoreState } from '../../types/index.js'; import type { WishlistSet } from '@farfetch/blackout-client'; import type { WishlistSetDenormalized, WishlistSetsDenormalized } from '../../entities/types/index.js'; import type { WishlistSetsErrors } from './types/wishlistsSets.types.js'; /** * Retrieves the error state of the current user's wishlist sets. * * @example * ``` * import { getWishlistSetsError } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * setsError: getWishlistSetsError(state) * }); * ``` * * @param state - Application state. * * @returns Error information, `undefined` if there are no errors. */ export declare const getWishlistSetsError: (state: StoreState) => import("@farfetch/blackout-client").BlackoutError | undefined; /** * Retrieves the ids of the wishlist sets for the current wishlist. * * @example * ``` * import { getWishlistSetsIds } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * wishlistSetsIds: getWishlistSetsIds(state) * }); * ``` * * @param state - Application state. * * @returns Ids of the wishlist sets for the current wishlist. */ export declare const getWishlistSetsIds: (state: StoreState) => string[] | undefined; /** * Retrieves the loading status of the wishlist sets. * * This status is affected by the loading of the wishlist sets themselves, as well * as any "add" operation. * * @example * ``` * import { areWishlistSetsLoading } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * areWishlistSetsLoading: areWishlistSetsLoading(state) * }); * ``` * * @param state - Application state. * * @returns Loading status of the wishlist sets. */ export declare const areWishlistSetsLoading: (state: StoreState) => boolean; /** * Retrieves the fetched status of the wishlist sets. * * @example * ``` * import { areWishlistSetsFetched } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * areWishlistSetsFetched: areWishlistSetsFetched(state) * }); * ``` * * @param state - Application state. * * @returns Fetched status of the wishlist sets. */ export declare const areWishlistSetsFetched: (state: StoreState) => boolean; /** * Retrieves the error state of a specific wishlist set by its id. * * @example * ``` * import { getWishlistSetError } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { wishlistSet: { id } }) => ({ * error: getWishlistSetError(state, id) * }); * ``` * * @param state - Application state. * @param setId - Global identifier of the set in the wishlist. * * @returns Error information, `undefined` if there are no errors. */ export declare const getWishlistSetError: (state: StoreState, setId: WishlistSet['setId']) => import("@farfetch/blackout-client").BlackoutError | null | undefined; /** * Retrieves the loading status of a specific wishlist set by its id. * * @example * ``` * import { isWishlistSetLoading } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { wishlistSet: { id } }) => ({ * isLoading: isWishlistSetLoading(state, id) * }); * ``` * * @param state - Application state. * @param setId - Global identifier of the set in the wishlist. * * @returns Whether the given wishlist set is loading. */ export declare const isWishlistSetLoading: (state: StoreState, setId: WishlistSet['setId']) => boolean; /** * Returns the fetched status of a specific wishlist set. * * @param state - Application state. * @param setId - Global identifier of the set in the wishlist. * * @returns If a certain set has been fetched or not. */ export declare const isWishlistSetFetched: (state: StoreState, setId: WishlistSet['setId']) => boolean; /** * Retrieves a specific wishlist set by its id, with all properties populated (ie, * the wishlist item and product). * * @example * ``` * import { getWishlistSet } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { wishlistSet: { id } }) => ({ * wishlistSet: getWishlistSet(state, id) * }); * ``` * * @param state - Application state. * @param setId - Global identifier of the set in the wishlist. * * @returns Wishlist set entity for the given id. */ export declare const getWishlistSet: (state: StoreState, setId: WishlistSet['setId']) => WishlistSetDenormalized | undefined; /** * Retrieves current user's wishlist sets, hydrated. * * @example * ``` * import { getWishlistSets } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * wishlistSets: getWishlistSets(state) * }); * ``` * * @param state - Application state. * * @returns List of wishlist sets. */ export declare const getWishlistSets: (state: StoreState) => WishlistSetsDenormalized; /** * Retrieves the number of different items in the wishlist set, regardless of each * one's quantity. * * @example * ``` * import { getWishlistSetItemsCounter } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * wishlistSetItemsCounter: getWishlistSetItemsCounter(state), * }); * ``` * * @param state - Application state. * @param setId - Global identifier of the set in the wishlist. * * @returns Count of the items in the wishlist set. */ export declare const getWishlistSetItemsCounter: (state: StoreState, setId: WishlistSet['setId']) => number; /** * Retrieves the total quantity of products in the give wishlist set, accounting * with each item's quantity. * * @example * ``` * import { getWishlistSetTotalQuantity } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * wishlistSetTotalQuantity: getWishlistSetTotalQuantity(state), * }); * ``` * * @param state - Application state. * @param setId - Global identifier of the set in the wishlist. * * @returns Total quantity of products in the wishlist set. */ export declare const getWishlistSetTotalQuantity: (state: StoreState, setId: WishlistSet['setId']) => number; /** * Checks if either the root or any wishlist set is loading. This is useful when * handling multiple wishlist sets at the same time, for example when adding a * product to several wishlist sets. * * @example * ``` * import { isAnyWishlistSetLoading } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * isAnyWishlistSetLoading: isAnyWishlistSetLoading(state), * }); * ``` * * @param state - Application state. * * @returns Whether something is loading within wishlist sets. */ export declare const isAnyWishlistSetLoading: (state: StoreState) => boolean; /** * Checks if is something in the wishlist sets has errors, being it the root's * error or any set in particular. This is useful when handling multiple wishlist * sets at the same time, for example when adding a product to several wishlist * sets. * * @example * ``` * import { areWishlistSetsWithAnyError } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * areWishlistSetsWithAnyError: areWishlistSetsWithAnyError(state), * }); * ``` * * @param state - Application state. * * @returns Whether something errored within wishlist sets. */ export declare const areWishlistSetsWithAnyError: (state: StoreState) => boolean; /** * Gets all errors that occurred for each wishlist set, with the information about * the actual error and the respective wishlist set id and name. This is useful * when handling multiple wishlist sets at the same time, for example when adding a * product to several wishlist sets and some of them fail. This allows retrieving * each failed error and display which sets had problems, for example. * * @example * ``` * import { getAllWishlistSetsErrors } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * allWishlistSetsErrors: getAllWishlistSetsErrors(state), * }); * ``` * * @param state - Application state. * * @returns Errors that occurred for a specific wishlist set, with the "id", "name" and "error" * information. Undefined if there are no errors. */ export declare const getAllWishlistSetsErrors: (state: StoreState) => WishlistSetsErrors | undefined;