合同小程序后台管理系统前端代码
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.

91 lines
2.6 KiB

2 months ago
  1. import type { ComponentRenderProxy, VNode, VNodeChild, ComponentPublicInstance, FunctionalComponent, PropType as VuePropType } from 'vue';
  2. declare global {
  3. const __APP_INFO__: {
  4. pkg: {
  5. name: string;
  6. version: string;
  7. dependencies: Recordable<string>;
  8. devDependencies: Recordable<string>;
  9. };
  10. lastBuildTime: string;
  11. };
  12. // declare interface Window {
  13. // // Global vue app instance
  14. // __APP__: App<Element>;
  15. // }
  16. // vue
  17. declare type PropType<T> = VuePropType<T>;
  18. declare type VueNode = VNodeChild | JSX.Element;
  19. export type Writable<T> = {
  20. -readonly [P in keyof T]: T[P];
  21. };
  22. declare type Nullable<T> = T | null;
  23. declare type NonNullable<T> = T extends null | undefined ? never : T;
  24. declare type Recordable<T = any> = Record<string, T>;
  25. declare type ReadonlyRecordable<T = any> = {
  26. readonly [key: string]: T;
  27. };
  28. declare type Indexable<T = any> = {
  29. [key: string]: T;
  30. };
  31. declare type DeepPartial<T> = {
  32. [P in keyof T]?: DeepPartial<T[P]>;
  33. };
  34. declare type TimeoutHandle = ReturnType<typeof setTimeout>;
  35. declare type IntervalHandle = ReturnType<typeof setInterval>;
  36. declare interface ChangeEvent extends Event {
  37. target: HTMLInputElement;
  38. }
  39. declare interface WheelEvent {
  40. path?: EventTarget[];
  41. }
  42. interface ImportMetaEnv extends ViteEnv {
  43. __: unknown;
  44. }
  45. declare interface ViteEnv {
  46. VITE_PORT: number;
  47. VITE_USE_MOCK: boolean;
  48. VITE_PUBLIC_PATH: string;
  49. VITE_PROXY: [string, string][];
  50. VITE_GLOB_APP_TITLE: string;
  51. VITE_GLOB_APP_SHORT_NAME: string;
  52. VITE_USE_CDN: boolean;
  53. VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
  54. VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean;
  55. // 【JEECG作为乾坤子应用】乾坤子应用名,主应用注册时AppName需保持一致
  56. VITE_GLOB_QIANKUN_MICRO_APP_NAME?: string;
  57. // 【JEECG作为乾坤子应用】非必填,需与qiankun主应用注册子应用时填写的 entry 保持一致
  58. VITE_GLOB_QIANKUN_MICRO_APP_ENTRY?: string;
  59. }
  60. declare function parseInt(s: string | number, radix?: number): number;
  61. declare function parseFloat(string: string | number): number;
  62. namespace JSX {
  63. // tslint:disable no-empty-interface
  64. type Element = VNode;
  65. // tslint:disable no-empty-interface
  66. type ElementClass = ComponentRenderProxy;
  67. interface ElementAttributesProperty {
  68. $props: any;
  69. }
  70. interface IntrinsicElements {
  71. [elem: string]: any;
  72. }
  73. interface IntrinsicAttributes {
  74. [elem: string]: any;
  75. }
  76. }
  77. }
  78. declare module 'vue' {
  79. export type JSXComponent<Props = any> = { new (): ComponentPublicInstance<Props> } | FunctionalComponent<Props>;
  80. }