You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
3.8 KiB

  1. import type {
  2. ComponentRenderProxy,
  3. VNode,
  4. ComponentPublicInstance,
  5. FunctionalComponent,
  6. PropType as VuePropType
  7. } from "vue";
  8. import type { ECharts } from "echarts";
  9. import { type ResponsiveStorage } from "./index";
  10. // GlobalComponents for Volar
  11. declare module "vue" {
  12. export interface GlobalComponents {
  13. IconifyIconOffline: typeof import("../src/components/ReIcon")["IconifyIconOffline"];
  14. IconifyIconOnline: typeof import("../src/components/ReIcon")["IconifyIconOnline"];
  15. FontIcon: typeof import("../src/components/ReIcon")["FontIcon"];
  16. Auth: typeof import("../src/components/ReAuth")["Auth"];
  17. }
  18. }
  19. declare global {
  20. const __APP_INFO__: {
  21. pkg: {
  22. name: string;
  23. version: string;
  24. dependencies: Recordable<string>;
  25. devDependencies: Recordable<string>;
  26. };
  27. lastBuildTime: string;
  28. };
  29. interface Window {
  30. // Global vue app instance
  31. __APP__: App<Element>;
  32. webkitCancelAnimationFrame: (handle: number) => void;
  33. mozCancelAnimationFrame: (handle: number) => void;
  34. oCancelAnimationFrame: (handle: number) => void;
  35. msCancelAnimationFrame: (handle: number) => void;
  36. webkitRequestAnimationFrame: (callback: FrameRequestCallback) => number;
  37. mozRequestAnimationFrame: (callback: FrameRequestCallback) => number;
  38. oRequestAnimationFrame: (callback: FrameRequestCallback) => number;
  39. msRequestAnimationFrame: (callback: FrameRequestCallback) => number;
  40. }
  41. // vue
  42. type PropType<T> = VuePropType<T>;
  43. type Writable<T> = {
  44. -readonly [P in keyof T]: T[P];
  45. };
  46. type Nullable<T> = T | null;
  47. type NonNullable<T> = T extends null | undefined ? never : T;
  48. type Recordable<T = any> = Record<string, T>;
  49. type ReadonlyRecordable<T = any> = {
  50. readonly [key: string]: T;
  51. };
  52. type Indexable<T = any> = {
  53. [key: string]: T;
  54. };
  55. type DeepPartial<T> = {
  56. [P in keyof T]?: DeepPartial<T[P]>;
  57. };
  58. type TimeoutHandle = ReturnType<typeof setTimeout>;
  59. type IntervalHandle = ReturnType<typeof setInterval>;
  60. interface ChangeEvent extends Event {
  61. target: HTMLInputElement;
  62. }
  63. interface WheelEvent {
  64. path?: EventTarget[];
  65. }
  66. interface ImportMetaEnv extends ViteEnv {
  67. __: unknown;
  68. }
  69. type ViteCompression =
  70. | "none"
  71. | "gzip"
  72. | "brotli"
  73. | "both"
  74. | "gzip-clear"
  75. | "brotli-clear"
  76. | "both-clear";
  77. declare interface ViteEnv {
  78. VITE_PORT: number;
  79. VITE_PUBLIC_PATH: string;
  80. VITE_PROXY_DOMAIN: string;
  81. VITE_PROXY_DOMAIN_REAL: string;
  82. VITE_ROUTER_HISTORY: string;
  83. VITE_LEGACY: boolean;
  84. VITE_CDN: boolean;
  85. VITE_COMPRESSION: ViteCompression;
  86. }
  87. declare interface ServerConfigs {
  88. Version?: string;
  89. Title?: string;
  90. FixedHeader?: boolean;
  91. HiddenSideBar?: boolean;
  92. MultiTagsCache?: boolean;
  93. KeepAlive?: boolean;
  94. Locale?: string;
  95. Layout?: string;
  96. Theme?: string;
  97. DarkMode?: boolean;
  98. Grey?: boolean;
  99. Weak?: boolean;
  100. HideTabs?: boolean;
  101. SidebarStatus?: boolean;
  102. EpThemeColor?: string;
  103. ShowLogo?: boolean;
  104. ShowModel?: string;
  105. MapConfigure?: {
  106. amapKey?: string;
  107. options: {
  108. resizeEnable?: boolean;
  109. center?: number[];
  110. zoom?: number;
  111. };
  112. };
  113. }
  114. declare interface GlobalPropertiesApi {
  115. $echarts: ECharts;
  116. $storage: ResponsiveStorage;
  117. $config: ServerConfigs;
  118. }
  119. function parseInt(s: string | number, radix?: number): number;
  120. function parseFloat(string: string | number): number;
  121. namespace JSX {
  122. // tslint:disable no-empty-interface
  123. type Element = VNode;
  124. // tslint:disable no-empty-interface
  125. type ElementClass = ComponentRenderProxy;
  126. interface ElementAttributesProperty {
  127. $props: any;
  128. }
  129. interface IntrinsicElements {
  130. [elem: string]: any;
  131. }
  132. interface IntrinsicAttributes {
  133. [elem: string]: any;
  134. }
  135. }
  136. }