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.

122 lines
3.0 KiB

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