global.d.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. type AxiosHeaders =
  12. | 'application/json'
  13. | 'application/x-www-form-urlencoded'
  14. | 'multipart/form-data'
  15. type AxiosMethod = 'get' | 'post' | 'delete' | 'put' | 'GET' | 'POST' | 'DELETE' | 'PUT'
  16. type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
  17. interface AxiosConfig {
  18. params?: any
  19. data?: any
  20. url?: string
  21. method?: AxiosMethod
  22. headersType?: string
  23. responseType?: AxiosResponseType
  24. }
  25. interface IResponse<T = any> {
  26. code: string
  27. data: T extends any ? T : T & any
  28. }
  29. interface PageParam {
  30. pageSize?: number
  31. pageNo?: number
  32. }
  33. interface Tree {
  34. id: number
  35. name: string
  36. children?: Tree[] | any[]
  37. }
  38. }