diff --git a/types/react-native-material-design-searchbar/index.d.ts b/types/react-native-material-design-searchbar/index.d.ts new file mode 100644 index 0000000000..d2269fae4b --- /dev/null +++ b/types/react-native-material-design-searchbar/index.d.ts @@ -0,0 +1,41 @@ +// Type definitions for react-native-material-design-searchbar 1.1 +// Project: https://github.com/ananddayalan/react-native-material-design-searchbar +// Definitions by: Kyle Roach +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as React from 'react'; +import { + TextInputProperties, + ReturnKeyType, + ReturnKeyTypeAndroid, + TextStyle, + ReturnKeyTypeIOS, +} from 'react-native'; + +export interface SearchBarProps { + height: number; + autoCorrect?: boolean; + returnKeyType?: ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS; + placeholder?: string; + padding?: number; + inputStyle?: TextStyle; + iconCloseName?: string; + iconSearchName?: string; + iconBackName?: string; + iconSize?: number; + iconPadding?: number; + placeholderColor?: string; + iconColor?: string; + textStyle?: TextStyle; + inputProps?: TextInputProperties; + onSearchChange?(text: string): void; + onClose?(): void; + onBlur?(): void; + onEndEditing?(): void; + onSubmitEditing?(): void; + onFocus?(): void; + onBackPress?(): void; +} + +export default class SearchBar extends React.Component {} diff --git a/types/react-native-material-design-searchbar/react-native-material-design-searchbar-tests.tsx b/types/react-native-material-design-searchbar/react-native-material-design-searchbar-tests.tsx new file mode 100644 index 0000000000..fec9daf4a3 --- /dev/null +++ b/types/react-native-material-design-searchbar/react-native-material-design-searchbar-tests.tsx @@ -0,0 +1,19 @@ +import * as React from 'react'; +import SearchBar from 'react-native-material-design-searchbar'; + +class SearchbarTest extends React.Component { + render() { + return ( + console.log('On Search Change')} + height={50} + onFocus={() => console.log('On Focus')} + onBlur={() => console.log('On Blur')} + placeholder={'Search...'} + autoCorrect={false} + padding={5} + returnKeyType={'search'} + /> + ); + } +} diff --git a/types/react-native-material-design-searchbar/tsconfig.json b/types/react-native-material-design-searchbar/tsconfig.json new file mode 100644 index 0000000000..d45789898e --- /dev/null +++ b/types/react-native-material-design-searchbar/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-native-material-design-searchbar-tests.tsx" + ] +} diff --git a/types/react-native-material-design-searchbar/tslint.json b/types/react-native-material-design-searchbar/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-material-design-searchbar/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }