2023-03-06 11:44:33 +08:00
|
|
|
export {}
|
2023-02-11 00:44:00 +08:00
|
|
|
declare global {
|
2023-04-03 16:11:12 +08:00
|
|
|
interface Fn<T = any> {
|
2023-02-11 00:44:00 +08:00
|
|
|
(...arg: T[]): T
|
|
|
|
}
|
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
type Nullable<T> = T | null
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
type ComponentRef<T> = InstanceType<T>
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
type LocaleType = 'zh-CN' | 'en'
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2024-02-29 18:52:46 +08:00
|
|
|
declare type TimeoutHandle = ReturnType<typeof setTimeout>
|
|
|
|
declare type IntervalHandle = ReturnType<typeof setInterval>
|
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
type AxiosHeaders =
|
2023-02-11 00:44:00 +08:00
|
|
|
| 'application/json'
|
|
|
|
| 'application/x-www-form-urlencoded'
|
|
|
|
| 'multipart/form-data'
|
|
|
|
|
2023-06-25 14:06:14 +08:00
|
|
|
type AxiosMethod = 'get' | 'post' | 'delete' | 'put' | 'GET' | 'POST' | 'DELETE' | 'PUT'
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
|
2023-02-11 00:44:00 +08:00
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
interface AxiosConfig {
|
2023-02-11 00:44:00 +08:00
|
|
|
params?: any
|
|
|
|
data?: any
|
|
|
|
url?: string
|
|
|
|
method?: AxiosMethod
|
|
|
|
headersType?: string
|
|
|
|
responseType?: AxiosResponseType
|
|
|
|
}
|
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
interface IResponse<T = any> {
|
2023-02-11 00:44:00 +08:00
|
|
|
code: string
|
|
|
|
data: T extends any ? T : T & any
|
|
|
|
}
|
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
interface PageParam {
|
2023-02-11 00:44:00 +08:00
|
|
|
pageSize?: number
|
|
|
|
pageNo?: number
|
|
|
|
}
|
|
|
|
|
2023-04-03 16:11:12 +08:00
|
|
|
interface Tree {
|
2023-02-11 00:44:00 +08:00
|
|
|
id: number
|
|
|
|
name: string
|
|
|
|
children?: Tree[] | any[]
|
|
|
|
}
|
|
|
|
}
|