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.

140 lines
3.6 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. declare interface ViteEnv {
  70. VITE_PORT: number;
  71. VITE_PUBLIC_PATH: string;
  72. VITE_PROXY_DOMAIN: string;
  73. VITE_PROXY_DOMAIN_REAL: string;
  74. VITE_ROUTER_HISTORY: string;
  75. VITE_LEGACY: boolean;
  76. VITE_CDN: boolean;
  77. }
  78. declare interface ServerConfigs {
  79. Version?: string;
  80. Title?: string;
  81. FixedHeader?: boolean;
  82. HiddenSideBar?: boolean;
  83. MultiTagsCache?: boolean;
  84. KeepAlive?: boolean;
  85. Locale?: string;
  86. Layout?: string;
  87. Theme?: string;
  88. DarkMode?: boolean;
  89. Grey?: boolean;
  90. Weak?: boolean;
  91. HideTabs?: boolean;
  92. SidebarStatus?: boolean;
  93. EpThemeColor?: string;
  94. ShowLogo?: boolean;
  95. ShowModel?: string;
  96. MapConfigure?: {
  97. amapKey?: string;
  98. options: {
  99. resizeEnable?: boolean;
  100. center?: number[];
  101. zoom?: number;
  102. };
  103. };
  104. }
  105. declare interface GlobalPropertiesApi {
  106. $echarts: ECharts;
  107. $storage: ResponsiveStorage;
  108. $config: ServerConfigs;
  109. }
  110. function parseInt(s: string | number, radix?: number): number;
  111. function parseFloat(string: string | number): number;
  112. namespace JSX {
  113. // tslint:disable no-empty-interface
  114. type Element = VNode;
  115. // tslint:disable no-empty-interface
  116. type ElementClass = ComponentRenderProxy;
  117. interface ElementAttributesProperty {
  118. $props: any;
  119. }
  120. interface IntrinsicElements {
  121. [elem: string]: any;
  122. }
  123. interface IntrinsicAttributes {
  124. [elem: string]: any;
  125. }
  126. }
  127. }