global.d.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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_PURCHASE_REPORT: string;
  69. VITE_PUBLIC_PATH: string;
  70. VITE_PROXY_DOMAIN: string;
  71. VITE_PROXY_DOMAIN_REAL: string;
  72. VITE_PROXY_USER_REAL: string;
  73. VITE_ROUTER_HISTORY: string;
  74. VITE_CORP_ID: string;
  75. VITE_APP_ID: string;
  76. REDIRECT_BASE_URL: string;
  77. VITE_LEGACY: boolean;
  78. VITE_IS_PROD: boolean;
  79. VITE_PURCHASE_URL: string
  80. VITE_SECRET_KEY: string
  81. }
  82. declare interface ServerConfigs {
  83. Version?: string;
  84. Title?: string;
  85. FixedHeader?: boolean;
  86. HiddenSideBar?: boolean;
  87. MultiTagsCache?: boolean;
  88. KeepAlive?: boolean;
  89. Locale?: string;
  90. Layout?: string;
  91. Theme?: string;
  92. DarkMode?: boolean;
  93. Grey?: boolean;
  94. Weak?: boolean;
  95. HideTabs?: boolean;
  96. SidebarStatus?: boolean;
  97. EpThemeColor?: string;
  98. ShowLogo?: boolean;
  99. ShowModel?: string;
  100. MapConfigure?: {
  101. amapKey?: string;
  102. options: {
  103. resizeEnable?: boolean;
  104. center?: number[];
  105. zoom?: number;
  106. };
  107. };
  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. }