import { Store } from '@storefront/flux-capacitor'; import { Request } from 'groupby-api'; import UrlBeautifier from '../core/url-beautifier'; declare namespace UrlUtils { const getBaseUri: () => string; const getBasePath: () => string; const searchUrlState: (state: Store.State) => UrlBeautifier.SearchUrlState; const detailsUrlState: (state: Store.State) => UrlBeautifier.DetailsUrlState; const navigationUrlState: (state: Store.State) => any; const pastPurchaseUrlState: (state: Store.State) => UrlBeautifier.SearchUrlState; const stateToBaseRequest: (state: UrlBeautifier.SearchUrlState, store: Store.State) => Partial; const searchStateToRequest: (state: UrlBeautifier.SearchUrlState, store: Store.State) => Partial; const pastPurchaseStateToRequest: (state: UrlBeautifier.SearchUrlState, store: Store.State) => Partial; const getSortIndex: (stateSort: Store.Sort[], requestSort: Store.Sort) => number; const getNavigations: (state: Store.Indexed | Store.AvailableNavigations, request: UrlBeautifier.SearchUrlState) => { allIds: string[]; byId: { [x: string]: Store.Navigation; } | { [x: string]: Store.Navigation; }; }; const getAllIds: (state: Store.Indexed | Store.AvailableNavigations, { refinements }: { refinements?: any[]; }) => string[]; const getById: (state: Store.Indexed | Store.AvailableNavigations, { refinements }: { refinements?: any[]; }) => { [x: string]: Store.Navigation; } | { [x: string]: Store.Navigation; }; const mergePastPurchaseState: (state: Store.State, request: UrlBeautifier.SearchUrlState) => { data: { present: { pastPurchases: { page: { current: number; sizes: { selected: number; items: number[]; }; first: 1; previous?: number; next?: number; last?: number; from?: number; to?: number; }; navigations: { allIds: string[]; byId: { [x: string]: Store.Navigation; } | { [x: string]: Store.Navigation; }; }; sort: { selected: number; items: Store.Sort[]; }; query: string; defaultSkus: Store.PastPurchases.PastPurchaseProduct[]; skus: Store.PastPurchases.PastPurchaseProduct[]; saytPastPurchases: Store.ProductWithMetadata[]; products: Store.ProductWithMetadata[]; count: Store.PastPurchases.PastPurchaseCount; template?: Store.Template; siteParams?: Store.SiteParams[]; }; area: string; query: Store.Query; sorts: Store.LabeledSelectableList; products: Store.ProductWithMetadata[]; productsLoaded: boolean; collections: Store.Indexed.Selectable; navigations: Store.AvailableNavigations; autocomplete: Store.Autocomplete; history: Store.History; page: Store.Page; template?: Store.Template; details: Store.Details; recommendations: Store.Recommendations; personalization?: Store.Personalization; infiniteScroll: Store.InfiniteScroll; recordCount: number; redirect?: string; fields: string[]; siteParams: Store.SiteParams[]; errors: string[]; warnings: string[]; }; past: Store.Data[]; future: Store.Data[]; }; isRunning: boolean; isFetching: Store.IsFetching; session: Store.Session; ui: Store.UI; }; const mergePastPurchasePageState: (state: Store.State, request: UrlBeautifier.SearchUrlState) => { current: number; sizes: { selected: number; items: number[]; }; first: 1; previous?: number; next?: number; last?: number; from?: number; to?: number; }; const mergePastPurchaseNavigationsState: (state: Store.State, request: UrlBeautifier.SearchUrlState) => { allIds: string[]; byId: { [x: string]: Store.Navigation; } | { [x: string]: Store.Navigation; }; }; const mergeSearchState: (state: Store.State, request: UrlBeautifier.SearchUrlState) => { data: { present: { query: { original: string; corrected?: string; related: string[]; didYouMean: string[]; rewrites: string[]; }; page: { current: number; sizes: { selected: number; items: number[]; }; first: 1; previous?: number; next?: number; last?: number; from?: number; to?: number; }; collections: { selected: string; byId: { [key: string]: Store.Collection; }; allIds: string[]; }; sorts: { selected: number; items: Store.Sort[]; }; navigations: { allIds: string[]; byId: { [x: string]: Store.Navigation; } | { [x: string]: Store.Navigation; }; sort: Store.Recommendations.Navigation[]; }; area: string; products: Store.ProductWithMetadata[]; productsLoaded: boolean; autocomplete: Store.Autocomplete; history: Store.History; template?: Store.Template; details: Store.Details; recommendations: Store.Recommendations; personalization?: Store.Personalization; pastPurchases: Store.PastPurchase; infiniteScroll: Store.InfiniteScroll; recordCount: number; redirect?: string; fields: string[]; siteParams: Store.SiteParams[]; errors: string[]; warnings: string[]; }; past: Store.Data[]; future: Store.Data[]; }; isRunning: boolean; isFetching: Store.IsFetching; session: Store.Session; ui: Store.UI; }; const mergeSearchQueryState: (state: Store.State, request: UrlBeautifier.SearchUrlState) => { original: string; corrected?: string; related: string[]; didYouMean: string[]; rewrites: string[]; }; const mergeSearchPageState: (state: Store.State, request: UrlBeautifier.SearchUrlState) => { current: number; sizes: { selected: number; items: number[]; }; first: 1; previous?: number; next?: number; last?: number; from?: number; to?: number; }; const mergeSearchCollectionsState: (state: Store.State, request: UrlBeautifier.SearchUrlState) => { selected: string; byId: { [key: string]: Store.Collection; }; allIds: string[]; }; const mergePastPurchaseSortsState: (state: Store.State, request: UrlBeautifier.SearchUrlState) => { selected: number; items: Store.Sort[]; }; const mergeSearchSortsState: (state: Store.State, request: UrlBeautifier.SearchUrlState) => { selected: number; items: Store.Sort[]; }; const mergeSortsState: (sorts: Store.SelectableList, request: UrlBeautifier.SearchUrlState) => { selected: number; items: Store.Sort[]; }; const mergeSearchNavigationsState: (state: Store.State, request: UrlBeautifier.SearchUrlState) => { allIds: string[]; byId: { [x: string]: Store.Navigation; } | { [x: string]: Store.Navigation; }; sort: Store.Recommendations.Navigation[]; }; } export default UrlUtils;