-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.d.ts
43 lines (37 loc) · 1.09 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
import * as React from 'react';
import type { InputProps } from 'rsuite';
interface AlertModalProps {
okButtonText?: string;
onOk?: (() => void) | (() => Promise<any>);
}
interface ConfirmModalProps {
okButtonText?: string;
okButtonDangerous?: boolean;
cancelButtonText?: string;
onOk?: (() => void) | (() => Promise<any>);
onCancel?: (isSubmitLoading?: boolean) => any;
canCancelOnLoading?: boolean;
}
interface PromptModalProps {
okButtonText?: string;
okButtonDangerous?: boolean;
cancelButtonText?: string;
validate?: (inputValue: string) => boolean;
onOk?: ((inputVal?: string) => void) | ((inputVal: string) => Promise<any>);
onCancel?: (isSubmitLoading?: boolean) => any;
canCancelOnLoading?: boolean;
inputProps?: InputProps;
}
export function alert(
message?: React.ReactNode,
modalConfig?: AlertModalProps
): Promise<void>;
export function confirm(
message?: React.ReactNode,
modalConfig?: ConfirmModalProps
): Promise<boolean>;
export function prompt(
message?: React.ReactNode,
_default?: string,
modalConfig?: PromptModalProps
): Promise<string | null>;