-
-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathAlert.res
More file actions
43 lines (38 loc) · 800 Bytes
/
Alert.res
File metadata and controls
43 lines (38 loc) · 800 Bytes
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
type options = {
cancelable?: bool,
onDismiss?: unit => unit,
}
type style = [#default | #cancel | #destructive]
type button = {
text?: string,
onPress?: unit => unit,
style?: style,
isPreferred?: bool,
}
@scope("Alert") @module("react-native")
external alert: (
~title: string,
~message: string=?,
~buttons: array<button>=?,
~options: options=?,
) => unit = "alert"
type type_ = [
| #default
| #"plain-text"
| #"secure-text"
| #"login-password"
]
@scope("Alert") @module("react-native")
external prompt: (
~title: string,
~message: string=?,
~callbackOrButtons: @unwrap
[
| #callback(string => unit)
| #buttons(array<button>)
]=?,
~type_: type_=?,
~defaultValue: string=?,
~keyboardType: string=?,
~options: options=?,
) => unit = "prompt"