UNPKG

@ly-js/automatic

Version:

automatic of vue

57 lines (56 loc) 1.53 kB
import type { Router, RouteRecordRaw } from 'vue-router'; export interface LyMeta { affix?: boolean; keepAlive?: boolean; hidden?: boolean; title?: string; icon?: string; activeMenu?: string; } export declare type LyRouteRecordRaw = RouteRecordRaw & { meta?: LyMeta; children?: LyRouteRecordRaw[]; }; interface PageMenu extends Omit<LyRouteRecordRaw, 'component' | 'children' | 'path'> { path?: string; component?: string; layoutComponent?: string; children?: PageMenu[]; } interface NestedRoute extends PageMenu { component: string; include?: string | string[]; exclude?: string | string[]; } interface Pages { pages?: Array<PageMenu>; nestedRoutes?: Array<NestedRoute>; include?: string | string[]; exclude?: string | string[]; } export type { Pages, NestedRoute, PageMenu }; export declare type Module = { [key: string]: any; }; export declare type Modules = Record<string, () => Promise<Module>>; export declare type ModuleConfig = LyRouteRecordRaw & { _path: string; }; export interface Options { basePath: string; baseMenuPath: string; router: Router; lastComponent?: RouteRecordRaw[]; page?: { indexFileName?: string; detailFileName?: string; detailParamKey?: string; }; } export interface WebpackRequireContext { keys(): string[]; (id: string): any; <T>(id: string): T; resolve(id: string): string; id: string; }