fes.js/packages/fes-plugin-layout/types.d.ts
qlin dc3e0aceb1
Ts type (#133)
* fix: 优化类型提示

* fix: 添加 enums 接口类型声明

* feat: 配置插件api提示

Co-authored-by: wanchun <445436867@qq.com>
2022-06-22 19:24:49 +08:00

60 lines
1.8 KiB
TypeScript

import { Component, VNode, Ref } from 'vue';
import { Router, NavigationGuard } from 'vue-router';
interface Menu {
name: string;
path: string;
match: string[];
title: string;
icon: string | Component;
children?: Menu[];
}
declare module '@fesjs/fes' {
interface PluginBuildConfig {
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[];
menuProps: {
expandedKeys: string[];
defaultExpandAll: boolean;
accordion: boolean;
};
}
| 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[];
noFoundHandler: (param: { router: Router } & NavigationGuard) => void;
unAccessHandler: (param: { router: Router } & NavigationGuard) => void;
};
}
export const Page: Component;
}