global.d.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import type { CSSProperties } from 'vue'
  2. import { RawAxiosRequestHeaders } from 'axios'
  3. declare global {
  4. declare interface Fn<T = any> {
  5. (...arg: T[]): T
  6. }
  7. declare type Nullable<T> = T | null
  8. declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
  9. declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
  10. declare type RemoveReadonly<T> = {
  11. -readonly [P in keyof T]: T[P]
  12. }
  13. declare type ComponentRef<T> = InstanceType<T>
  14. declare type LocaleType = 'zh-CN' | 'en'
  15. declare type TimeoutHandle = ReturnType<typeof setTimeout>
  16. declare type IntervalHandle = ReturnType<typeof setInterval>
  17. declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
  18. declare type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'
  19. declare type AxiosContentType =
  20. | 'application/json'
  21. | 'application/x-www-form-urlencoded'
  22. | 'multipart/form-data'
  23. | 'text/plain'
  24. declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put'
  25. declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
  26. declare interface AxiosConfig {
  27. params?: any
  28. data?: any
  29. url?: string
  30. method?: AxiosMethod
  31. headers?: RawAxiosRequestHeaders
  32. responseType?: AxiosResponseType
  33. }
  34. declare interface IResponse<T = any> {
  35. code: number
  36. data: T extends any ? T : T & any
  37. }
  38. declare interface ThemeTypes {
  39. elColorPrimary?: string
  40. leftMenuBorderColor?: string
  41. leftMenuBgColor?: string
  42. leftMenuBgLightColor?: string
  43. leftMenuBgActiveColor?: string
  44. leftMenuCollapseBgActiveColor?: string
  45. leftMenuTextColor?: string
  46. leftMenuTextActiveColor?: string
  47. logoTitleTextColor?: string
  48. logoBorderColor?: string
  49. topHeaderBgColor?: string
  50. topHeaderTextColor?: string
  51. topHeaderHoverColor?: string
  52. topToolBorderColor?: string
  53. }
  54. declare interface ImportMetaEnv {
  55. readonly VITE_NODE_ENV: string
  56. readonly VITE_APP_TITLE: string
  57. readonly VITE_API_BASE_PATH: string
  58. readonly VITE_BASE_PATH: string
  59. readonly VITE_DROP_DEBUGGER: string
  60. readonly VITE_DROP_CONSOLE: string
  61. readonly VITE_SOURCEMAP: string
  62. readonly VITE_OUT_DIR: string
  63. readonly VITE_USE_BUNDLE_ANALYZER: string
  64. readonly VITE_USE_ALL_ELEMENT_PLUS_STYLE: string
  65. readonly VITE_USE_MOCK: string
  66. readonly VITE_USE_CSS_SPLIT: string
  67. readonly VITE_USE_ONLINE_ICON: string
  68. readonly VITE_ICON_PREFIX: string
  69. readonly VITE_HIDE_GLOBAL_SETTING: string
  70. }
  71. }