vue-pure-admin/types/global.d.ts
xiaoming ba1f655b6e
refactor: 优化主题色 (#842)
* refactor: 优化主题色

* chore: 移除`yellow`金色主题配色

* perf: 优化左侧菜单的右边框,使其不再突兀

* style: 所有层级的子菜单字体大小跟顶级菜单保持一致都是`14px`

* chore: 默认亮白色`light`主题配色,并按照感官调整主题色顺序

* fix: 修复亮白主题配色,切换暗色主题后再切回亮色主题时,无法恢复之前的亮白主题配色

* style: 统一亮白主题配色下顶部菜单和混合菜单的`logo`和右侧操作功能颜色
2024-01-02 17:42:26 +08:00

175 lines
4.4 KiB
TypeScript

import type { ECharts } from "echarts";
import type { TableColumns } from "@pureadmin/table";
/**
* 全局类型声明,无需引入直接在 `.vue` 、`.ts` 、`.tsx` 文件使用即可获得类型提示
*/
declare global {
/**
* 平台的名称、版本、依赖、最后构建时间的类型提示
*/
const __APP_INFO__: {
pkg: {
name: string;
version: string;
dependencies: Recordable<string>;
devDependencies: Recordable<string>;
};
lastBuildTime: string;
};
/**
* Window 的类型提示
*/
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;
}
/**
* 打包压缩格式的类型声明
*/
type ViteCompression =
| "none"
| "gzip"
| "brotli"
| "both"
| "gzip-clear"
| "brotli-clear"
| "both-clear";
/**
* 全局自定义环境变量的类型声明
* @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 {
VITE_PORT: number;
VITE_PUBLIC_PATH: string;
VITE_ROUTER_HISTORY: string;
VITE_CDN: boolean;
VITE_HIDE_HOME: string;
VITE_COMPRESSION: ViteCompression;
}
/**
* 继承 `@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}
*/
interface PlatformConfigs {
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;
SidebarStatus?: boolean;
EpThemeColor?: string;
ShowLogo?: boolean;
ShowModel?: string;
MenuArrowIconNoTransition?: boolean;
CachingAsyncRoutes?: boolean;
TooltipEffect?: Effect;
ResponsiveStorageNameSpace?: string;
MapConfigure?: {
amapKey?: string;
options: {
resizeEnable?: boolean;
center?: number[];
zoom?: number;
};
};
}
/**
* 与 `PlatformConfigs` 类型不同,这里是缓存到浏览器本地存储的类型声明
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#platform-config-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;
hideFooter?: boolean;
sidebarStatus?: boolean;
epThemeColor?: string;
themeColor?: string;
showLogo?: boolean;
showModel?: string;
mapConfigure?: {
amapKey?: string;
options: {
resizeEnable?: boolean;
center?: number[];
zoom?: number;
};
};
username?: string;
}
/**
* `responsive-storage` 本地响应式 `storage` 的类型声明
*/
interface ResponsiveStorage {
locale: {
locale?: string;
};
layout: {
layout?: string;
theme?: string;
darkMode?: boolean;
sidebarStatus?: boolean;
epThemeColor?: string;
themeColor?: string;
};
configure: {
grey?: boolean;
weak?: boolean;
hideTabs?: boolean;
hideFooter?: boolean;
showLogo?: boolean;
showModel?: string;
multiTagsCache?: boolean;
};
tags?: Array<any>;
}
/**
* 平台里所有组件实例都能访问到的全局属性对象的类型声明
*/
interface GlobalPropertiesApi {
$echarts: ECharts;
$storage: ResponsiveStorage;
$config: PlatformConfigs;
}
}