global.d.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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_PROXY_USER_REAL: string;
  72. VITE_ROUTER_HISTORY: string;
  73. VITE_CORP_ID: string;
  74. VITE_APP_ID: string;
  75. REDIRECT_BASE_URL: string;
  76. VITE_LEGACY: boolean;
  77. VITE_IS_PROD?: boolean;
  78. VITE_PURCHASE_URL: string
  79. VITE_SECRET_KEY: string
  80. VITE_TICKECT_URL: string
  81. WECHAT_URL: string
  82. BACK_URL: string
  83. VITE_GD_URL?: string
  84. VITE_DASHBOARD_URL?: string
  85. VITE_WORKORDER_REAL?:string
  86. VITE_PURCHASE_REAL?: string
  87. }
  88. declare interface ServerConfigs {
  89. Version?: string;
  90. Title?: string;
  91. FixedHeader?: boolean;
  92. HiddenSideBar?: boolean;
  93. MultiTagsCache?: boolean;
  94. KeepAlive?: boolean;
  95. Locale?: string;
  96. Layout?: string;
  97. Theme?: string;
  98. DarkMode?: boolean;
  99. Grey?: boolean;
  100. Weak?: boolean;
  101. HideTabs?: boolean;
  102. SidebarStatus?: boolean;
  103. EpThemeColor?: string;
  104. ShowLogo?: boolean;
  105. ShowModel?: string;
  106. MapConfigure?: {
  107. amapKey?: string;
  108. options: {
  109. resizeEnable?: boolean;
  110. center?: number[];
  111. zoom?: number;
  112. };
  113. };
  114. }
  115. function parseInt(s: string | number, radix?: number): number;
  116. function parseFloat(string: string | number): number;
  117. namespace JSX {
  118. // tslint:disable no-empty-interface
  119. type Element = VNode;
  120. // tslint:disable no-empty-interface
  121. type ElementClass = ComponentRenderProxy;
  122. interface ElementAttributesProperty {
  123. $props: any;
  124. }
  125. interface IntrinsicElements {
  126. [elem: string]: any;
  127. }
  128. interface IntrinsicAttributes {
  129. [elem: string]: any;
  130. }
  131. }
  132. }