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