-
-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathLinking.res
More file actions
39 lines (27 loc) · 1.16 KB
/
Linking.res
File metadata and controls
39 lines (27 loc) · 1.16 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
module ExtraValue = {
type t
external fromString: string => t = "%identity"
external fromInt: int => t = "%identity"
external fromFloat: float => t = "%identity"
external fromBool: bool => t = "%identity"
}
type extraValue = ExtraValue.t
type extra = {key: string, value: extraValue}
@scope("Linking") @module("react-native")
external openURL: string => promise<unit> = "openURL"
@scope("Linking") @module("react-native")
external canOpenURL: string => promise<bool> = "canOpenURL"
@scope("Linking") @module("react-native")
external getInitialURL: unit => promise<Js.Null.t<string>> = "getInitialURL"
@scope("Linking") @module("react-native")
external openSettings: unit => promise<unit> = "openSettings"
// multiple externals
@scope("Linking") @module("react-native")
external sendIntent: string => promise<unit> = "sendIntent"
// multiple externals
@scope("Linking") @module("react-native")
external sendIntentWithExtras: (string, array<extra>) => promise<unit> = "sendIntent"
type url = {url: string}
type eventType = [#url]
@scope("Linking") @module("react-native")
external addEventListener: (eventType, url => unit) => EventSubscription.t = "addEventListener"