2022-08-22 21:34:55 +08:00
|
|
|
|
import type { ECharts } from "echarts";
|
2022-11-26 19:14:08 +08:00
|
|
|
|
import type { TableColumns } from "@pureadmin/table";
|
2022-01-21 11:32:58 +08:00
|
|
|
|
|
2022-11-26 19:14:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 全局类型声明,无需引入直接在 `.vue` 、`.ts` 、`.tsx` 文件使用即可获得类型提示
|
|
|
|
|
*/
|
2021-10-16 16:16:58 +08:00
|
|
|
|
declare global {
|
2022-11-26 19:14:08 +08:00
|
|
|
|
/**
|
2024-03-09 16:27:52 +08:00
|
|
|
|
* 平台的名称、版本、运行所需的`node`和`pnpm`版本、依赖、最后构建时间的类型提示
|
2022-11-26 19:14:08 +08:00
|
|
|
|
*/
|
2022-03-03 23:30:08 +08:00
|
|
|
|
const __APP_INFO__: {
|
|
|
|
|
pkg: {
|
|
|
|
|
name: string;
|
|
|
|
|
version: string;
|
2024-03-09 16:27:52 +08:00
|
|
|
|
engines: {
|
|
|
|
|
node: string;
|
|
|
|
|
pnpm: string;
|
|
|
|
|
};
|
2022-03-03 23:30:08 +08:00
|
|
|
|
dependencies: Recordable<string>;
|
|
|
|
|
devDependencies: Recordable<string>;
|
|
|
|
|
};
|
|
|
|
|
lastBuildTime: string;
|
|
|
|
|
};
|
2022-11-26 19:14:08 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Window 的类型提示
|
|
|
|
|
*/
|
2021-10-16 16:16:58 +08:00
|
|
|
|
interface Window {
|
|
|
|
|
// Global vue app instance
|
|
|
|
|
__APP__: App<Element>;
|
|
|
|
|
webkitCancelAnimationFrame: (handle: number) => void;
|
|
|
|
|
mozCancelAnimationFrame: (handle: number) => void;
|
|
|
|
|
oCancelAnimationFrame: (handle: number) => void;
|
|
|
|
|
msCancelAnimationFrame: (handle: number) => void;
|
|
|
|
|
webkitRequestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
|
|
|
mozRequestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
|
|
|
oRequestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
|
|
|
msRequestAnimationFrame: (callback: FrameRequestCallback) => number;
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-22 20:47:17 +08:00
|
|
|
|
/**
|
|
|
|
|
* Document 的类型提示
|
|
|
|
|
*/
|
|
|
|
|
interface Document {
|
|
|
|
|
webkitFullscreenElement?: Element;
|
|
|
|
|
mozFullScreenElement?: Element;
|
|
|
|
|
msFullscreenElement?: Element;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-26 19:14:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 打包压缩格式的类型声明
|
|
|
|
|
*/
|
2022-10-27 02:19:23 +08:00
|
|
|
|
type ViteCompression =
|
|
|
|
|
| "none"
|
|
|
|
|
| "gzip"
|
|
|
|
|
| "brotli"
|
|
|
|
|
| "both"
|
|
|
|
|
| "gzip-clear"
|
|
|
|
|
| "brotli-clear"
|
|
|
|
|
| "both-clear";
|
|
|
|
|
|
2022-11-26 19:14:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 全局自定义环境变量的类型声明
|
2024-05-10 12:09:23 +08:00
|
|
|
|
* @see {@link https://pure-admin.github.io/pure-admin-doc/pages/config/#%E5%85%B7%E4%BD%93%E9%85%8D%E7%BD%AE}
|
2022-11-26 19:14:08 +08:00
|
|
|
|
*/
|
|
|
|
|
interface ViteEnv {
|
2021-10-16 16:16:58 +08:00
|
|
|
|
VITE_PORT: number;
|
|
|
|
|
VITE_PUBLIC_PATH: string;
|
2021-12-14 10:51:07 +08:00
|
|
|
|
VITE_ROUTER_HISTORY: string;
|
2022-10-26 19:51:06 +08:00
|
|
|
|
VITE_CDN: boolean;
|
2023-05-12 13:27:40 +08:00
|
|
|
|
VITE_HIDE_HOME: string;
|
2022-10-27 02:19:23 +08:00
|
|
|
|
VITE_COMPRESSION: ViteCompression;
|
2021-10-16 16:16:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-26 19:14:08 +08:00
|
|
|
|
/**
|
|
|
|
|
* 继承 `@pureadmin/table` 的 `TableColumns` ,方便全局直接调用
|
|
|
|
|
*/
|
|
|
|
|
interface TableColumnList extends Array<TableColumns> {}
|
|
|
|
|
|
|
|
|
|
/**
|
2024-03-09 16:27:52 +08:00
|
|
|
|
* 对应 `public/platform-config.json` 文件的类型声明
|
2024-05-10 12:09:23 +08:00
|
|
|
|
* @see {@link https://pure-admin.github.io/pure-admin-doc/pages/config/#platform-config-json}
|
2022-11-26 19:14:08 +08:00
|
|
|
|
*/
|
2024-03-09 16:27:52 +08:00
|
|
|
|
interface PlatformConfigs {
|
2021-10-16 16:16:58 +08:00
|
|
|
|
Version?: string;
|
|
|
|
|
Title?: string;
|
|
|
|
|
FixedHeader?: boolean;
|
|
|
|
|
HiddenSideBar?: boolean;
|
2021-11-28 16:39:26 +08:00
|
|
|
|
MultiTagsCache?: boolean;
|
2024-04-22 14:15:05 +08:00
|
|
|
|
MaxTagsLevel?: number;
|
2021-10-16 16:16:58 +08:00
|
|
|
|
KeepAlive?: boolean;
|
2022-11-26 19:14:08 +08:00
|
|
|
|
Locale?: string;
|
2021-10-16 16:16:58 +08:00
|
|
|
|
Layout?: string;
|
2021-11-10 22:12:47 +08:00
|
|
|
|
Theme?: string;
|
2021-12-22 10:12:52 +08:00
|
|
|
|
DarkMode?: boolean;
|
2024-03-09 16:27:52 +08:00
|
|
|
|
OverallStyle?: string;
|
2021-11-10 22:12:47 +08:00
|
|
|
|
Grey?: boolean;
|
|
|
|
|
Weak?: boolean;
|
|
|
|
|
HideTabs?: boolean;
|
2024-03-09 16:27:52 +08:00
|
|
|
|
HideFooter?: boolean;
|
2024-03-22 20:47:17 +08:00
|
|
|
|
Stretch?: boolean | number;
|
2022-01-05 14:17:06 +08:00
|
|
|
|
SidebarStatus?: boolean;
|
|
|
|
|
EpThemeColor?: string;
|
|
|
|
|
ShowLogo?: boolean;
|
|
|
|
|
ShowModel?: string;
|
2022-11-26 19:14:08 +08:00
|
|
|
|
MenuArrowIconNoTransition?: boolean;
|
2022-12-01 11:42:10 +08:00
|
|
|
|
CachingAsyncRoutes?: boolean;
|
2022-12-02 20:20:50 +08:00
|
|
|
|
TooltipEffect?: Effect;
|
2023-05-12 13:27:40 +08:00
|
|
|
|
ResponsiveStorageNameSpace?: string;
|
2024-03-09 16:27:52 +08:00
|
|
|
|
MenuSearchHistory?: number;
|
2021-10-16 16:16:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-26 19:14:08 +08:00
|
|
|
|
/**
|
2024-03-09 16:27:52 +08:00
|
|
|
|
* 与 `PlatformConfigs` 类型不同,这里是缓存到浏览器本地存储的类型声明
|
2024-05-10 12:09:23 +08:00
|
|
|
|
* @see {@link https://pure-admin.github.io/pure-admin-doc/pages/config/#platform-config-json}
|
2022-11-26 19:14:08 +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;
|
2024-03-09 16:27:52 +08:00
|
|
|
|
hideFooter?: boolean;
|
2022-11-26 19:14:08 +08:00
|
|
|
|
sidebarStatus?: boolean;
|
|
|
|
|
epThemeColor?: string;
|
2024-03-09 16:27:52 +08:00
|
|
|
|
themeColor?: string;
|
|
|
|
|
overallStyle?: string;
|
2022-11-26 19:14:08 +08:00
|
|
|
|
showLogo?: boolean;
|
|
|
|
|
showModel?: string;
|
2024-03-09 16:27:52 +08:00
|
|
|
|
menuSearchHistory?: number;
|
2022-11-26 19:14:08 +08:00
|
|
|
|
username?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* `responsive-storage` 本地响应式 `storage` 的类型声明
|
|
|
|
|
*/
|
|
|
|
|
interface ResponsiveStorage {
|
|
|
|
|
locale: {
|
|
|
|
|
locale?: string;
|
|
|
|
|
};
|
|
|
|
|
layout: {
|
|
|
|
|
layout?: string;
|
|
|
|
|
theme?: string;
|
|
|
|
|
darkMode?: boolean;
|
|
|
|
|
sidebarStatus?: boolean;
|
|
|
|
|
epThemeColor?: string;
|
2024-03-09 16:27:52 +08:00
|
|
|
|
themeColor?: string;
|
|
|
|
|
overallStyle?: string;
|
2022-11-26 19:14:08 +08:00
|
|
|
|
};
|
|
|
|
|
configure: {
|
|
|
|
|
grey?: boolean;
|
|
|
|
|
weak?: boolean;
|
|
|
|
|
hideTabs?: boolean;
|
2024-03-09 16:27:52 +08:00
|
|
|
|
hideFooter?: boolean;
|
2022-11-26 19:14:08 +08:00
|
|
|
|
showLogo?: boolean;
|
|
|
|
|
showModel?: string;
|
|
|
|
|
multiTagsCache?: boolean;
|
2024-03-22 20:47:17 +08:00
|
|
|
|
stretch?: boolean | number;
|
2022-11-26 19:14:08 +08:00
|
|
|
|
};
|
|
|
|
|
tags?: Array<any>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 平台里所有组件实例都能访问到的全局属性对象的类型声明
|
|
|
|
|
*/
|
|
|
|
|
interface GlobalPropertiesApi {
|
2022-08-22 21:34:55 +08:00
|
|
|
|
$echarts: ECharts;
|
|
|
|
|
$storage: ResponsiveStorage;
|
2024-03-09 16:27:52 +08:00
|
|
|
|
$config: PlatformConfigs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 扩展 `Element`
|
|
|
|
|
*/
|
|
|
|
|
interface Element {
|
|
|
|
|
// v-ripple 作用于 src/directives/ripple/index.ts 文件
|
|
|
|
|
_ripple?: {
|
|
|
|
|
enabled?: boolean;
|
|
|
|
|
centered?: boolean;
|
|
|
|
|
class?: string;
|
|
|
|
|
circle?: boolean;
|
|
|
|
|
touched?: boolean;
|
|
|
|
|
};
|
2022-08-22 21:34:55 +08:00
|
|
|
|
}
|
2022-11-26 19:14:08 +08:00
|
|
|
|
}
|