s-uni-router
Version:
一个uni-app 路由管理解决方案
17 lines (16 loc) • 681 B
TypeScript
export interface RouterLocation {
url: string;
query?: Record<string, any>;
}
export declare const NavigateNames: {
readonly navigateTo: "navigateTo";
readonly redirectTo: "redirectTo";
readonly switchTab: "switchTab";
readonly reLaunch: "reLaunch";
};
export type NavigateNamesType = (typeof NavigateNames)[keyof typeof NavigateNames];
export type BeforeEachGuardsReturn = boolean | (RouterLocation & {
navigateName?: NavigateNamesType;
});
export type onGuards<R = boolean | undefined> = (form: RouterLocation | null, to: RouterLocation) => R | Promise<R>;
export type ToRouterPath<T extends Record<string, any> = {}> = (RouterLocation & T) | string;