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" }