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

207 lines
5.1 KiB
TypeScript
Raw Normal View History

import type { ECharts } from "echarts";
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
/**
* `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;
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
}
/**
* Document
*/
interface Document {
webkitFullscreenElement?: Element;
mozFullScreenElement?: Element;
msFullscreenElement?: Element;
}
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/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
*/
interface PlatformConfigs {
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;
OverallStyle?: string;
2021-11-09 19:24:55 +08:00
Grey?: boolean;
Weak?: boolean;
HideTabs?: boolean;
HideFooter?: 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;
MenuSearchHistory?: number;
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
/**
* `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;
hideFooter?: boolean;
2022-11-25 12:49:38 +08:00
sidebarStatus?: boolean;
epThemeColor?: string;
themeColor?: string;
overallStyle?: string;
2022-11-25 12:49:38 +08:00
showLogo?: boolean;
showModel?: string;
menuSearchHistory?: number;
2022-11-25 12:49:38 +08:00
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;
themeColor?: string;
overallStyle?: string;
2022-11-25 12:49:38 +08:00
};
configure: {
grey?: boolean;
weak?: boolean;
hideTabs?: boolean;
hideFooter?: boolean;
2022-11-25 12:49:38 +08:00
showLogo?: boolean;
showModel?: string;
multiTagsCache?: boolean;
};
tags?: Array<any>;
}
2022-11-25 12:49:38 +08:00
/**
* 访
*/
interface GlobalPropertiesApi {
$echarts: ECharts;
$storage: ResponsiveStorage;
$config: PlatformConfigs;
2022-11-25 12:49:38 +08:00
}
/**
2024-03-05 22:33:27 +08:00
* `Element`
*/
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
}