/** * Contents selectors. */ import { type ContentEntity } from '../entities/index.js'; import type { Hash } from './types/index.js'; import type { GetSEOMetadataQuery, QueryCommercePages, QuerySearchContents } from '@farfetch/blackout-client'; import type { StoreState } from '../types/index.js'; /** * Retrieves the content result from a specific hash. * * @example * ``` * import { getContentsByHash } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { hash }) => ({ * result: getContentsByHash(state, hash) * }); * * ``` * * @param state - Application state. * @param hash - Hash key for each content. * * @returns - Content from a specific hash. */ export declare const getContentsByHash: (state: StoreState, hash: Hash) => import("./types/reducers.types.js").SearchResultsState | undefined; /** * Returns the error thrown by the fetchContents request, by query. * * @example * ``` * import { getContentError } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { query }) => ({ * error: getContentError(state, query) * }); * ``` * * @param state - Application state. * @param query - Query applied to search the contents. * * @returns - Content error. */ export declare const getContentError: (state: StoreState, query: QuerySearchContents | QueryCommercePages) => import("@farfetch/blackout-client").BlackoutError | null | undefined; /** * Returns the loading condition to the fetchContents request, by query. * * @example * ``` * import { isContentLoading } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { query }) => ({ * isLoading: isContentLoading(state, query) * }); * ``` * * @param state - Application state. * @param query - Query applied to search the contents. * * @returns - If the content is loading or not. */ export declare const isContentLoading: (state: StoreState, query: QuerySearchContents | QueryCommercePages) => boolean | undefined; /** * Find the content corresponding to a specific query. * * @example * ``` * import { getContentByQuery } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { query }) => ({ * contentEntry: getContentByQuery(state, query) * }); * * ``` * * @param state - Application state. * @param query - Query applied to search the contents. * * @returns - Content entry that aggregates all contents for the query received. */ export declare const getContentByQuery: (state: StoreState, query: QuerySearchContents | QueryCommercePages) => { hash: string; number: number; totalPages: number; totalItems: number; entries: string[]; } | undefined; /** * Retrieves the contents result from a certain content entry retrieved by its * query/hash. * * @example * ``` * import { getContents } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { query }) => ({ * contents: getContents(state, query) * }); * * ``` * * @param state - Application state. * @param query - Query applied to search the contents. * * @returns - All the contents for the given content entry. */ export declare const getContents: (state: StoreState, query: QuerySearchContents | QueryCommercePages) => ContentEntity[] | undefined; /** * Retrieves if the content has been fetched. * * Will return true if a fetch for a certain content entry * has been made that returned either successfully or failed * and false otherwise. * * @example * ``` * import { isContentFetched } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * isFetched: isContentFetched(state) * }); * ``` * @param state - Application state. * * @returns isFetched status of the content. */ export declare const isContentFetched: (state: StoreState, query: QuerySearchContents | QueryCommercePages) => boolean; /** * Retrieves an array with the content types available obtained * from the `fetchContentTypes` action. * * @example * ``` * import { getContentTypes } from '@farfetch/blackout-redux'; * * const mapStateToProps = state => ({ * contentTypes: getContentTypes(state) * }); * ``` * * @param state - Application state. * * @returns - All the content types. */ export declare const getContentTypes: (state: StoreState) => string[] | null | undefined; /** * Returns the error thrown to the fetchSEOMetadata request. * * @example * ``` * import { getSEOMetadataError } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { query }) => ({ * seoError: getSEOMetadataError(state, query) * }); * * ``` * * @param state - Application state. * @param query - Query applied to search the contents. * * @returns - Content error. */ export declare const getSEOMetadataError: (state: StoreState, query: GetSEOMetadataQuery) => import("@farfetch/blackout-client").BlackoutError | null | undefined; /** * Returns the loading status to the fetchSEOMetadata request. * * @example * ``` * import { isSEOMetadataLoading } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { query }) => ({ * isSEOMetadataLoading: isSEOMetadataLoading(state, query) * }); * * ``` * * @param state - Application state. * @param query - Query applied to search the contents. * * @returns - If the content is loading or not. */ export declare const isSEOMetadataLoading: (state: StoreState, query: GetSEOMetadataQuery) => boolean | undefined; /** * Returns the isFetched status to the fetchSEOMetadata request. * * @example * ``` * import { isSEOMetadataFetched } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { query }) => ({ * isSEOMetadataFetched: isSEOMetadataFetched(state, query) * }); * * ``` * * @param state - Application state. * @param query - Query applied to search the contents. * * @returns - If the content is loading or not. */ export declare const isSEOMetadataFetched: (state: StoreState, query: GetSEOMetadataQuery) => boolean; /** * Returns the metadata content of that page. * * @example * ``` * import { getSEOMetadataResult } from '@farfetch/blackout-redux'; * * const mapStateToProps = (state, { query }) => ({ * seo: getSEOMetadataResult(state, query) * }); * * ``` * * @param state - Application state. * @param query - Query applied to search for the metadata. * * @returns - All metadata for that page. */ export declare const getSEOMetadataResult: (state: StoreState, query: GetSEOMetadataQuery) => import("@farfetch/blackout-client").SEOMetadata | null | undefined; /** * Returns a specific content by its id. * * @param state - Application state. * @param hash - Content hash. * * @returns Content normalized. */ export declare const getContent: (state: StoreState, hash: string) => ContentEntity | undefined;