mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-10-14 19:22:13 +08:00
fix: 优化类型提示
This commit is contained in:
parent
8a67774e46
commit
54d435538c
@ -3,6 +3,5 @@ import { name } from '../package.json';
|
|||||||
export default function (api) {
|
export default function (api) {
|
||||||
api.addConfigType(() => ({
|
api.addConfigType(() => ({
|
||||||
source: name,
|
source: name,
|
||||||
build: ['ViteBuildConfig'],
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
5
packages/fes-builder-vite/types.d.ts
vendored
5
packages/fes-builder-vite/types.d.ts
vendored
@ -4,11 +4,12 @@ import {Options as PolyfillOptions } from '@vitejs/plugin-legacy'
|
|||||||
import createPlugin from '@vitejs/plugin-vue-jsx'
|
import createPlugin from '@vitejs/plugin-vue-jsx'
|
||||||
import {createHtmlPlugin} from 'vite-plugin-html'
|
import {createHtmlPlugin} from 'vite-plugin-html'
|
||||||
|
|
||||||
|
declare module "@fesjs/fes" {
|
||||||
export interface ViteBuildConfig {
|
interface PluginBuildConfig {
|
||||||
viteOption?: UserConfig;
|
viteOption?: UserConfig;
|
||||||
viteVuePlugin?: Options;
|
viteVuePlugin?: Options;
|
||||||
viteVueJsx?: Parameters<typeof createPlugin>[0];
|
viteVueJsx?: Parameters<typeof createPlugin>[0];
|
||||||
viteLegacy?: PolyfillOptions;
|
viteLegacy?: PolyfillOptions;
|
||||||
viteHtml?: Parameters<typeof createHtmlPlugin>[0]
|
viteHtml?: Parameters<typeof createHtmlPlugin>[0]
|
||||||
}
|
}
|
||||||
|
}
|
@ -3,6 +3,5 @@ import { name } from '../../package.json';
|
|||||||
export default function (api) {
|
export default function (api) {
|
||||||
api.addConfigType(() => ({
|
api.addConfigType(() => ({
|
||||||
source: name,
|
source: name,
|
||||||
build: ['WebpackBuildConfig'],
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
5
packages/fes-builder-webpack/types.d.ts
vendored
5
packages/fes-builder-webpack/types.d.ts
vendored
@ -7,7 +7,8 @@ interface CopyFileType {
|
|||||||
to: string;
|
to: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WebpackBuildConfig {
|
declare module "@fesjs/fes" {
|
||||||
|
interface PluginBuildConfig {
|
||||||
analyze?: {
|
analyze?: {
|
||||||
analyzerMode?: 'server' | 'static' | 'disabled';
|
analyzerMode?: 'server' | 'static' | 'disabled';
|
||||||
analyzerHost?: string;
|
analyzerHost?: string;
|
||||||
@ -53,5 +54,5 @@ export interface WebpackBuildConfig {
|
|||||||
};
|
};
|
||||||
postcssLoader?: Record<string, any>;
|
postcssLoader?: Record<string, any>;
|
||||||
vueLoader?: object;
|
vueLoader?: object;
|
||||||
|
}
|
||||||
}
|
}
|
@ -56,7 +56,5 @@ export default (api) => {
|
|||||||
|
|
||||||
api.addConfigType(() => ({
|
api.addConfigType(() => ({
|
||||||
source: name,
|
source: name,
|
||||||
runtime: ['AccessRuntimeConfig'],
|
|
||||||
build: ['AccessBuildConfig'],
|
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
6
packages/fes-plugin-access/types.d.ts
vendored
6
packages/fes-plugin-access/types.d.ts
vendored
@ -1,14 +1,16 @@
|
|||||||
import { Router, NavigationGuard } from 'vue-router';
|
import { Router, NavigationGuard } from 'vue-router';
|
||||||
|
|
||||||
export interface AccessBuildConfig {
|
declare module "@fesjs/fes" {
|
||||||
|
interface PluginBuildConfig {
|
||||||
access: {
|
access: {
|
||||||
rules: Record<string, []>;
|
rules: Record<string, []>;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AccessRuntimeConfig {
|
interface PluginRuntimeConfig {
|
||||||
access: {
|
access: {
|
||||||
noFoundHandler: (param: { router: Router } & NavigationGuard) => void;
|
noFoundHandler: (param: { router: Router } & NavigationGuard) => void;
|
||||||
unAccessHandler: (param: { router: Router } & NavigationGuard) => void;
|
unAccessHandler: (param: { router: Router } & NavigationGuard) => void;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -46,6 +46,5 @@ export default (api) => {
|
|||||||
|
|
||||||
api.addConfigType(() => ({
|
api.addConfigType(() => ({
|
||||||
source: name,
|
source: name,
|
||||||
build: ['EnumsBuildConfig'],
|
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
4
packages/fes-plugin-enums/types.d.ts
vendored
4
packages/fes-plugin-enums/types.d.ts
vendored
@ -1,8 +1,10 @@
|
|||||||
|
|
||||||
export interface EnumsBuildConfig {
|
declare module "@fesjs/fes" {
|
||||||
|
interface PluginBuildConfig {
|
||||||
enums: {
|
enums: {
|
||||||
[key: string]: [string | number, string | number][]
|
[key: string]: [string | number, string | number][]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,7 +78,5 @@ export default (api) => {
|
|||||||
|
|
||||||
api.addConfigType(() => ({
|
api.addConfigType(() => ({
|
||||||
source: name,
|
source: name,
|
||||||
runtime: ['LayoutRuntimeConfig'],
|
|
||||||
build: ['LayoutBuildConfig'],
|
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
9
packages/fes-plugin-layout/types.d.ts
vendored
9
packages/fes-plugin-layout/types.d.ts
vendored
@ -10,7 +10,8 @@ interface Menu {
|
|||||||
children?: Menu[]
|
children?: Menu[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LayoutBuildConfig {
|
declare module "@fesjs/fes" {
|
||||||
|
interface PluginBuildConfig {
|
||||||
layout: {
|
layout: {
|
||||||
title: string;
|
title: string;
|
||||||
footer: string;
|
footer: string;
|
||||||
@ -23,10 +24,7 @@ export interface LayoutBuildConfig {
|
|||||||
menus: Menu[];
|
menus: Menu[];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
interface PluginRuntimeConfig {
|
||||||
|
|
||||||
|
|
||||||
export interface LayoutRuntimeConfig {
|
|
||||||
layout: {
|
layout: {
|
||||||
header: boolean;
|
header: boolean;
|
||||||
sidebar: boolean;
|
sidebar: boolean;
|
||||||
@ -36,3 +34,4 @@ export interface LayoutRuntimeConfig {
|
|||||||
unAccessHandler: (param: { router: Router } & NavigationGuard) => void;
|
unAccessHandler: (param: { router: Router } & NavigationGuard) => void;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
@ -85,6 +85,5 @@ export default (api) => {
|
|||||||
|
|
||||||
api.addConfigType(() => ({
|
api.addConfigType(() => ({
|
||||||
source: name,
|
source: name,
|
||||||
build: ['LocalBuildConfig'],
|
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
4
packages/fes-plugin-locale/types.d.ts
vendored
4
packages/fes-plugin-locale/types.d.ts
vendored
@ -1,4 +1,5 @@
|
|||||||
export interface LocalBuildConfig {
|
declare module "@fesjs/fes" {
|
||||||
|
interface PluginBuildConfig {
|
||||||
locale: {
|
locale: {
|
||||||
locale: string;
|
locale: string;
|
||||||
fallbackLocale: string;
|
fallbackLocale: string;
|
||||||
@ -6,3 +7,4 @@ export interface LocalBuildConfig {
|
|||||||
legacy: boolean;
|
legacy: boolean;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -89,6 +89,5 @@ export default (api) => {
|
|||||||
|
|
||||||
api.addConfigType(() => ({
|
api.addConfigType(() => ({
|
||||||
source: name,
|
source: name,
|
||||||
build: ['MonacoEditorBuildConfig'],
|
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
4
packages/fes-plugin-monaco-editor/types.d.ts
vendored
4
packages/fes-plugin-monaco-editor/types.d.ts
vendored
@ -1,7 +1,8 @@
|
|||||||
import type { EditorLanguage } from 'monaco-editor-webpack-plugin/out/languages';
|
import type { EditorLanguage } from 'monaco-editor-webpack-plugin/out/languages';
|
||||||
import type { EditorFeature } from 'monaco-editor-webpack-plugin/out/features';
|
import type { EditorFeature } from 'monaco-editor-webpack-plugin/out/features';
|
||||||
|
|
||||||
export interface MonacoEditorBuildConfig {
|
declare module "@fesjs/fes" {
|
||||||
|
interface PluginBuildConfig {
|
||||||
monacoEditor: {
|
monacoEditor: {
|
||||||
filename: string;
|
filename: string;
|
||||||
publicPath: string;
|
publicPath: string;
|
||||||
@ -10,3 +11,4 @@ export interface MonacoEditorBuildConfig {
|
|||||||
globalAPI: boolean;
|
globalAPI: boolean;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
6
packages/fes-plugin-qiankun/types.d.ts
vendored
6
packages/fes-plugin-qiankun/types.d.ts
vendored
@ -6,7 +6,9 @@ interface AppOption {
|
|||||||
props: Record<string, any>;
|
props: Record<string, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface QiankunBuildConfig {
|
|
||||||
|
declare module "@fesjs/fes" {
|
||||||
|
interface PluginBuildConfig {
|
||||||
qiankun: {
|
qiankun: {
|
||||||
main: {
|
main: {
|
||||||
apps: AppOption[];
|
apps: AppOption[];
|
||||||
@ -15,5 +17,5 @@ export interface QiankunBuildConfig {
|
|||||||
};
|
};
|
||||||
micro: {}
|
micro: {}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,5 @@ export default (api) => {
|
|||||||
|
|
||||||
api.addConfigType(() => ({
|
api.addConfigType(() => ({
|
||||||
source: name,
|
source: name,
|
||||||
runtime: ['RequestRuntimeConfig'],
|
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
23
packages/fes-plugin-request/types.d.ts
vendored
23
packages/fes-plugin-request/types.d.ts
vendored
@ -1,18 +1,27 @@
|
|||||||
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
import { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
|
||||||
|
import {Ref} from 'vue';
|
||||||
|
|
||||||
|
|
||||||
type RequestInterceptor = (value: AxiosRequestConfig) => AxiosRequestConfig | [(value: AxiosRequestConfig) => AxiosRequestConfig, (error: any) => any];
|
type RequestInterceptor = (value: AxiosRequestConfig) => AxiosRequestConfig | [(value: AxiosRequestConfig) => AxiosRequestConfig, (error: any) => any];
|
||||||
type ResponseInterceptor = (value: AxiosResponse) => AxiosResponse | [(value: AxiosResponse) => AxiosResponse, (error: any) => any];
|
type ResponseInterceptor = (value: AxiosResponse) => AxiosResponse | [(value: AxiosResponse) => AxiosResponse, (error: any) => any];
|
||||||
|
|
||||||
|
interface RequestPluginOption {
|
||||||
|
mergeRequest: boolean;
|
||||||
|
cache: boolean | {
|
||||||
|
type: 'ram' | 'sessionStorage' | 'localStorage',
|
||||||
|
cacheTime: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export interface RequestRuntimeConfig {
|
declare module "@fesjs/fes" {
|
||||||
|
interface PluginRuntimeConfig {
|
||||||
request: {
|
request: {
|
||||||
responseDataAdaptor?<T>(data: T): T;
|
dataHandler?(data: any, response: AxiosResponse): any;
|
||||||
closeResDataCheck?: boolean;
|
errorHandler?(error: AxiosError | {type: string, msg: string, [key: string]: string}): void;
|
||||||
requestInterceptors?: RequestInterceptor[];
|
requestInterceptors?: RequestInterceptor[];
|
||||||
responseInterceptors?: ResponseInterceptor[];
|
responseInterceptors?: ResponseInterceptor[];
|
||||||
errorHandler?: {
|
|
||||||
[key: string]: (error: { response: AxiosResponse } | AxiosResponse) => void;
|
|
||||||
};
|
|
||||||
} & AxiosRequestConfig;
|
} & AxiosRequestConfig;
|
||||||
}
|
}
|
||||||
|
export function request(url: string, data: null | Record<string, any>, options: AxiosRequestConfig & RequestPluginOption ): Promise<any>
|
||||||
|
export function useRequest(url: string, data: null | Record<string, any>, options: AxiosRequestConfig & RequestPluginOption ): {loadingRef: Ref<boolean>; errorRef: Ref<Error>; dataRef: Ref<any>}
|
||||||
|
}
|
@ -61,6 +61,5 @@ export default (api) => {
|
|||||||
|
|
||||||
api.addConfigType(() => ({
|
api.addConfigType(() => ({
|
||||||
source: name,
|
source: name,
|
||||||
build: ['VuexBuildConfig'],
|
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
5
packages/fes-plugin-vuex/types.d.ts
vendored
5
packages/fes-plugin-vuex/types.d.ts
vendored
@ -1,9 +1,12 @@
|
|||||||
|
|
||||||
export interface VuexBuildConfig {
|
|
||||||
|
declare module "@fesjs/fes" {
|
||||||
|
interface PluginBuildConfig {
|
||||||
vuex: {
|
vuex: {
|
||||||
strict: boolean;
|
strict: boolean;
|
||||||
devtools: boolean;
|
devtools: boolean;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,6 +69,5 @@ export default (api) => {
|
|||||||
|
|
||||||
api.addConfigType(() => ({
|
api.addConfigType(() => ({
|
||||||
source: name,
|
source: name,
|
||||||
build: ['WindicssBuildConfig'],
|
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
4
packages/fes-plugin-windicss/types.d.ts
vendored
4
packages/fes-plugin-windicss/types.d.ts
vendored
@ -1,7 +1,9 @@
|
|||||||
import type { Config } from 'windicss/types/interfaces';
|
import type { Config } from 'windicss/types/interfaces';
|
||||||
|
|
||||||
export interface WindicssBuildConfig {
|
declare module "@fesjs/fes" {
|
||||||
|
interface PluginBuildConfig {
|
||||||
windicss: {
|
windicss: {
|
||||||
config: Config
|
config: Config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
function importsToStr(imports) {
|
function importsToStr(imports) {
|
||||||
return imports.map((imp) => {
|
return imports.map((imp) => {
|
||||||
const { source, build = [], runtime = [] } = imp;
|
const { source } = imp;
|
||||||
return `import {${build.concat(runtime).join(', ')}} from '${source}';`;
|
return `import '${source}';`;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function genTypeContent(imports) {
|
function genTypeContent(imports) {
|
||||||
return {
|
return {
|
||||||
RUNTIME_TYPES: imports.reduce((previousValue, currentValue) => previousValue.concat(currentValue.runtime || []), []).join(' & '),
|
|
||||||
BUILD_TYPES: imports.reduce((previousValue, currentValue) => previousValue.concat(currentValue.build || []), []).join(' & '),
|
|
||||||
imports: importsToStr(imports).join('\n'),
|
imports: importsToStr(imports).join('\n'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -21,9 +19,6 @@ export default function (api) {
|
|||||||
api.onGenerateFiles(async () => {
|
api.onGenerateFiles(async () => {
|
||||||
const typeTpl = `
|
const typeTpl = `
|
||||||
{{{ imports }}}
|
{{{ imports }}}
|
||||||
|
|
||||||
export type PluginRuntimeConfig = {{{RUNTIME_TYPES}}};
|
|
||||||
export type PluginBuildConfig = {{{BUILD_TYPES}}};
|
|
||||||
`;
|
`;
|
||||||
const importSources = await api.applyPlugins({
|
const importSources = await api.applyPlugins({
|
||||||
key: 'addConfigType',
|
key: 'addConfigType',
|
||||||
|
25
packages/fes-preset-built-in/types.d.ts
vendored
25
packages/fes-preset-built-in/types.d.ts
vendored
@ -18,18 +18,9 @@ interface ClientRenderOption {
|
|||||||
|
|
||||||
type RenderFunc = () => Promise<App>
|
type RenderFunc = () => Promise<App>
|
||||||
|
|
||||||
export interface InnerRuntimeConfig {
|
|
||||||
beforeRender?: (option: BeforeRenderConfig) => BeforeRenderConfig;
|
|
||||||
patchRoutes?: ({ routes }: { routes: RouteRecordRaw[] }) => void;
|
|
||||||
modifyClientRenderOpts?: (option: ClientRenderOption) => ClientRenderOption;
|
|
||||||
rootContainer?: (component: DefineComponent, option: { routes: RouteRecordRaw[], plugin: Plugin }) => DefineComponent;
|
|
||||||
onAppCreated?: ({ app, routes }: { app: App, routes: RouteRecordRaw[] }) => void;
|
|
||||||
render?: (defaultRender: RenderFunc) => RenderFunc;
|
|
||||||
onRouterCreated?: ({ router }: { router: Router }) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
declare module "@fesjs/fes" {
|
||||||
export interface InnerBuildConfig {
|
interface PluginBuildConfig {
|
||||||
alias?: Record<string, string>,
|
alias?: Record<string, string>,
|
||||||
autoprefixer?: {
|
autoprefixer?: {
|
||||||
/** environment for `Browserslist` */
|
/** environment for `Browserslist` */
|
||||||
@ -90,3 +81,15 @@ export interface InnerBuildConfig {
|
|||||||
terserOptions?: object;
|
terserOptions?: object;
|
||||||
title?: string;
|
title?: string;
|
||||||
}
|
}
|
||||||
|
interface PluginRuntimeConfig {
|
||||||
|
beforeRender?: (option: BeforeRenderConfig) => BeforeRenderConfig;
|
||||||
|
patchRoutes?: ({ routes }: { routes: RouteRecordRaw[] }) => void;
|
||||||
|
modifyClientRenderOpts?: (option: ClientRenderOption) => ClientRenderOption;
|
||||||
|
rootContainer?: (component: DefineComponent, option: { routes: RouteRecordRaw[], plugin: Plugin }) => DefineComponent;
|
||||||
|
onAppCreated?: ({ app, routes }: { app: App, routes: RouteRecordRaw[] }) => void;
|
||||||
|
render?: (defaultRender: RenderFunc) => RenderFunc;
|
||||||
|
onRouterCreated?: ({ router }: { router: Router }) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRouter(): Router;
|
||||||
|
}
|
||||||
|
@ -1,42 +1,46 @@
|
|||||||
import { defineRuntimeConfig } from '@fesjs/fes';
|
import { defineRuntimeConfig } from '@fesjs/fes';
|
||||||
|
|
||||||
export default defineRuntimeConfig({
|
export default defineRuntimeConfig({
|
||||||
request: {
|
request: {},
|
||||||
baseURL: '/ras-mas',
|
|
||||||
dataHandler(data) {
|
|
||||||
if (data?.code !== '0') {
|
|
||||||
if (data.code === '10000') {
|
|
||||||
console.log('code', data.code);
|
|
||||||
}
|
|
||||||
if (data?.code === '20000') {
|
|
||||||
console.log('code', data.code);
|
|
||||||
}
|
|
||||||
throw new Error(data);
|
|
||||||
}
|
|
||||||
return data.result ? data.result : data;
|
|
||||||
},
|
|
||||||
errorHandler(error) {
|
|
||||||
if (error.response) {
|
|
||||||
// 请求成功发出且服务器也响应了状态码,但状态代码超出了 2xx 的范围
|
|
||||||
console.log(error.response.data);
|
|
||||||
console.log(error.response.status);
|
|
||||||
console.log(error.response.headers);
|
|
||||||
} else if (error.request) {
|
|
||||||
// 请求已经成功发起,但没有收到响应
|
|
||||||
// `error.request` 在浏览器中是 XMLHttpRequest 的实例,
|
|
||||||
// 而在node.js中是 http.ClientRequest 的实例
|
|
||||||
console.log(error.request);
|
|
||||||
} else if (error.type) {
|
|
||||||
// 插件异常
|
|
||||||
console.log(error.msg);
|
|
||||||
} else {
|
|
||||||
// 发送请求时出了点问题
|
|
||||||
console.log('Error', error.message);
|
|
||||||
}
|
|
||||||
console.log(error.config);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
patchRoutes: () => {
|
|
||||||
console.log('patchRoutes');
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// export default defineRuntimeConfig({
|
||||||
|
// request: {
|
||||||
|
// baseURL: '/ras-mas',
|
||||||
|
// dataHandler(data) {
|
||||||
|
// if (data?.code !== '0') {
|
||||||
|
// if (data.code === '10000') {
|
||||||
|
// console.log('code', data.code);
|
||||||
|
// }
|
||||||
|
// if (data?.code === '20000') {
|
||||||
|
// console.log('code', data.code);
|
||||||
|
// }
|
||||||
|
// throw new Error(data);
|
||||||
|
// }
|
||||||
|
// return data.result ? data.result : data;
|
||||||
|
// },
|
||||||
|
// errorHandler(error) {
|
||||||
|
// if (error.response) {
|
||||||
|
// // 请求成功发出且服务器也响应了状态码,但状态代码超出了 2xx 的范围
|
||||||
|
// console.log(error.response.data);
|
||||||
|
// console.log(error.response.status);
|
||||||
|
// console.log(error.response.headers);
|
||||||
|
// } else if (error.request) {
|
||||||
|
// // 请求已经成功发起,但没有收到响应
|
||||||
|
// // `error.request` 在浏览器中是 XMLHttpRequest 的实例,
|
||||||
|
// // 而在node.js中是 http.ClientRequest 的实例
|
||||||
|
// console.log(error.request);
|
||||||
|
// } else if (error.type) {
|
||||||
|
// // 插件异常
|
||||||
|
// console.log(error.msg);
|
||||||
|
// } else {
|
||||||
|
// // 发送请求时出了点问题
|
||||||
|
// console.log('Error', error.message);
|
||||||
|
// }
|
||||||
|
// console.log(error.config);
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// patchRoutes: () => {
|
||||||
|
// console.log('patchRoutes');
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
16
packages/fes/types.d.ts
vendored
16
packages/fes/types.d.ts
vendored
@ -1,17 +1,21 @@
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import type { PluginRuntimeConfig, PluginBuildConfig } from '@@/configType';
|
import '@@/configType';
|
||||||
|
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
export * from '@@/core/coreExports';
|
// export * from '@@/core/coreExports';
|
||||||
// @ts-ignore
|
// // @ts-ignore
|
||||||
export * from '@@/core/pluginExports';
|
// export * from '@@/core/pluginExports';
|
||||||
|
|
||||||
interface RouteMeta {
|
export interface RouteMeta {
|
||||||
name?: string;
|
name?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
layout?: boolean | { sidebar?: boolean; header?: boolean; logo?: boolean };
|
layout?: boolean | { sidebar?: boolean; header?: boolean; logo?: boolean };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PluginRuntimeConfig {}
|
||||||
|
|
||||||
|
export interface PluginBuildConfig {}
|
||||||
|
|
||||||
export declare function defineRouteMeta(routeMeta: RouteMeta): RouteMeta;
|
export declare function defineRouteMeta(routeMeta: RouteMeta): RouteMeta;
|
||||||
|
|
||||||
export function defineBuildConfig(config: PluginBuildConfig ): PluginBuildConfig;
|
export function defineBuildConfig(config: PluginBuildConfig ): PluginBuildConfig;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user