soybean-admin/src/typings/elegant-router.d.ts

105 lines
2.5 KiB
TypeScript

/* eslint-disable */
/* prettier-ignore */
/* oxlint-disable */
// biome-ignore lint: disable
// Generated by elegant-router
// Read more: https://github.com/soybeanjs/elegant-router
declare module "@elegant-router/types" {
type RouteRecordSingleView = import("vue-router").RouteRecordSingleView;
type RouteRecordRedirect = import("vue-router").RouteRecordRedirect;
type RouteComponent = import("vue-router").RouteComponent;
type Lazy<T> = () => Promise<T>;
export type RawRouteComponent = RouteComponent | Lazy<RouteComponent>;
/**
* route layout key
*/
export type RouteLayoutKey = "base" | "blank";
/**
* route path map
*/
export type RoutePathMap = {
"Root": "/";
"NotFound": "/:pathMatch(.*)*";
"403": "/403";
"404": "/404";
"500": "/500";
"Home": "/home";
"IframeUrl": "/iframe/:url";
"Login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?";
"ManageApi": "/manage/api";
"ManageDictionary": "/manage/dictionary";
"ManageMenu": "/manage/menu";
"ManageOrganization": "/manage/organization";
"ManagePermission": "/manage/permission";
"ManageRole": "/manage/role";
"ManageRoute": "/manage/route";
"ManageUser": "/manage/user";
"Wip": "/wip";
};
/**
* route key
*/
export type RouteKey = keyof RoutePathMap;
/**
* route path
*/
export type RoutePath = RoutePathMap[RouteKey];
/**
* root route key
*/
export type RootRouteKey = 'Root';
/**
* not found route key
*/
export type NotFoundRouteKey = 'NotFound';
/**
* builtin route key
*/
export type BuiltinRouteKey = RootRouteKey | NotFoundRouteKey;
/**
* reuse route key
*/
export type ReuseRouteKey = never;
/**
* the route file key, which has it's own file
*/
export type RouteFileKey = Exclude<RouteKey, BuiltinRouteKey | ReuseRouteKey>;
/**
* mapped name and path
*/
type MappedNamePath = {
[K in RouteKey]: { name: K; path: RoutePathMap[K] };
}[RouteKey];
/**
* auto router single view
*/
export type AutoRouterSingleView = Omit<RouteRecordSingleView, 'component' | 'name' | 'path'> & {
component: RouteFileKey;
layout: RouteLayoutKey;
} & MappedNamePath;
/**
* auto router redirect
*/
export type AutoRouterRedirect = Omit<RouteRecordRedirect, 'children' | 'name' | 'path'> & MappedNamePath;
/**
* auto router route
*/
export type AutoRouterRoute = AutoRouterSingleView | AutoRouterRedirect;
}