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