fix: 修复 ts 类型声明问题

This commit is contained in:
winixt 2023-02-27 14:29:37 +08:00
parent 75b32b7dd0
commit 159fcf013b
2 changed files with 25 additions and 21 deletions

View File

@ -11,6 +11,28 @@ interface Menu {
}
export const Page: Component;
interface LayoutRuntimeConfig {
footer?: string;
theme?: 'dark' | 'light';
navigation?: 'side' | 'top' | 'mixin' | 'left-right';
title?: string;
isFixedHeader?: boolean;
isFixedSidebar?: boolean;
logo?: string;
multiTabs?: boolean;
sideWidth?: number;
menus?: Menu[] | (() => Ref<Menu[]> | Menu[]);
menuProps?: {
expandedKeys?: string[];
defaultExpandAll?: boolean;
accordion?: boolean;
};
renderCustom?: () => VNode | VNode[];
noFoundHandler?: (param: { router: Router } & NavigationGuard) => void;
unAccessHandler?: (param: { router: Router } & NavigationGuard) => void;
}
declare module '@fesjs/fes' {
interface RouteMeta {
'keep-alive'?: boolean;
@ -40,25 +62,6 @@ declare module '@fesjs/fes' {
| false;
}
interface PluginRuntimeConfig {
layout?: {
footer?: string;
theme?: 'dark' | 'light';
navigation?: 'side' | 'top' | 'mixin' | 'left-right';
title?: string;
isFixedHeader?: boolean;
isFixedSidebar?: boolean;
logo?: string;
multiTabs?: boolean;
sideWidth?: number;
menus?: Menu[] | (() => Ref<Menu[]> | Menu[]);
menuProps?: {
expandedKeys?: string[];
defaultExpandAll?: boolean;
accordion?: boolean;
};
renderCustom?: () => VNode | VNode[];
noFoundHandler?: (param: { router: Router } & NavigationGuard) => void;
unAccessHandler?: (param: { router: Router } & NavigationGuard) => void;
};
layout?: LayoutRuntimeConfig | ((layoutRuntimeConfig: LayoutRuntimeConfig, { initialState }: { initialState: any }) => LayoutRuntimeConfig);
}
}

View File

@ -21,6 +21,7 @@ type RenderFunc = () => Promise<App>;
interface Route {
base: string;
mode: string;
routes: RouteRecordRaw[];
createHistory: createMemoryHistory | createWebHashHistory | createWebHistory;
}
@ -32,7 +33,7 @@ declare module '@fesjs/fes' {
interface PluginRuntimeConfig {
beforeRender?: BeforeRenderConfig;
patchRoutes?: ({ routes }: { routes: RouteRecordRaw[] }) => void;
modifyRoute?: ({ base, mode, createHistory }: Route) => Route;
modifyRoute?: ({ base, mode, routes, createHistory }: Route) => Route;
modifyClientRenderOpts?: (option: ClientRenderOption) => ClientRenderOption;
rootContainer?: (component: DefineComponent, option: { routes: RouteRecordRaw[]; plugin: Plugin }) => Component;
onAppCreated?: ({ app, routes }: { app: App; routes: RouteRecordRaw[] }) => void;