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

131 lines
3.3 KiB
TypeScript
Raw Normal View History

2021-04-14 16:44:58 +08:00
import type {
ComponentRenderProxy,
VNode,
ComponentPublicInstance,
FunctionalComponent,
2021-07-20 17:16:42 +08:00
PropType as VuePropType
2021-04-20 14:33:07 +08:00
} from "vue";
2021-04-14 16:44:58 +08:00
2022-01-21 16:10:10 +08:00
// GlobalComponents for Volar
declare module "vue" {
export interface GlobalComponents {
IconifyIconOffline: typeof import("../src/components/ReIcon")["IconifyIconOffline"];
IconifyIconOnline: typeof import("../src/components/ReIcon")["IconifyIconOnline"];
2022-02-05 17:34:01 +08:00
FontIcon: typeof import("../src/components/ReIcon")["FontIcon"];
2022-01-21 16:10:10 +08:00
}
}
2021-04-14 16:44:58 +08:00
declare global {
2022-03-02 20:47:14 +08:00
const __APP_INFO__: {
pkg: {
name: string;
version: string;
dependencies: Recordable<string>;
devDependencies: Recordable<string>;
};
lastBuildTime: string;
};
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
}
// vue
2021-09-17 10:29:59 +08:00
type PropType<T> = VuePropType<T>;
2021-04-14 16:44:58 +08:00
2021-09-17 10:29:59 +08:00
type Writable<T> = {
2021-04-20 14:33:07 +08:00
-readonly [P in keyof T]: T[P];
};
2021-04-14 16:44:58 +08:00
2021-09-17 10:29:59 +08:00
type Nullable<T> = T | null;
type NonNullable<T> = T extends null | undefined ? never : T;
type Recordable<T = any> = Record<string, T>;
type ReadonlyRecordable<T = any> = {
2021-04-20 14:33:07 +08:00
readonly [key: string]: T;
};
2021-09-17 10:29:59 +08:00
type Indexable<T = any> = {
2021-04-20 14:33:07 +08:00
[key: string]: T;
};
2021-09-17 10:29:59 +08:00
type DeepPartial<T> = {
2021-04-20 14:33:07 +08:00
[P in keyof T]?: DeepPartial<T[P]>;
};
2021-09-17 10:29:59 +08:00
type TimeoutHandle = ReturnType<typeof setTimeout>;
type IntervalHandle = ReturnType<typeof setInterval>;
2021-04-14 16:44:58 +08:00
2021-09-17 10:29:59 +08:00
interface ChangeEvent extends Event {
2021-04-20 14:33:07 +08:00
target: HTMLInputElement;
2021-04-14 16:44:58 +08:00
}
2021-09-17 10:29:59 +08:00
interface WheelEvent {
2021-04-20 14:33:07 +08:00
path?: EventTarget[];
2021-04-14 16:44:58 +08:00
}
interface ImportMetaEnv extends ViteEnv {
2021-04-20 14:33:07 +08:00
__: unknown;
2021-04-14 16:44:58 +08:00
}
declare interface ViteEnv {
2021-04-20 14:33:07 +08:00
VITE_PORT: number;
VITE_PUBLIC_PATH: string;
2021-12-04 01:16:50 +08:00
VITE_PROXY_DOMAIN: string;
VITE_PROXY_DOMAIN_REAL: string;
VITE_ROUTER_HISTORY: string;
VITE_LEGACY: boolean;
2021-04-14 16:44:58 +08:00
}
2021-10-08 11:32:50 +08:00
declare interface ServerConfigs {
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;
2021-11-09 19:24:55 +08:00
Grey?: boolean;
Weak?: boolean;
HideTabs?: 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;
MapConfigure?: {
amapKey?: string;
options: {
resizeEnable?: boolean;
center?: number[];
zoom?: number;
};
};
2021-10-08 11:32:50 +08:00
}
2021-09-17 10:29:59 +08:00
function parseInt(s: string | number, radix?: number): number;
2021-04-14 16:44:58 +08:00
2021-09-17 10:29:59 +08:00
function parseFloat(string: string | number): number;
2021-04-14 16:44:58 +08:00
namespace JSX {
// tslint:disable no-empty-interface
2021-04-20 14:33:07 +08:00
type Element = VNode;
2021-04-14 16:44:58 +08:00
// tslint:disable no-empty-interface
2021-04-20 14:33:07 +08:00
type ElementClass = ComponentRenderProxy;
2021-04-14 16:44:58 +08:00
interface ElementAttributesProperty {
2021-04-20 14:33:07 +08:00
$props: any;
2021-04-14 16:44:58 +08:00
}
interface IntrinsicElements {
2021-04-20 14:33:07 +08:00
[elem: string]: any;
2021-04-14 16:44:58 +08:00
}
interface IntrinsicAttributes {
2021-04-20 14:33:07 +08:00
[elem: string]: any;
2021-04-14 16:44:58 +08:00
}
}
}