2022-12-05 01:57:30 +08:00
|
|
|
|
import type { ECharts } from "echarts";
|
2022-11-21 11:42:33 +08:00
|
|
|
|
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
|
|
|
|
/**
|
2024-01-14 11:00:35 +08:00
|
|
|
|
* 平台的名称、版本、运行所需的`node`和`pnpm`版本、依赖、最后构建时间的类型提示
|
2022-11-25 12:49:38 +08:00
|
|
|
|
*/
|
2022-03-02 20:47:14 +08:00
|
|
|
|
const __APP_INFO__: {
|
|
|
|
|
pkg: {
|
|
|
|
|
name: string;
|
|
|
|
|
version: string;
|
2024-01-14 11:00:35 +08:00
|
|
|
|
engines: {
|
|
|
|
|
node: string;
|
|
|
|
|
pnpm: string;
|
|
|
|
|
};
|
2022-03-02 20:47:14 +08:00
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2024-03-12 14:36:45 +08:00
|
|
|
|
/**
|
|
|
|
|
* Document 的类型提示
|
|
|
|
|
*/
|
|
|
|
|
interface Document {
|
|
|
|
|
webkitFullscreenElement?: Element;
|
|
|
|
|
mozFullScreenElement?: Element;
|
|
|
|
|
msFullscreenElement?: Element;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-25 12:49:38 +08:00
|
|
|
|
/**
|
|
|
|
|
* 打包压缩格式的类型声明
|
|
|
|
|
*/
|
2022-10-27 02:35:56 +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;
|
2021-12-13 11:20:50 +08:00
|
|
|
|
VITE_ROUTER_HISTORY: string;
|
2022-10-26 19:44:44 +08:00
|
|
|
|
VITE_CDN: boolean;
|
2023-05-05 22:55:12 +08:00
|
|
|
|
VITE_HIDE_HOME: string;
|
2022-10-27 02:35:56 +08:00
|
|
|
|
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> {}
|
|
|
|
|
|
|
|
|
|
/**
|
2023-09-27 15:09:15 +08:00
|
|
|
|
* 对应 `public/platform-config.json` 文件的类型声明
|
|
|
|
|
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#platform-config-json}
|
2022-11-25 12:49:38 +08:00
|
|
|
|
*/
|
2023-09-27 15:09:15 +08:00
|
|
|
|
interface PlatformConfigs {
|
2021-10-08 11:32:50 +08:00
|
|
|
|
Version?: string;
|
2021-10-15 11:38:43 +08:00
|
|
|
|
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;
|
2024-01-14 23:21:43 +08:00
|
|
|
|
OverallStyle?: string;
|
2021-11-09 19:24:55 +08:00
|
|
|
|
Grey?: boolean;
|
|
|
|
|
Weak?: boolean;
|
|
|
|
|
HideTabs?: boolean;
|
2023-10-17 11:25:35 +08:00
|
|
|
|
HideFooter?: boolean;
|
2021-12-29 21:51:05 +08:00
|
|
|
|
SidebarStatus?: boolean;
|
|
|
|
|
EpThemeColor?: string;
|
2021-12-29 22:45:18 +08:00
|
|
|
|
ShowLogo?: boolean;
|
2021-12-29 21:51:05 +08:00
|
|
|
|
ShowModel?: string;
|
2022-11-17 15:29:12 +08:00
|
|
|
|
MenuArrowIconNoTransition?: boolean;
|
2022-12-01 11:31:52 +08:00
|
|
|
|
CachingAsyncRoutes?: boolean;
|
2022-12-02 16:46:48 +08:00
|
|
|
|
TooltipEffect?: Effect;
|
2023-05-06 12:38:11 +08:00
|
|
|
|
ResponsiveStorageNameSpace?: string;
|
2024-03-02 01:08:52 +08:00
|
|
|
|
MenuSearchHistory?: number;
|
2021-10-15 11:38:43 +08:00
|
|
|
|
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
|
|
|
|
/**
|
2023-09-27 15:09:15 +08:00
|
|
|
|
* 与 `PlatformConfigs` 类型不同,这里是缓存到浏览器本地存储的类型声明
|
|
|
|
|
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#platform-config-json}
|
2022-11-25 12:49:38 +08:00
|
|
|
|
*/
|
|
|
|
|
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;
|
2023-10-17 11:25:35 +08:00
|
|
|
|
hideFooter?: boolean;
|
2022-11-25 12:49:38 +08:00
|
|
|
|
sidebarStatus?: boolean;
|
|
|
|
|
epThemeColor?: string;
|
2024-01-02 17:42:26 +08:00
|
|
|
|
themeColor?: string;
|
2024-01-14 23:21:43 +08:00
|
|
|
|
overallStyle?: string;
|
2022-11-25 12:49:38 +08:00
|
|
|
|
showLogo?: boolean;
|
|
|
|
|
showModel?: string;
|
2024-03-02 01:08:52 +08:00
|
|
|
|
menuSearchHistory?: number;
|
2022-11-25 12:49:38 +08:00
|
|
|
|
mapConfigure?: {
|
|
|
|
|
amapKey?: string;
|
|
|
|
|
options: {
|
|
|
|
|
resizeEnable?: boolean;
|
|
|
|
|
center?: number[];
|
|
|
|
|
zoom?: number;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
username?: string;
|
2022-07-26 13:16:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
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;
|
2024-01-02 17:42:26 +08:00
|
|
|
|
themeColor?: string;
|
2024-01-14 23:21:43 +08:00
|
|
|
|
overallStyle?: string;
|
2022-11-25 12:49:38 +08:00
|
|
|
|
};
|
|
|
|
|
configure: {
|
|
|
|
|
grey?: boolean;
|
|
|
|
|
weak?: boolean;
|
|
|
|
|
hideTabs?: boolean;
|
2023-10-17 11:25:35 +08:00
|
|
|
|
hideFooter?: boolean;
|
2022-11-25 12:49:38 +08:00
|
|
|
|
showLogo?: boolean;
|
|
|
|
|
showModel?: string;
|
|
|
|
|
multiTagsCache?: boolean;
|
|
|
|
|
};
|
|
|
|
|
tags?: Array<any>;
|
|
|
|
|
}
|
2022-11-21 11:42:33 +08:00
|
|
|
|
|
2022-11-25 12:49:38 +08:00
|
|
|
|
/**
|
|
|
|
|
* 平台里所有组件实例都能访问到的全局属性对象的类型声明
|
|
|
|
|
*/
|
|
|
|
|
interface GlobalPropertiesApi {
|
|
|
|
|
$echarts: ECharts;
|
|
|
|
|
$storage: ResponsiveStorage;
|
2023-09-27 15:09:15 +08:00
|
|
|
|
$config: PlatformConfigs;
|
2022-11-25 12:49:38 +08:00
|
|
|
|
}
|
2024-03-05 22:21:45 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2024-03-05 22:33:27 +08:00
|
|
|
|
* 扩展 `Element`
|
2024-03-05 22:21:45 +08:00
|
|
|
|
*/
|
|
|
|
|
interface Element {
|
|
|
|
|
// v-ripple 作用于 src/directives/ripple/index.ts 文件
|
|
|
|
|
_ripple?: {
|
|
|
|
|
enabled?: boolean;
|
|
|
|
|
centered?: boolean;
|
|
|
|
|
class?: string;
|
|
|
|
|
circle?: boolean;
|
|
|
|
|
touched?: boolean;
|
|
|
|
|
};
|
|
|
|
|
}
|
2022-11-25 12:49:38 +08:00
|
|
|
|
}
|