import { SelectedRefinement } from 'groupby-api'; import Store from './store'; declare namespace Selectors { /** * Returns the history state. */ const history: (state: Store.State) => Store.History; /** * Returns the url. */ const url: (state: Store.State) => string; /** * Returns the route. */ const route: (state: Store.State) => string; /** * Returns the url request. */ const urlRequest: (state: Store.State) => any; /** * Returns the applied area. */ const area: (state: Store.State) => string; /** * Returns the requested fields. */ const fields: (state: Store.State) => string[]; /** * Returns the current original query. */ const query: (state: Store.State) => string; /** * Returns the didYouMean array */ const didYouMean: (state: Store.State) => string[]; /** * Returns the related queries array */ const relatedQueries: (state: Store.State) => string[]; /** * Returns the corrected query if it exists, otherwise returns the original query. */ const currentQuery: (state: Store.State) => string; /** * Returns the name of the default collection */ const defaultCollection: (state: Store.State) => string; /** * Returns the collections object. */ const collections: (state: Store.State) => Store.Indexed.Selectable; /** * Returns the current selected collection. */ const collection: (state: Store.State) => string; /** * Returns the index of the given collection. */ const collectionIndex: (state: Store.State, name: string) => number; /** * Returns the current page object. */ const pageObject: (state: Store.State) => Store.Page; /** * Returns the current infinite scroll object. */ const infiniteScroll: (state: Store.State) => Store.InfiniteScroll; /** * Returns the page sizes object. */ const pageSizes: (state: Store.State) => Store.SelectableList; /** * Returns the current selected page size. */ const pageSize: (state: Store.State) => number; /** * Returns the index of the selected page size. */ const pageSizeIndex: (state: Store.State) => number; /** * Returns the current page number. */ const page: (state: Store.State) => number; /** * Returns the last page index, ie number of pages */ const totalPages: (state: Store.State) => number; /** * Returns the sorts object. */ const sorts: (state: Store.State) => Store.LabeledSelectableList; /** * Returns the current selected sort. */ const sort: (state: Store.State) => Store.Sort; /** * Returns the index of the current selected sort. */ const sortIndex: (state: Store.State) => number; /** * Returns the request skip needed for the current page and given page size. */ const skip: (state: Store.State, pagesize: number) => number; /** * Returns the template. */ const template: (state: Store.State) => Store.Template; const siteParams: (state: Store.State) => Store.SiteParams[]; /** * Returns the current products */ const products: (state: Store.State) => Store.Product[]; /** * Returns a boolean indicating whether products are loaded */ const productsLoaded: (state: Store.State) => boolean; /** * Returns the product with the given id */ const findProduct: (state: Store.State, productId: string) => Store.Product; /** * Returns products with past purchases metadata. * @param {[type]} state - Store state. * @return {[type]} - The field for the past purchase key */ const productsWithPastPurchase: (state: Store.State, idField: string) => { data: Store.Product; meta: any; }[]; /** * Returns the current products extended with metadata */ const productsWithMetadata: (state: Store.State) => Store.ProductWithMetadata[]; /** * Returns the current products extended with metadata */ const pastPurchaseProductsWithMetadata: (state: Store.State) => Store.ProductWithMetadata[]; /** * Returns the current details object. */ const details: (state: Store.State) => Store.Details; /** * Returns details template. */ const detailsTemplate: (state: Store.State) => Store.Template; /** * Returns details siteParams. */ const detailsSiteParams: (state: Store.State) => Store.SiteParams[]; /** * Returns the current selected refinements. */ const selectedRefinements: (state: Store.State) => SelectedRefinement[]; /** * Returns the maximum value for the given range navigation. */ const rangeNavigationMax: (state: Store.State, navigationId: any) => number; /** * Returns the minimum value for the given range navigation. */ const rangeNavigationMin: (state: Store.State, navigationId: any) => number; /** * Returns the navigation object for the given navigationId. */ const navigation: (state: Store.State, navigationId: string) => Store.Navigation; /** * Returns the navigations object. */ const navigationsObject: (state: Store.State) => Store.AvailableNavigations; /** * Returns the navigations. */ const navigations: (state: Store.State) => Store.Navigation[]; /** * Returns the available navigations. */ const availableNavigations: (state: Store.State) => Store.Navigation[]; /** * Returns the navigation sort. */ const navigationSort: (state: Store.State) => Store.Recommendations.Navigation[]; /** * Finds the refinement based on the given navigationId and index and returns * true if it is not selected, false otherwise. */ const isRefinementDeselected: (state: Store.State, navigationId: string, index: number) => boolean; /** * Finds the refinement based on the given navigationId and index and returns * true if it is selected, false otherwise. */ const isRefinementSelected: (state: Store.State, navigationId: string, index: number) => boolean; /** * Returns true if the navigation based on the given navigationId has more refinements. */ const hasMoreRefinements: (state: Store.State, navigationId: string) => boolean; /** * Returns the refinement object for the given navigationId and index. */ const refinementCrumb: (state: Store.State, navigationId: string, index: number) => { value: any; low: any; high: any; field: string; range: boolean; }; /** * Returns the current record count. */ const recordCount: (state: Store.State) => number; /** * Returns the current autocomplete object. */ const autocomplete: (state: Store.State) => Store.Autocomplete; /** * Returns the currently typed in autocomplete query. */ const autocompleteQuery: (state: Store.State) => string; /** * Returns the set autocomplete category field navigationId. */ const autocompleteCategoryField: (state: Store.State) => string; /** * Returns the current values for the autocomplete category field. */ const autocompleteCategoryValues: (state: Store.State) => string[]; /** * Returns the current autocomplete suggestions. */ const autocompleteSuggestions: (state: Store.State) => Store.Autocomplete.Suggestion[]; /** * Returns the current autocomplete navigations. */ const autocompleteNavigations: (state: Store.State) => Store.Autocomplete.Navigation[]; /** * Returns the current autocomplete products. */ const autocompleteProducts: (state: Store.State) => Store.Product[]; /** * Returns the current autocomplete template. */ const autocompleteTemplate: (state: Store.State) => Store.Template; /** * Returns the current session location. */ const location: (state: Store.State) => Store.Geolocation; /** * Returns the current session config */ const config: (state: Store.State) => import("./configuration").default; /** * Returns the full `isFetching` object. * If called with a `value` parameter, returns a boolean value indicating the * current fetching state. * * @param value Accepted values conform to the [[Store.IsFetching]] properties. */ const isFetching: (state: Store.State, value?: "search" | "details" | "moreRefinements" | "moreProducts" | "autocompleteSuggestions" | "autocompleteProducts") => boolean | Store.IsFetching; /** * Returns the current recommendations product suggestions. */ const recommendationsProducts: (state: Store.State) => Store.Product[]; /** * Returns the SKUs of previously purchased products. */ const pastPurchaseProductsBySku: (state: Store.State) => {}; /** * Returns the entire byId object from biasing */ const realTimeBiasesById: (state: Store.State) => Store.Personalization.BiasById; /** * Returns the entire allIds object from biasing */ const realTimeBiasesAllIds: (state: Store.State) => Store.Personalization.BiasKey[]; /** * Returns all the past purchase skus */ const pastPurchases: (state: Store.State) => Store.PastPurchases.PastPurchaseProduct[]; /** * Returns the past purchases for the sayt window */ const saytPastPurchases: (state: Store.State) => Store.ProductWithMetadata[]; /** * Returns the past purchase product data */ const pastPurchaseProducts: (state: Store.State) => { meta: any; id: string; }[]; /** * Returns the past purchase record count */ const pastPurchaseAllRecordCount: (state: Store.State) => number; const pastPurchaseCurrentRecordCount: (state: Store.State) => number; /** * Returns the past purchase query string */ const pastPurchaseQuery: (state: Store.State) => string; /** * Returns the past purchase navigations object. */ const pastPurchaseNavigationsObject: (state: Store.State) => Store.Indexed; /** * Returns the past purchase navigation object for the given navigationId. */ const pastPurchaseNavigation: (state: Store.State, navigationId: string) => Store.Navigation; /** * Returns the past purchase navigations. */ const pastPurchaseNavigations: (state: Store.State) => Store.Navigation[]; /** * Returns the available navigations. */ const availablePastPurchaseNavigations: (state: Store.State) => Store.Navigation[]; /** * Returns all selected refinements for the past purchase page */ const pastPurchaseSelectedRefinements: (state: Store.State) => SelectedRefinement[]; /** * Finds the past purchase refinement based on the given navigationId and index and returns * true if it is not selected, false otherwise. */ const isPastPurchaseRefinementDeselected: (state: Store.State, navigationId: string, index: number) => boolean; /** * Finds the past purchase refinement based on the given navigationId and index and returns * true if it is selected, false otherwise. */ const isPastPurchaseRefinementSelected: (state: Store.State, navigationId: string, index: number) => boolean; /** * Returns the current past purchase page object. */ const pastPurchasePageObject: (state: Store.State) => Store.Page; /** * Returns the past purchase page number */ const pastPurchasePage: (state: Store.State) => number; /** * Returns the last page index, ie number of pages */ const pastPurchaseTotalPages: (state: Store.State) => number; /** * Returns the page sizes object. */ const pastPurchasePageSizes: (state: Store.State) => Store.SelectableList; /** * Returns the current selected page size. */ const pastPurchasePageSize: (state: Store.State) => number; /** * Returns the index of the selected page size. */ const pastPurchasePageSizeIndex: (state: Store.State) => number; /** * Returns the sort list for past purchases */ const pastPurchaseSort: (state: Store.State) => Store.LabeledSelectableList; /** * Returns the currently selected sort for past purchases */ const pastPurchaseSortSelected: (state: Store.State) => Store.PastPurchases.PastPurchaseSort; /** * Returns pastPurchases templates */ const pastPurchaseTemplate: (state: Store.State) => Store.Template; /** * Returns pastPurchases siteParams */ const pastPurchaseSiteParams: (state: Store.State) => Store.SiteParams[]; /** * Returns whether or not biasing has been rehydrated from localstorage */ const realTimeBiasesHydrated: (state: Store.State) => any; /** * Returns the ui state for the all of the tags with the given tagName. */ const uiTagStates: (state: Store.State, tagName: string) => { [tagId: number]: any; global?: any; }; /** * Returns the ui state for the tag with the given tagName and id. */ const uiTagState: (state: Store.State, tagName: string, id: string) => any; /** * Helper function to get selected navigations from an array of navigations. */ const getSelected: (allNavigations: Store.Navigation[]) => SelectedRefinement[]; /** * Helper function to display record count limited by the max records we can * return from the database. */ const getLimitedCountDisplay: (count: number) => string; } export default Selectors;