global.d.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import type { ComponentRenderProxy, VNode, VNodeChild, ComponentPublicInstance, FunctionalComponent, PropType as VuePropType } from 'vue';
  2. declare global {
  3. const VENT_PARAM: {
  4. simulatedPassword: string;
  5. showReport: boolean;
  6. isoOpenSso: string;
  7. modalText: string;
  8. productionCrlPlatformUrl: string;
  9. safetyCrlPlatformUrl: string;
  10. gasControlMock: boolean;
  11. historyIsMultiple: boolean;
  12. is2DModel: boolean;
  13. };
  14. interface GlobalConfig {
  15. simulatedPassword: string;
  16. History_Type: string;
  17. pageType: string;
  18. showReport: boolean;
  19. is2DModel: boolean;
  20. }
  21. const __APP_INFO__: {
  22. pkg: {
  23. name: string;
  24. version: string;
  25. dependencies: Recordable<string>;
  26. devDependencies: Recordable<string>;
  27. };
  28. lastBuildTime: string;
  29. };
  30. // declare interface Window {
  31. // // Global vue app instance
  32. // __APP__: App<Element>;
  33. // }
  34. // vue
  35. declare type PropType<T> = VuePropType<T>;
  36. declare type VueNode = VNodeChild | JSX.Element;
  37. export type Writable<T> = {
  38. -readonly [P in keyof T]: T[P];
  39. };
  40. declare type Nullable<T> = T | null;
  41. declare type NonNullable<T> = T extends null | undefined ? never : T;
  42. declare type Recordable<T = any> = Record<string, T>;
  43. declare type ReadonlyRecordable<T = any> = {
  44. readonly [key: string]: T;
  45. };
  46. declare type Indexable<T = any> = {
  47. [key: string]: T;
  48. };
  49. declare type DeepPartial<T> = {
  50. [P in keyof T]?: DeepPartial<T[P]>;
  51. };
  52. declare type TimeoutHandle = ReturnType<typeof setTimeout>;
  53. declare type IntervalHandle = ReturnType<typeof setInterval>;
  54. declare interface ChangeEvent extends Event {
  55. target: HTMLInputElement;
  56. }
  57. declare interface WheelEvent {
  58. path?: EventTarget[];
  59. }
  60. interface ImportMetaEnv extends ViteEnv {
  61. __: unknown;
  62. }
  63. interface ImportMeta {
  64. readonly env: ImportMetaEnv;
  65. }
  66. declare interface ViteEnv {
  67. VITE_PORT: number;
  68. VITE_USE_MOCK: boolean;
  69. VITE_PUBLIC_PATH: string;
  70. VITE_PROXY: [string, string][];
  71. VITE_GLOB_APP_TITLE: string;
  72. VITE_GLOB_APP_SHORT_NAME: string;
  73. VITE_USE_CDN: boolean;
  74. VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
  75. VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean;
  76. VITE_GLOB_DOMAIN_URL: string;
  77. VITE_CACHE_CIPHER_KEY_CHAR_CODE: string;
  78. VITE_CACHE_CIPHER_IV_CHAR_CODE: string;
  79. VITE_LOGIN_CIPHER_KEY_CHAR_CODE: string;
  80. VITE_LOGIN_CIPHER_IV_CHAR_CODE: string;
  81. VITE_MOCK_LOGIN_USERNAME_CHAR_CODE: string;
  82. VITE_MOCK_LOGIN_PASSWORD_CHAR_CODE: string;
  83. VITE_SIGNATURE_SECRET_CHAR_CODE: string;
  84. PROD: boolean;
  85. }
  86. declare function parseInt(s: string | number, radix?: number): number;
  87. declare function parseFloat(string: string | number): number;
  88. namespace JSX {
  89. // tslint:disable no-empty-interface
  90. type Element = VNode;
  91. // tslint:disable no-empty-interface
  92. type ElementClass = ComponentRenderProxy;
  93. interface ElementAttributesProperty {
  94. $props: any;
  95. }
  96. interface IntrinsicElements {
  97. [elem: string]: any;
  98. }
  99. interface IntrinsicAttributes {
  100. [elem: string]: any;
  101. }
  102. }
  103. }
  104. declare module 'vue' {
  105. export type JSXComponent<Props = any> = { new (): ComponentPublicInstance<Props> } | FunctionalComponent<Props>;
  106. }