/** * Locale selectors. */ import type { City } from '@farfetch/blackout-client'; import type { StateEntity } from '../entities/index.js'; import type { StoreState } from '../types/index.js'; /** * Returns the current country code. * * @example * ``` * import { getCountryCode } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * activeCountryCode: getCountryCode(state) * }); * ``` * * @param state - Application state. * * @returns - The current country code used on the app. */ export declare const getCountryCode: (state: StoreState) => string; /** * Returns the country currency code for the given countryCode. By default, returns * the currency code of the current country. * * @example * ``` * import { getCountryCurrencyCode } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * activeCurrencyCode: getCountryCurrencyCode(state) * }); * ``` * * @param state - Application state. * @param countryCode - The country code to find a specific country. * * @returns - The currency code for the countryCode received. */ export declare const getCountryCurrencyCode: (state: StoreState, countryCode?: string) => string | undefined; /** * Returns the culture code for the given countryCode. By default, returns the * culture code of the current country. * * @example * ``` * import { getCountryCulture } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * activeCultureCode: getCountryCulture(state) * }); * ``` * * @param state - Application state. * @param countryCode - The country code to find a specific country. * * @returns - The culture code for the countryCode received. */ export declare const getCountryCulture: (state: StoreState, countryCode?: string) => string | undefined; /** * Returns the culture list for the given countryCode. By default, returns the * culture of the current country. * * @example * ``` * import { getCountryCultures } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * activeCultureCode: getCountryCulture(state) * }); * ``` * * @param state - Application state. * @param countryCode - The country code to find a specific country. * * @returns - The list of cultures for the countryCode received. */ export declare const getCountryCultures: (state: StoreState, countryCode?: string) => string[] | undefined; /** * Returns the country structure for the given countryCode. By default, returns the * structure of the current country. * * @example * ``` * import { getCountryStructure } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * activeStructure: getCountryStructure(state) * }); * ``` * * @param state - Application state. * @param countryCode - The country code to find a specific country. * * @returns - The structure for the countryCode received. */ export declare const getCountryStructure: (state: StoreState, countryCode?: string) => string | undefined; /** * Returns the country structures list for the given countryCode. By default, * returns the structures of the current country. * * @example * ``` * import { getCountryStructures } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * activeStructures: getCountryStructures(state) * }); * ``` * * @param state - Application state. * @param countryCode - The country code to find a specific country. * * @returns - The list of structures for the countryCode received. */ export declare const getCountryStructures: (state: StoreState, countryCode?: string) => string[] | undefined; /** * Returns the current source country code. * * @example * ``` * import { getSourceCountryCode } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * sourceCountryCode: getSourceCountryCode(state) * }); * ``` * * @param state - Application state. * * @returns - The current source country code used on the app. */ export declare const getSourceCountryCode: (state: StoreState) => string | null; /** * Returns a specific country by its countryCode. * * @param state - Application state. * @param countryCode - Identifier of the country. * * @returns - Country normalized. */ export declare const getCountry: (state: StoreState, countryCode?: string) => import("../entities/index.js").CountryEntity | undefined; /** * Returns all countries from state. * * @param state - Application state. * * @returns - Object with key values pairs representing countryCode and country properties. */ export declare const getCountries: (state: StoreState) => Record | undefined; /** * Retrieves if countries have been fetched. * * Will return true if a fetch countries request * has been made that returned either successfully or failed * and false otherwise. * * @example * ``` * import { areCountriesFetched } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * isFetched: areCountriesFetched(state) * }); * ``` * @param state - Application state. * * @returns isFetched status of countries. */ export declare const areCountriesFetched: (state: StoreState) => boolean; /** * Returns the countries error. * * @example * ``` * import { getCountriesError } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * error: getCountriesError(state) * }); * ``` * * @param state - Application state. * * @returns - Countries error. */ export declare const getCountriesError: (state: StoreState) => import("@farfetch/blackout-client").BlackoutError | null; /** * Returns the loading status for the countries. * * @example * ``` * import { areCountriesLoading } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * isLoading: areCountriesLoading(state) * }); * ``` * * @param state - Application state. * * @returns - Countries Loading status. */ export declare const areCountriesLoading: (state: StoreState) => boolean; /** * Returns the country currencies error. * * @example * ``` * import { getCountryCurrenciesError } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * error: getCountryCurrenciesError(state) * }); * ``` * * @param state - Application state. * * @returns - Currencies error. */ export declare const getCountryCurrenciesError: (state: StoreState) => import("@farfetch/blackout-client").BlackoutError | null; /** * Returns the loading status for the country currencies. * * @example * ``` * import { areCountryCurrenciesLoading } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * isLoading: areCountryCurrenciesLoading(state) * }); * ``` * * @param state - Application state. * * @returns - Currencies Loading status. */ export declare const areCountryCurrenciesLoading: (state: StoreState) => boolean; /** * Returns the country states error. * * @example * ``` * import { getCountryStatesError } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * error: getCountryStatesError(state) * }); * ``` * * @param state - Application state. * * @returns - States error. */ export declare const getCountryStatesError: (state: StoreState) => import("@farfetch/blackout-client").BlackoutError | null; /** * Returns the loading status for the country states. * * @example * ``` * import { areCountryStatesLoading } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * isLoading: areCountryStatesLoading(state) * }); * ``` * * @param state - Application state. * * @returns - States Loading status. */ export declare const areCountryStatesLoading: (state: StoreState) => boolean; /** * Returns a list of country states. By default, returns the states of the current * country. * * @example * ``` * import { getCountryStates } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * states: getCountryStates(state) * }); * ``` * * @param state - Application state. * @param countryCode - The country code to find a specific country. * * @returns - The states for the countryCode received. */ export declare const getCountryStates: (state: StoreState, countryCode?: string) => StateEntity[] | undefined; /** * Returns a specific state by its id. * * @param state - Application state. * @param id - Identifier of the state. * * @returns - State normalized. */ export declare const getState: (state: StoreState, id: number) => StateEntity | undefined; /** * Retrieves if country states have been fetched. * * Will return true if a fetch country states request * has been made that returned either successfully or failed * and false otherwise. * * @example * ``` * import { areCountryStatesFetched } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * isFetched: areCountryStatesFetched(state) * }); * ``` * @param state - Application state. * * @returns isFetched status of country states. */ export declare const areCountryStatesFetched: (state: StoreState, countryCode: string) => boolean; /** * Returns the country cities error. * * @example * ``` * import { getCountryStateCitiesError } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * error: getCountryStateCitiesError(state) * }); * ``` * * @param state - Application state. * * @returns - Cities error. */ export declare const getCountryStateCitiesError: (state: StoreState) => import("@farfetch/blackout-client").BlackoutError | null; /** * Returns the loading status for the cities. * * @example * ``` * import { areCountryStateCitiesLoading } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * isLoading: areCountryStateCitiesLoading(state) * }); * ``` * * @param state - Application state. * * @returns - Cities Loading status. */ export declare const areCountryStateCitiesLoading: (state: StoreState) => boolean; /** * Returns a specific city by its id. * * @param state - Application state. * @param id - Identifier of the city. * * @returns - City normalized. */ export declare const getCity: (state: StoreState, id: number) => City | undefined; /** * Returns all the country state cities. * * @example * ``` * import { getCountryStateCities } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * cities: getCountryStateCities(state, stateId) * }); * ``` * * @param state - Application state. * @param stateId - The state identifier. * * @returns - All the cities related to the stateId received. */ export declare const getCountryStateCities: (state: StoreState, stateId: number) => City[] | undefined; export declare const getCountryCity: (state: StoreState, id: number) => City | undefined; /** * Retrieves if country state cities have been fetched. * * Will return true if a fetch country state cities request * has been made that returned either successfully or failed * and false otherwise. * * @example * ``` * import { areCountryStateCitiesFetched } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * isFetched: areCountryStateCitiesFetched(state) * }); * ``` * @param state - Application state. * * @returns isFetched status of country state cities. */ export declare const areCountryStateCitiesFetched: (state: StoreState, stateId: number) => boolean; /** * Returns a list of country currencies. By default, returns the currencies of the * current country. * * @example * ``` * import { getCountryCurrencies } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * currencies: getCountryCurrencies(state) * }); * ``` * * @param state - Application state. * @param countryCode - The country code to find a specific country. * * @returns - The currencies for the countryCode received. */ export declare const getCountryCurrencies: (state: StoreState, countryCode?: string) => import("@farfetch/blackout-client").Currency[] | undefined; /** * Returns a list with all country address schemas in the application state. * * @param state - Application state. * * @returns - Schemas with the correspondent Iso code. */ export declare const getCountriesAddressSchemas: (state: StoreState) => Record | undefined; /** * Returns a specific country address schema with the specified 'Iso code'. * * @param state - Application state. * @param isoCode - Iso code or CountryId (deprecated). * * @returns Schema information object. */ export declare const getCountryAddressSchemas: (state: StoreState, isoCode: string) => import("@farfetch/blackout-client").CountryAddressSchema[] | undefined; /** * @param state - Application state. * * @returns Loader status. */ export declare const areCountriesAddressSchemasLoading: (state: StoreState) => boolean; /** * @param state - Application state. * * @returns Error details. */ export declare const getCountriesAddressSchemasError: (state: StoreState) => import("../types/nullable.types.js").Nullable; /** * Retrieves if country address schemas have been fetched. * * Will return true if a fetch country address schemas request * has been made that returned either successfully or failed * and false otherwise. * * @example * ``` * import { areCountryAddressSchemasFetched } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * isFetched: areCountryAddressSchemasFetched(state) * }); * ``` * @param state - Application state. * * @returns isFetched status of country address schemas. */ export declare const areCountryAddressSchemasFetched: (state: StoreState, countryCode: string) => boolean; /** * Returns the locale subfolder. * * @param state - Application state. * * @returns - The subfolder for the locale state received. */ export declare const getSubfolder: (state: StoreState) => string | null;