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.

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