2022-10-09 17:12:03 +08:00
|
|
|
import type { CSSProperties } from 'vue'
|
|
|
|
declare global {
|
|
|
|
declare interface Fn<T = any> {
|
|
|
|
(...arg: T[]): T
|
|
|
|
}
|
2021-12-11 20:50:05 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type Nullable<T> = T | null
|
2021-12-11 20:50:05 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
|
2021-12-11 20:50:05 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
|
2021-12-11 20:50:05 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type ComponentRef<T> = InstanceType<T>
|
2021-12-12 09:34:02 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type LocaleType = 'zh-CN' | 'en'
|
2022-01-03 09:41:34 +08:00
|
|
|
|
2023-05-10 10:12:31 +08:00
|
|
|
declare type TimeoutHandle = ReturnType<typeof setTimeout>
|
|
|
|
declare type IntervalHandle = ReturnType<typeof setInterval>
|
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type AxiosHeaders =
|
|
|
|
| 'application/json'
|
|
|
|
| 'application/x-www-form-urlencoded'
|
|
|
|
| 'multipart/form-data'
|
2022-01-08 18:38:20 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type AxiosMethod = 'get' | 'post' | 'delete' | 'put'
|
2022-01-09 10:57:50 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
|
2022-01-09 10:57:50 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare interface AxiosConfig {
|
|
|
|
params?: any
|
|
|
|
data?: any
|
|
|
|
url?: string
|
|
|
|
method?: AxiosMethod
|
|
|
|
headersType?: string
|
|
|
|
responseType?: AxiosResponseType
|
|
|
|
}
|
2022-06-23 22:37:49 +08:00
|
|
|
|
2022-10-09 17:12:03 +08:00
|
|
|
declare interface IResponse<T = any> {
|
|
|
|
code: string
|
|
|
|
data: T extends any ? T : T & any
|
|
|
|
}
|
2022-06-23 22:37:49 +08:00
|
|
|
}
|