diff --git a/types/react-native-actionsheet/index.d.ts b/types/react-native-actionsheet/index.d.ts new file mode 100644 index 0000000000..8c6c4c8169 --- /dev/null +++ b/types/react-native-actionsheet/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for react-native-actionsheet 2.4 +// Project: https://github.com/beefe/react-native-actionsheet +// Definitions by: Ian +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +export interface ActionSheetProps { + options: React.ReactNode[]; + onPress: (index: number) => void; + title?: string; + message?: string; + tintColor?: string; + cancelButtonIndex?: number; + destructiveButtonIndex?: number; + styles?: object; +} + +export default class ActionSheet extends React.Component { + show: () => void; +} diff --git a/types/react-native-actionsheet/react-native-actionsheet-tests.tsx b/types/react-native-actionsheet/react-native-actionsheet-tests.tsx new file mode 100644 index 0000000000..0e25c7877d --- /dev/null +++ b/types/react-native-actionsheet/react-native-actionsheet-tests.tsx @@ -0,0 +1,19 @@ +import * as React from 'react'; +import ActionSheet from 'react-native-actionsheet'; + +class Example extends React.Component { + render() { + return ( + {}} + title="Test" + message="Test" + tintColor="white" + cancelButtonIndex={0} + destructiveButtonIndex={1} + styles={{}} + /> + ); + } +} diff --git a/types/react-native-actionsheet/tsconfig.json b/types/react-native-actionsheet/tsconfig.json new file mode 100644 index 0000000000..4f709a482c --- /dev/null +++ b/types/react-native-actionsheet/tsconfig.json @@ -0,0 +1,25 @@ + +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-native-actionsheet-tests.tsx" + ] +} diff --git a/types/react-native-actionsheet/tslint.json b/types/react-native-actionsheet/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-actionsheet/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }