提交 | 用户 | 时间
|
820397
|
1 |
export {} |
H |
2 |
declare global { |
|
3 |
interface Fn<T = any> { |
|
4 |
(...arg: T[]): T |
|
5 |
} |
|
6 |
|
|
7 |
type Nullable<T> = T | null |
|
8 |
|
|
9 |
type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T> |
|
10 |
|
|
11 |
type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T> |
|
12 |
|
|
13 |
type ComponentRef<T> = InstanceType<T> |
|
14 |
|
|
15 |
type LocaleType = 'zh-CN' | 'en' |
|
16 |
|
|
17 |
declare type TimeoutHandle = ReturnType<typeof setTimeout> |
|
18 |
declare type IntervalHandle = ReturnType<typeof setInterval> |
|
19 |
|
|
20 |
type AxiosHeaders = |
|
21 |
| 'application/json' |
|
22 |
| 'application/x-www-form-urlencoded' |
|
23 |
| 'multipart/form-data' |
|
24 |
|
|
25 |
type AxiosMethod = 'get' | 'post' | 'delete' | 'put' | 'GET' | 'POST' | 'DELETE' | 'PUT' |
|
26 |
|
|
27 |
type AxiosResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream' |
|
28 |
|
|
29 |
interface AxiosConfig { |
|
30 |
params?: any |
|
31 |
data?: any |
|
32 |
url?: string |
|
33 |
method?: AxiosMethod |
|
34 |
headersType?: string |
|
35 |
responseType?: AxiosResponseType |
|
36 |
} |
|
37 |
|
|
38 |
interface IResponse<T = any> { |
|
39 |
code: string |
|
40 |
data: T extends any ? T : T & any |
|
41 |
} |
|
42 |
|
|
43 |
interface PageParam { |
|
44 |
pageSize?: number |
|
45 |
pageNo?: number |
|
46 |
} |
|
47 |
|
|
48 |
interface Tree { |
|
49 |
id: number |
|
50 |
name: string |
|
51 |
children?: Tree[] | any[] |
|
52 |
} |
|
53 |
// 分页数据公共返回 |
|
54 |
interface PageResult<T> { |
|
55 |
list: T // 数据 |
|
56 |
total: number // 总量 |
|
57 |
} |
|
58 |
} |