1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/app-mobile/utils/ShareExtension.ts

22 lines
525 B
TypeScript
Raw Normal View History

const { NativeModules, Platform } = require('react-native');
export interface SharedData {
title?: string;
text?: string;
resources?: string[];
}
2021-04-24 10:22:11 +02:00
const ShareExtension = (NativeModules.ShareExtension) ?
{
data: () => NativeModules.ShareExtension.data(),
close: () => NativeModules.ShareExtension.close(),
2021-04-24 10:22:11 +02:00
shareURL: (Platform.OS === 'ios') ? NativeModules.ShareExtension.getConstants().SHARE_EXTENSION_SHARE_URL : '',
} :
{
data: () => {},
close: () => {},
2021-04-24 10:22:11 +02:00
shareURL: '',
};
export default ShareExtension;