global.d.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import type { CSSProperties } from 'vue'
  2. declare global {
  3. declare interface Fn<T = any> {
  4. (...arg: T[]): T
  5. }
  6. declare type Nullable<T> = T | null
  7. declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
  8. declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
  9. declare type ComponentRef<T> = InstanceType<T>
  10. declare type LocaleType = 'zh-CN' | 'en'
  11. declare type TimeoutHandle = ReturnType<typeof setTimeout>
  12. declare type IntervalHandle = ReturnType<typeof setInterval>
  13. declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
  14. declare type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'
  15. declare type AxiosHeaders =
  16. | 'application/json'
  17. | 'application/x-www-form-urlencoded'
  18. | 'multipart/form-data'
  19. declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put'
  20. declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
  21. declare interface AxiosConfig {
  22. params?: any
  23. data?: any
  24. url?: string
  25. method?: AxiosMethod
  26. headersType?: string
  27. responseType?: AxiosResponseType
  28. }
  29. declare interface IResponse<T = any> {
  30. code: string
  31. data: T extends any ? T : T & any
  32. }
  33. declare interface ThemeTypes {
  34. elColorPrimary?: string
  35. leftMenuBorderColor?: string
  36. leftMenuBgColor?: string
  37. leftMenuBgLightColor?: string
  38. leftMenuBgActiveColor?: string
  39. leftMenuCollapseBgActiveColor?: string
  40. leftMenuTextColor?: string
  41. leftMenuTextActiveColor?: string
  42. logoTitleTextColor?: string
  43. logoBorderColor?: string
  44. topHeaderBgColor?: string
  45. topHeaderTextColor?: string
  46. topHeaderHoverColor?: string
  47. topToolBorderColor?: string
  48. }
  49. }