UNPKG

omi-router

Version:

Router for Omi

42 lines (41 loc) 1.04 kB
import { Key } from 'path-to-regexp'; import { Component } from 'omi'; export interface Route { path: string; render?: Function; beforeEnter?: Function; meta?: object; transition?: string; keys?: Key[]; regex?: RegExp; redirect?: string; } interface Props { routes: Route[]; base?: string; hash?: boolean; } export declare class RouterView extends Component<Props> { currentRoute: Route | null; routes: Route[]; beforeEachCallback: Function | undefined; afterEachCallback: Function | undefined; isHashMode: boolean; params: Record<string, unknown>; query: Record<string, unknown>; hash: string; base: string; install(): void; getRoutePath(): string; getQueryPath(): string; beforeEach(callback: Function): void; afterEach(callback: Function): void; push(path: string): void; replace(path: string): void; go(n: number): void; back(): void; forward(): void; private matchAndRender; render(): any; } export {};