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.

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