mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
The types `Options` and `MultiOptions` as well as `OpenReturn` and `ShareSingleReturn` are taken directly from https://github.com/react-native-community/react-native-share/blob/7535726eb42205260c09d9f0a2b39ba6d00ebc2c/index.js and have only have been transformed to interfaces. The signature of the `shareSingle` call is missing `social` in the official repo as well, but from the native code it becomes apearent that it is required: https://github.com/react-native-community/react-native-share/blob/7535726eb42205260c09d9f0a2b39ba6d00ebc2c/ios/RNShare.m#L85-L122
43 lines
696 B
TypeScript
43 lines
696 B
TypeScript
import Share from 'react-native-share';
|
|
|
|
// $ExpectType Promise<OpenReturn>
|
|
Share.open({
|
|
url: '',
|
|
message: '',
|
|
});
|
|
|
|
// $ExpectType Promise<OpenReturn>
|
|
Share.open({
|
|
title: '',
|
|
message: '',
|
|
urls: [],
|
|
});
|
|
|
|
// $ExpectType Promise<OpenReturn>
|
|
Share.open({
|
|
url: '',
|
|
type: '',
|
|
message: '',
|
|
title: '',
|
|
subject: '',
|
|
excludedActivityTypes: '',
|
|
showAppsToView: true,
|
|
});
|
|
|
|
// $ExpectType Promise<ShareSingleReturn>
|
|
Share.shareSingle({
|
|
url: '',
|
|
message: '',
|
|
social: 'facebook',
|
|
});
|
|
|
|
// $ExpectType Promise<ShareSingleReturn>
|
|
Share.shareSingle({
|
|
url: '',
|
|
type: '',
|
|
message: '',
|
|
title: '',
|
|
subject: '',
|
|
social: 'facebook',
|
|
});
|