2023-03-06 03:44:33 +00:00
|
|
|
export {}
|
2023-02-10 16:44:00 +00:00
|
|
|
declare global {
|
2023-04-03 08:11:12 +00:00
|
|
|
interface Fn<T = any> {
|
2023-02-10 16:44:00 +00:00
|
|
|
(...arg: T[]): T
|
|
|
|
}
|
|
|
|
|
2023-04-03 08:11:12 +00:00
|
|
|
type Nullable<T> = T | null
|
2023-02-10 16:44:00 +00:00
|
|
|
|
2023-04-03 08:11:12 +00:00
|
|
|
type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>
|
2023-02-10 16:44:00 +00:00
|
|
|
|
2023-04-03 08:11:12 +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-04-03 08:11:12 +00:00
|
|
|
type ComponentRef<T> = InstanceType<T>
|
2023-02-10 16:44:00 +00:00
|
|
|
|
2023-04-03 08:11:12 +00:00
|
|
|
type LocaleType = 'zh-CN' | 'en'
|
2023-02-10 16:44:00 +00:00
|
|
|
|
2023-04-03 08:11:12 +00:00
|
|
|
type AxiosHeaders =
|
2023-02-10 16:44:00 +00:00
|
|
|
| 'application/json'
|
|
|
|
| 'application/x-www-form-urlencoded'
|
|
|
|
| 'multipart/form-data'
|
|
|
|
|
2023-06-25 05:34:27 +00:00
|
|
|
type AxiosMethod =
|
|
|
|
| 'get'
|
|
|
|
| 'post'
|
|
|
|
| 'delete'
|
|
|
|
| 'put'
|
|
|
|
| 'patch'
|
|
|
|
| 'GET'
|
|
|
|
| 'POST'
|
|
|
|
| 'DELETE'
|
|
|
|
| 'PUT'
|
|
|
|
| 'PATCH'
|
2023-02-10 16:44:00 +00:00
|
|
|
|
2023-04-03 08:11:12 +00:00
|
|
|
type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'
|
2023-02-10 16:44:00 +00:00
|
|
|
|
2023-04-03 08:11:12 +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-04-03 08:11:12 +00:00
|
|
|
interface IResponse<T = any> {
|
2023-02-10 16:44:00 +00:00
|
|
|
code: string
|
|
|
|
data: T extends any ? T : T & any
|
|
|
|
}
|
|
|
|
|
2023-04-03 08:11:12 +00:00
|
|
|
interface PageParam {
|
2023-02-10 16:44:00 +00:00
|
|
|
pageSize?: number
|
|
|
|
pageNo?: number
|
|
|
|
}
|
|
|
|
|
2023-04-03 08:11:12 +00:00
|
|
|
interface Tree {
|
2023-02-10 16:44:00 +00:00
|
|
|
id: number
|
|
|
|
name: string
|
|
|
|
children?: Tree[] | any[]
|
|
|
|
}
|
|
|
|
}
|