global.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 RemoveReadonly<T> = {
  10. -readonly [P in keyof T]: T[P]
  11. }
  12. declare type ComponentRef<T> = InstanceType<T>
  13. declare type LocaleType = 'zh-CN' | 'en'
  14. declare type TimeoutHandle = ReturnType<typeof setTimeout>
  15. declare type IntervalHandle = ReturnType<typeof setInterval>
  16. declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
  17. declare type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'
  18. declare type AxiosHeaders =
  19. | 'application/json'
  20. | 'application/x-www-form-urlencoded'
  21. | 'multipart/form-data'
  22. declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put'
  23. declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
  24. declare interface AxiosConfig {
  25. params?: any
  26. data?: any
  27. url?: string
  28. method?: AxiosMethod
  29. headersType?: string
  30. responseType?: AxiosResponseType
  31. }
  32. declare interface IResponse<T = any> {
  33. code: string
  34. data: T extends any ? T : T & any,
  35. token: string
  36. }
  37. declare interface ThemeTypes {
  38. elColorPrimary?: string
  39. leftMenuBorderColor?: string
  40. leftMenuBgColor?: string
  41. leftMenuBgLightColor?: string
  42. leftMenuBgActiveColor?: string
  43. leftMenuCollapseBgActiveColor?: string
  44. leftMenuTextColor?: string
  45. leftMenuTextActiveColor?: string
  46. logoTitleTextColor?: string
  47. logoBorderColor?: string
  48. topHeaderBgColor?: string
  49. topHeaderTextColor?: string
  50. topHeaderHoverColor?: string
  51. topToolBorderColor?: string
  52. }
  53. }