vue-pure-admin2/types/global.d.ts

177 lines
4.4 KiB
TypeScript
Raw Normal View History

2021-04-14 16:44:58 +08:00
import type {
VNode,
FunctionalComponent,
2022-11-25 12:49:38 +08:00
PropType as VuePropType,
ComponentPublicInstance
2021-04-20 14:33:07 +08:00
} from "vue";
import type { ECharts } from "echarts";
import type { IconifyIcon } from "@iconify/vue";
import type { TableColumns } from "@pureadmin/table";
2021-04-14 16:44:58 +08:00
2022-11-25 12:49:38 +08:00
/**
* `.vue` `.ts` `.tsx` 使
*/
2021-04-14 16:44:58 +08:00
declare global {
2022-11-25 12:49:38 +08:00
/**
*
*/
2022-03-02 20:47:14 +08:00
const __APP_INFO__: {
pkg: {
name: string;
version: string;
dependencies: Recordable<string>;
devDependencies: Recordable<string>;
};
lastBuildTime: string;
};
2022-11-25 12:49:38 +08:00
/**
* Window
*/
2021-09-17 10:29:59 +08:00
interface Window {
2021-04-14 16:44:58 +08:00
// Global vue app instance
2021-04-20 14:33:07 +08:00
__APP__: App<Element>;
2021-09-17 10:29:59 +08:00
webkitCancelAnimationFrame: (handle: number) => void;
2021-09-18 22:24:52 +08:00
mozCancelAnimationFrame: (handle: number) => void;
oCancelAnimationFrame: (handle: number) => void;
msCancelAnimationFrame: (handle: number) => void;
2021-09-17 10:29:59 +08:00
webkitRequestAnimationFrame: (callback: FrameRequestCallback) => number;
2021-09-18 22:24:52 +08:00
mozRequestAnimationFrame: (callback: FrameRequestCallback) => number;
oRequestAnimationFrame: (callback: FrameRequestCallback) => number;
msRequestAnimationFrame: (callback: FrameRequestCallback) => number;
2021-04-14 16:44:58 +08:00
}
2022-11-25 12:49:38 +08:00
/**
*
*/
type ViteCompression =
| "none"
| "gzip"
| "brotli"
| "both"
| "gzip-clear"
| "brotli-clear"
| "both-clear";
2022-11-25 12:49:38 +08:00
/**
*
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#%E5%85%B7%E4%BD%93%E9%85%8D%E7%BD%AE}
*/
interface ViteEnv {
2021-04-20 14:33:07 +08:00
VITE_PORT: number;
VITE_PUBLIC_PATH: string;
VITE_ROUTER_HISTORY: string;
VITE_CDN: boolean;
VITE_HIDE_HOME: string;
VITE_COMPRESSION: ViteCompression;
2021-04-14 16:44:58 +08:00
}
2022-11-25 12:49:38 +08:00
/**
* `@pureadmin/table` `TableColumns` 便
*/
interface TableColumnList extends Array<TableColumns> {}
/**
* `public/serverConfig.json`
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#serverconfig-json}
*/
interface ServerConfigs {
2021-10-08 11:32:50 +08:00
Version?: string;
Title?: string;
FixedHeader?: boolean;
HiddenSideBar?: boolean;
2021-11-26 22:54:29 +08:00
MultiTagsCache?: boolean;
2021-10-08 11:32:50 +08:00
KeepAlive?: boolean;
Locale?: string;
Layout?: string;
2021-10-28 09:52:21 +08:00
Theme?: string;
2021-12-22 13:40:59 +08:00
DarkMode?: boolean;
2021-11-09 19:24:55 +08:00
Grey?: boolean;
Weak?: boolean;
HideTabs?: boolean;
2021-12-29 21:51:05 +08:00
SidebarStatus?: boolean;
EpThemeColor?: string;
ShowLogo?: boolean;
2021-12-29 21:51:05 +08:00
ShowModel?: string;
MenuArrowIconNoTransition?: boolean;
CachingAsyncRoutes?: boolean;
TooltipEffect?: Effect;
ResponsiveStorageNameSpace?: string;
MapConfigure?: {
amapKey?: string;
options: {
resizeEnable?: boolean;
center?: number[];
zoom?: number;
};
};
2021-10-08 11:32:50 +08:00
}
2022-11-25 12:49:38 +08:00
/**
* `ServerConfigs`
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#serverconfig-json}
*/
interface StorageConfigs {
version?: string;
title?: string;
fixedHeader?: boolean;
hiddenSideBar?: boolean;
multiTagsCache?: boolean;
keepAlive?: boolean;
locale?: string;
layout?: string;
theme?: string;
darkMode?: boolean;
grey?: boolean;
weak?: boolean;
hideTabs?: boolean;
sidebarStatus?: boolean;
epThemeColor?: string;
showLogo?: boolean;
showModel?: string;
mapConfigure?: {
amapKey?: string;
options: {
resizeEnable?: boolean;
center?: number[];
zoom?: number;
};
};
username?: string;
}
2022-11-25 12:49:38 +08:00
/**
* `responsive-storage` `storage`
*/
interface ResponsiveStorage {
locale: {
locale?: string;
};
layout: {
layout?: string;
theme?: string;
darkMode?: boolean;
sidebarStatus?: boolean;
epThemeColor?: string;
};
configure: {
grey?: boolean;
weak?: boolean;
hideTabs?: boolean;
showLogo?: boolean;
showModel?: string;
multiTagsCache?: boolean;
};
tags?: Array<any>;
}
2022-11-25 12:49:38 +08:00
/**
* 访
*/
interface GlobalPropertiesApi {
$echarts: ECharts;
$storage: ResponsiveStorage;
$config: ServerConfigs;
}
}