-
-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathShare.res
More file actions
36 lines (29 loc) · 901 Bytes
/
Share.res
File metadata and controls
36 lines (29 loc) · 901 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
type content = {
title?: string,
message?: string,
url?: string,
}
type options = {
subject?: string,
tintColor?: string,
excludedActivityTypes?: array<string>,
dialogTitle?: string,
anchor?: int,
}
type action
@module("react-native") @scope("Share")
external sharedAction: action = "sharedAction"
@module("react-native") @scope("Share")
external dismissedAction: action = "dismissedAction"
// This is usually only used as a callback param and not created by the user.
// Therefore prefer option<...> to an optional field for easier matching.
type shareResult = {
action: action,
activityType: option<string>,
}
// multiple externals
@module("react-native") @scope("Share")
external share: content => promise<shareResult> = "share"
// multiple externals
@module("react-native") @scope("Share")
external shareWithOptions: (content, options) => promise<shareResult> = "share"