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

30 lines
907 B
TypeScript

import { Router, NavigationGuard } from 'vue-router';
import { Ref } from 'vue';
declare module '@fesjs/fes' {
interface PluginBuildConfig {
access?:
| {
rules: Record<string, []>;
}
| false;
}
interface PluginRuntimeConfig {
access?: {
noFoundHandler: (param: { router: Router } & NavigationGuard) => void;
unAccessHandler: (param: { router: Router } & NavigationGuard) => void;
};
}
export function access(): {
hasAccess(accessId: string | number): Promise<boolean>;
isDataReady(): boolean;
setRole(roleId: string | Promise<string>): void;
setAccess(accessIds: Array<string | number> | Promise<Array<string | number>>): void;
getAccess(): string[];
};
export function useAccess(accessId: Array<string | number>): Ref<boolean>;
}