-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
58 lines (46 loc) · 1.21 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
declare namespace ReactAsyncPopup {
interface Show {
(config?: NewConfig): Promise<any>
}
interface Destroy {
(): Promise<void>;
}
interface NewReturnType {
show: Show;
destroy: Destroy;
}
interface BaseConfig {
title?: React.ReactNode;
content?: React.ReactNode;
footer?: React.ReactNode;
popupStyle?: React.CSSProperties,
okText?: string,
cancelText?: string,
maskClosable?: boolean,
closable?: boolean,
closeOnEscape?: boolean,
wrapClassName?: string;
aria?: {
labelledby?: string;
describedby?: string;
}
}
interface Config extends BaseConfig {
destroyOnClose?: boolean,
container?: HTMLElement;
}
interface New {
(config?: Config): Promise<NewReturnType>;
}
type NewConfig = BaseConfig;
class Modal {
static new: New
}
class Confirm {
static new: New
}
function useModal(config: Config): [Show | null, Destroy | null];
function useConfirm(config: Config): [Show | null, Destroy | null];
}
export as namespace ReactAsyncPopup;
export = ReactAsyncPopup;