import { Store } from '@storefront/flux-capacitor'; import { BaseService } from '../core/service'; import UrlBeautifier from '../core/url-beautifier'; import StoreFront from '../storefront'; import Utils from './urlUtils'; declare class UrlService extends BaseService { static getBasePath: typeof Utils.getBasePath; beautifier: UrlBeautifier.SimpleBeautifier; urlState: UrlService.UrlStateFunctions; history: UrlService.History; constructor(app: StoreFront, opts: UrlService.Options); init(): void; parse: (url: string) => Promise<{ route: string; request: any; }>; build: (route: string, state: Store.State) => any; readonly pushState: (data: any, title: any, url: any) => void; readonly replaceState: (data: any, title: any, url: any) => void; readonly initialUrl: string; historyListener(cb: (e: PopStateEvent) => void): void; generateRoutes(): any; rewind: (event: PopStateEvent) => void; } declare namespace UrlService { interface Options { beautifier?: UrlBeautifier.Configuration | UrlBeautifier.Factory; routes?: Routes; redirects?: { [target: string]: string; } | ((url: string) => any); urlHandler?: (url: string) => void; history?: UrlService.History; } interface Routes { search: string; details: string; navigation: string; pastpurchase: string; } type UrlStateFunction = (state: any) => any; interface UrlStateFunctions { search: UrlStateFunction; details: UrlStateFunction; navigation: UrlStateFunction; pastpurchase: UrlStateFunction; } interface History { pushState: (data: any, title: string, url: string) => void; replaceState: (data: any, title: string, url: string) => void; initialUrl: string; listener: (str: 'popstate', cb: (e: PopStateEvent) => void) => void; } } export default UrlService;