提交 | 用户 | age
|
661db0
|
1 |
declare interface Fn<T = any, R = T> { |
V |
2 |
(...arg: T[]): R; |
|
3 |
} |
|
4 |
|
|
5 |
declare interface PromiseFn<T = any, R = T> { |
|
6 |
(...arg: T[]): Promise<R>; |
2f6253
|
7 |
} |
陈 |
8 |
|
|
9 |
declare interface IObj<T = any> { |
|
10 |
[key: string]: T; |
|
11 |
[key: number]: T; |
|
12 |
} |
|
13 |
|
|
14 |
declare function parseInt(s: string | number, radix?: number): number; |
e23336
|
15 |
|
2f6253
|
16 |
declare function parseFloat(string: string | number): number; |
陈 |
17 |
|
|
18 |
declare type Nullable<T> = T | null; |
4ff1c4
|
19 |
|
V |
20 |
declare type NonNullable<T> = T extends null | undefined ? never : T; |
2f6253
|
21 |
|
陈 |
22 |
declare type RefType<T> = T | null; |
|
23 |
|
|
24 |
declare type CustomizedHTMLElement<T> = HTMLElement & T; |
|
25 |
|
4ff1c4
|
26 |
declare type Indexable<T extends any = any> = { |
2f6253
|
27 |
[key: string]: T; |
陈 |
28 |
}; |
4ff1c4
|
29 |
|
V |
30 |
declare type Recordable<T extends any = any> = Record<string, T>; |
e23336
|
31 |
|
1d3007
|
32 |
declare type ReadonlyRecordable<T extends any = any> = { |
V |
33 |
readonly [key: string]: T; |
|
34 |
}; |
|
35 |
|
bdce84
|
36 |
declare type Hash<T> = Indexable<T>; |
2f6253
|
37 |
|
bdce84
|
38 |
declare type DeepPartial<T> = { |
4ff6b7
|
39 |
[P in keyof T]?: DeepPartial<T[P]>; |
2f6253
|
40 |
}; |
陈 |
41 |
|
46e087
|
42 |
declare type LabelValueOptions = { |
2f6253
|
43 |
label: string; |
陈 |
44 |
value: any; |
|
45 |
}[]; |
|
46 |
|
bdce84
|
47 |
declare type EmitType = (event: string, ...args: any[]) => void; |
2f6253
|
48 |
|
bdce84
|
49 |
declare type TargetContext = '_self' | '_blank'; |
46e087
|
50 |
|
V |
51 |
declare type TimeoutHandle = ReturnType<typeof setTimeout>; |
|
52 |
|
|
53 |
declare type IntervalHandle = ReturnType<typeof setInterval>; |
0692b4
|
54 |
|
V |
55 |
declare interface ComponentElRef<T extends HTMLElement = HTMLDivElement> { |
|
56 |
$el: T; |
|
57 |
} |
|
58 |
|
|
59 |
declare type ComponentRef<T extends HTMLElement = HTMLDivElement> = ComponentElRef<T> | null; |
|
60 |
|
|
61 |
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>; |
4ff1c4
|
62 |
|
V |
63 |
type IsSame<A, B> = A | B extends A & B ? true : false; |