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.

130 lines
3.3 KiB

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