wireguard-dashboard/web-src/types/global.d.ts

194 lines
4.9 KiB
TypeScript
Raw Normal View History

2024-06-04 09:55:48 +08:00
import type { ECharts } from "echarts";
import type { TableColumns } from "@pureadmin/table";
/**
* `.vue` `.ts` `.tsx` 使
*/
declare global {
/**
* `node``pnpm`
*/
const __APP_INFO__: {
pkg: {
name: string;
version: string;
engines: {
node: string;
pnpm: 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;
}
/**
* Document
*/
interface Document {
webkitFullscreenElement?: Element;
mozFullScreenElement?: Element;
msFullscreenElement?: Element;
}
/**
*
*/
type ViteCompression =
| "none"
| "gzip"
| "brotli"
| "both"
| "gzip-clear"
| "brotli-clear"
| "both-clear";
/**
*
* @see {@link https://pure-admin.github.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://pure-admin.github.io/pure-admin-doc/pages/config/#platform-config-json}
*/
interface PlatformConfigs {
Version?: string;
Title?: string;
FixedHeader?: boolean;
HiddenSideBar?: boolean;
MultiTagsCache?: boolean;
MaxTagsLevel?: number;
KeepAlive?: boolean;
Locale?: string;
Layout?: string;
Theme?: string;
DarkMode?: boolean;
OverallStyle?: string;
Grey?: boolean;
Weak?: boolean;
HideTabs?: boolean;
HideFooter?: boolean;
Stretch?: boolean | number;
SidebarStatus?: boolean;
EpThemeColor?: string;
ShowLogo?: boolean;
ShowModel?: string;
MenuArrowIconNoTransition?: boolean;
CachingAsyncRoutes?: boolean;
TooltipEffect?: Effect;
ResponsiveStorageNameSpace?: string;
MenuSearchHistory?: number;
}
/**
* `PlatformConfigs`
* @see {@link https://pure-admin.github.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;
overallStyle?: string;
showLogo?: boolean;
showModel?: string;
menuSearchHistory?: number;
username?: string;
}
/**
* `responsive-storage` `storage`
*/
interface ResponsiveStorage {
locale: {
locale?: string;
};
layout: {
layout?: string;
theme?: string;
darkMode?: boolean;
sidebarStatus?: boolean;
epThemeColor?: string;
themeColor?: string;
overallStyle?: string;
};
configure: {
grey?: boolean;
weak?: boolean;
hideTabs?: boolean;
hideFooter?: boolean;
showLogo?: boolean;
showModel?: string;
multiTagsCache?: boolean;
stretch?: boolean | number;
};
tags?: Array<any>;
}
/**
* 访
*/
interface GlobalPropertiesApi {
$echarts: ECharts;
$storage: ResponsiveStorage;
$config: PlatformConfigs;
}
/**
* `Element`
*/
interface Element {
// v-ripple 作用于 src/directives/ripple/index.ts 文件
_ripple?: {
enabled?: boolean;
centered?: boolean;
class?: string;
circle?: boolean;
touched?: boolean;
};
}
}