global.d.ts 3.0 KB

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