-
-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathAlert.res
More file actions
49 lines (42 loc) · 1.04 KB
/
Alert.res
File metadata and controls
49 lines (42 loc) · 1.04 KB
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
type options = {
cancelable?: bool,
onDismiss?: unit => unit,
}
@obj // @deprecated("Directly create record instead")
external options: (~cancelable: bool=?, ~onDismiss: unit => unit=?, unit) => options = ""
type style = [#default | #cancel | #destructive]
type button = {
text?: string,
onPress?: unit => unit,
style?: style,
}
@obj // @deprecated("Directly create record instead")
external button: (~text: string=?, ~onPress: unit => unit=?, ~style: style=?, unit) => button = ""
@scope("Alert") @module("react-native")
external alert: (
~title: string,
~message: string=?,
~buttons: array<button>=?,
~options: options=?,
unit,
) => 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=?,
unit,
) => unit = "prompt"