global.d.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. export {}
  2. declare global {
  3. interface Fn<T = any> {
  4. (...arg: T[]): T
  5. }
  6. type Nullable<T> = T | null
  7. type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
  8. type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
  9. type ComponentRef<T> = InstanceType<T>
  10. type LocaleType = 'zh-CN' | 'en'
  11. declare type TimeoutHandle = ReturnType<typeof setTimeout>
  12. declare type IntervalHandle = ReturnType<typeof setInterval>
  13. const _hmt: any[]
  14. interface Window {
  15. _hmt?: any[]
  16. bpmnInstances?: any
  17. }
  18. type SummaryMethodProps<T extends Recordable = Recordable> = Parameters<
  19. import('element-plus').SummaryMethod<T>
  20. >[0]
  21. type AxiosHeaders =
  22. | 'application/json'
  23. | 'application/x-www-form-urlencoded'
  24. | 'multipart/form-data'
  25. type AxiosMethod = 'get' | 'post' | 'delete' | 'put' | 'GET' | 'POST' | 'DELETE' | 'PUT'
  26. type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
  27. interface AxiosConfig {
  28. params?: any
  29. data?: any
  30. url?: string
  31. method?: AxiosMethod
  32. headersType?: string
  33. responseType?: AxiosResponseType
  34. }
  35. interface IResponse<T = any> {
  36. code: string
  37. data: T extends any ? T : T & any
  38. }
  39. interface PageParam {
  40. pageSize?: number
  41. pageNo?: number
  42. }
  43. interface Tree {
  44. id: number
  45. name: string
  46. children?: Tree[] | any[]
  47. }
  48. // 分页数据公共返回
  49. interface PageResult<T> {
  50. list: T // 数据
  51. total: number // 总量
  52. }
  53. }