forked from shimohq/react-native-prompt-android
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
59 lines (48 loc) · 1.29 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
// Type definitions for react-native-prompt-android 0.3.1
// Project: https://github.com/shimohq/react-native-prompt-android
// Definitions by: Krystof Celba <https://github.com/krystofcelba>
// TypeScript Version: 2.6.1
type PromptButton = {
text?: string;
onPress?: (message: string) => void;
/** @platform ios */
style?: 'default' | 'cancel' | 'destructive';
};
type PromptType = 'default' | 'plain-text' | 'secure-text';
type PromptTypeIOS = 'login-password';
type PromptTypeAndroid = 'numeric' | 'email-address' | 'phone-pad';
type PromptStyleAndroid = 'default' | 'shimo';
export interface PromptOptions {
/**
* * Cross platform:
*
* - `'default'`
* - `'plain-text'`
* - `'secure-text'`
*
* * iOS only:
*
* - `'login-password'`
*
* * Android only:
*
* - `'numeric'`
* - `'email-address'`
* - `'phone-pad'`
*/
type?: PromptType | PromptTypeIOS | PromptTypeAndroid;
defaultValue?: string;
/** @platform android */
placeholder?: string;
/** @platform android */
cancelable?: boolean;
/** @platform android */
style?: PromptStyleAndroid;
}
declare function prompt(
title?: string,
message?: string,
callbackOrButtons?: ((value: string) => void) | Array<PromptButton>,
options?: PromptOptions,
): void;
export default prompt;