From 24a8fc99dc1eaf3862edbc2e92512960feca8e80 Mon Sep 17 00:00:00 2001 From: Haseeb Majid Date: Thu, 18 Jul 2019 00:21:03 +0100 Subject: [PATCH] Added react-native-share-menu (#36960) Added react native share menu --- types/react-native-share-menu/index.d.ts | 12 ++++++++++ .../react-native-share-menu-tests.ts | 5 ++++ types/react-native-share-menu/tsconfig.json | 23 +++++++++++++++++++ types/react-native-share-menu/tslint.json | 1 + 4 files changed, 41 insertions(+) create mode 100644 types/react-native-share-menu/index.d.ts create mode 100644 types/react-native-share-menu/react-native-share-menu-tests.ts create mode 100644 types/react-native-share-menu/tsconfig.json create mode 100644 types/react-native-share-menu/tslint.json diff --git a/types/react-native-share-menu/index.d.ts b/types/react-native-share-menu/index.d.ts new file mode 100644 index 0000000000..f6ff1cc1d2 --- /dev/null +++ b/types/react-native-share-menu/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for react-native-share-menu 2.2 +// Project: https://github.com/meedan/react-native-share-menu#readme +// Definitions by: Haseeb Majid +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface ShareMenu { + getSharedText(callback: (text: string) => void): void; + clearSharedText(): void; +} + +export const ShareMenu: ShareMenu; +export default ShareMenu; diff --git a/types/react-native-share-menu/react-native-share-menu-tests.ts b/types/react-native-share-menu/react-native-share-menu-tests.ts new file mode 100644 index 0000000000..e77033c757 --- /dev/null +++ b/types/react-native-share-menu/react-native-share-menu-tests.ts @@ -0,0 +1,5 @@ +import ShareMenu from 'react-native-share-menu'; + +ShareMenu.getSharedText((text: string) => { + const message = text; +}); diff --git a/types/react-native-share-menu/tsconfig.json b/types/react-native-share-menu/tsconfig.json new file mode 100644 index 0000000000..2ed714d1af --- /dev/null +++ b/types/react-native-share-menu/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-share-menu-tests.ts" + ] +} diff --git a/types/react-native-share-menu/tslint.json b/types/react-native-share-menu/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-share-menu/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }