UNPKG

smart-react-components

Version:

React UI library, wide variety of editable ready to use Styled and React components.

51 lines (50 loc) 1.52 kB
import { Path, Url, RouteProps, LoaderMethod, RouteMatch } from "../types/router"; export default class RouterHelper { /** * Gets window location. */ static getUrl(): string; /** * Creates a url object by the fullpath. * * @param fullpath */ static setUrl(fullpath: string): Url; /** * Runs all the matched get methods from loader modules for ssr. * * @param routes * @param fullpath * @param params */ static runLoaders(routes: RouteProps[], fullpath: string, params?: any): Promise<LoaderMethod[]>; /** * Gets all the matched get methods from loader modules. * * @param routes * @param url * @param query * @param arr * @param params */ static getLoaderMethods(routes: RouteProps[], url: string, query: { [key: string]: string; }, arr: LoaderMethod[], params: any, oldUrl?: Url, setPercentage?: Function, setCancelCallback?: Function): Promise<void>; /** * Checks if the given path matches the url. * * @param url * @param param1 */ static matchPath(url: string, query: { [key: string]: string; }, { path, exact, emptyQueryActive, searchKeys, defaultSearchValues }: { path: Path; exact: boolean; emptyQueryActive?: boolean; searchKeys: string[]; defaultSearchValues?: { [key: string]: string; }; }): RouteMatch; }