diff --git a/types/react-native-modal-dropdown/index.d.ts b/types/react-native-modal-dropdown/index.d.ts new file mode 100644 index 0000000000..01470ec1cf --- /dev/null +++ b/types/react-native-modal-dropdown/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for react-native-modal-dropdown 0.6 +// Project: https://github.com/sohobloo/react-native-modal-dropdown +// Definitions by: Carlos Li +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from "react"; + +import ModalDropdown = RNModalDropdown.ModalDropdown; +export = ModalDropdown; + +declare namespace RNModalDropdown { + interface PositionStyle { + left?: number; + right?: number; + width?: number; + } + interface ModalDropdownProps { + disabled?: boolean; + defaultIndex?: number; + defaultValue?: string; + options?: any[]; + animated?: boolean; + showsVerticalScrollIndicator?: boolean; + style?: any; + textStyle?: any; + dropdownStyle?: any; + dropdownTextStyle?: any; + dropdownTextHighlightStyle?: any; + adjustFrame?: (positionStyle: PositionStyle) => void; + renderRow?: (option: any, index: number, isSelected: boolean) => any; + renderSeparator?: () => any; + renderButtonText?: (text: any) => any; + onDropdownWillShow?: () => boolean; + onDropdownWillHide?: () => boolean; + onSelect?: (index: number, option: any) => void; + accessible?: boolean; + keyboardShouldPersistTaps?: "always" | "never" | "handled"; + } + + class ModalDropdown extends React.Component { + static default: typeof ModalDropdown; + } +} diff --git a/types/react-native-modal-dropdown/react-native-modal-dropdown-tests.tsx b/types/react-native-modal-dropdown/react-native-modal-dropdown-tests.tsx new file mode 100644 index 0000000000..685dd1f531 --- /dev/null +++ b/types/react-native-modal-dropdown/react-native-modal-dropdown-tests.tsx @@ -0,0 +1,10 @@ +import * as React from 'react'; +import ModalDropdown from "react-native-modal-dropdown"; + +class Test extends React.Component { + render() { + return ( + + ); + } +} diff --git a/types/react-native-modal-dropdown/tsconfig.json b/types/react-native-modal-dropdown/tsconfig.json new file mode 100644 index 0000000000..9800a11341 --- /dev/null +++ b/types/react-native-modal-dropdown/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-modal-dropdown-tests.tsx" + ] +} diff --git a/types/react-native-modal-dropdown/tslint.json b/types/react-native-modal-dropdown/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-native-modal-dropdown/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}