global.d.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. PROD: boolean;
  70. }
  71. declare function parseInt(s: string | number, radix?: number): number;
  72. declare function parseFloat(string: string | number): number;
  73. namespace JSX {
  74. // tslint:disable no-empty-interface
  75. type Element = VNode;
  76. // tslint:disable no-empty-interface
  77. type ElementClass = ComponentRenderProxy;
  78. interface ElementAttributesProperty {
  79. $props: any;
  80. }
  81. interface IntrinsicElements {
  82. [elem: string]: any;
  83. }
  84. interface IntrinsicAttributes {
  85. [elem: string]: any;
  86. }
  87. }
  88. }
  89. declare module 'vue' {
  90. export type JSXComponent<Props = any> = { new (): ComponentPublicInstance<Props> } | FunctionalComponent<Props>;
  91. }