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.

128 lines
3.2 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_TITLE: string;
  61. VITE_VERSION: string;
  62. VITE_USE_MOCK: boolean;
  63. VITE_USE_PWA: boolean;
  64. VITE_PUBLIC_PATH: string;
  65. VITE_PROXY: [string, string][];
  66. VITE_GLOB_APP_TITLE: string;
  67. VITE_GLOB_APP_SHORT_NAME: string;
  68. VITE_USE_CDN: boolean;
  69. VITE_DROP_CONSOLE: boolean;
  70. VITE_BUILD_COMPRESS: "gzip" | "brotli" | "none";
  71. VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean;
  72. VITE_LEGACY: boolean;
  73. VITE_USE_IMAGEMIN: boolean;
  74. VITE_GENERATE_UI: string;
  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. Grey?: boolean;
  87. Weak?: boolean;
  88. HideTabs?: boolean;
  89. MapConfigure?: {
  90. amapKey?: string;
  91. baiduKey?: string;
  92. options: {
  93. resizeEnable?: boolean;
  94. center?: number[];
  95. zoom?: number;
  96. };
  97. };
  98. }
  99. function parseInt(s: string | number, radix?: number): number;
  100. function parseFloat(string: string | number): number;
  101. namespace JSX {
  102. // tslint:disable no-empty-interface
  103. type Element = VNode;
  104. // tslint:disable no-empty-interface
  105. type ElementClass = ComponentRenderProxy;
  106. interface ElementAttributesProperty {
  107. $props: any;
  108. }
  109. interface IntrinsicElements {
  110. [elem: string]: any;
  111. }
  112. interface IntrinsicAttributes {
  113. [elem: string]: any;
  114. }
  115. }
  116. }