-
Notifications
You must be signed in to change notification settings - Fork 66
/
index.d.ts
89 lines (84 loc) · 1.96 KB
/
index.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
export interface IAlertOptions {
title?: string;
content?: string;
maskClose?: boolean;
buttonColor?: string;
confirm?: Function;
}
export interface IConfirmOptions {
title?: string;
content?: string;
cancelText?: string;
confirmText?: string;
cancelTextColor?: string;
confirmTextColor?: string;
showCancel?: boolean;
confirm?: Function;
cancel?: Function;
}
export interface IToastShowOptions {
type?: string;
duration?: number;
mask?: boolean;
message?: string;
size?: number;
color?: string;
position?: string;
}
export interface IToast {
show: (
options: IToastShowOptions
) => {
hide: (isHide: boolean) => void;
then: (fn: () => void) => Promise<any>;
};
}
export interface ILoadingShowOptions {
content?: string;
showText?: boolean;
timeout?: number | null;
hide?: <T>() => T;
}
export interface ILoading {
show: (options?: ILoadingShowOptions) => Promise<any>;
hide: <R>() => boolean | R;
}
export interface IActionSheetOptions {
visible?: boolean;
options?: Array<{
text: string;
type: string;
openType: string;
}>;
maskCancel?: boolean;
showCancel?: boolean;
cancelText?: string;
}
export interface IActionSheet<T> {
show: (options?: T) => void;
hide: (options?: T) => void;
}
export interface ICountUpOptions {
useEasing: boolean;
useGrouping: boolean;
separator: string;
decimal: string;
easingFn: (t: number, b: number, c: number, d: number) => number;
formattingFn: (num: number) => string;
prefix: string;
suffix: string;
numerals: Array<number>;
}
export function Alert(options: IAlertOptions): boolean | void;
export function Confirm(options: IConfirmOptions): boolean | void;
export function CountUp(
startVal: number,
endVal: number,
decimals: number,
duration: number,
callback?: number,
options?: ICountUpOptions
): boolean | void;
export const Toast: IToast;
export const Loading: ILoading;
export const ActionSheet: IActionSheet<IActionSheetOptions>;