global.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 ElementPlusSize = 'default' | 'small' | 'large'
  14. declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
  15. declare type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'
  16. declare type AxiosHeaders =
  17. | 'application/json'
  18. | 'application/x-www-form-urlencoded'
  19. | 'multipart/form-data'
  20. declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put'
  21. declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
  22. declare interface AxiosConfig {
  23. params?: any
  24. data?: any
  25. url?: string
  26. method?: AxiosMethod
  27. headersType?: string
  28. responseType?: AxiosResponseType
  29. }
  30. declare interface IResponse<T = any> {
  31. code: string
  32. data: T extends any ? T : T & any
  33. }
  34. declare interface ThemeTypes {
  35. elColorPrimary?: string
  36. leftMenuBorderColor?: string
  37. leftMenuBgColor?: string
  38. leftMenuBgLightColor?: string
  39. leftMenuBgActiveColor?: string
  40. leftMenuCollapseBgActiveColor?: string
  41. leftMenuTextColor?: string
  42. leftMenuTextActiveColor?: string
  43. logoTitleTextColor?: string
  44. logoBorderColor?: string
  45. topHeaderBgColor?: string
  46. topHeaderTextColor?: string
  47. topHeaderHoverColor?: string
  48. topToolBorderColor?: string
  49. }
  50. }