diff --git a/types/react-native-input-spinner/index.d.ts b/types/react-native-input-spinner/index.d.ts new file mode 100644 index 0000000000..18bd302f0c --- /dev/null +++ b/types/react-native-input-spinner/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for react-native-input-spinner 1.2 +// Project: https://github.com/marcocesarato/react-native-input-spinner#readme +// Definitions by: Manu Krishnan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component } from 'react'; +import { StyleProp, ViewStyle } from 'react-native'; + +export interface ReactNativeInputSpinnerProps { + type?: 'int' | 'float'; + min?: string | number; + max?: string | number; + value?: string | number; + step?: string | number; + precision?: number; + rounded?: boolean; + activeOpacity?: number; + color?: string; + colorPress?: string; + colorRight?: string; + colorLeft?: string; + colorMax?: string; + colorMin?: string; + background?: string; + textColor?: string; + arrows?: boolean; + showBorder?: boolean; + fontSize?: number; + fontFamily?: string; + buttonFontSize?: number; + buttonFontFamily?: string; + buttonTextColor?: string; + disabled?: boolean; + editable?: boolean; + width?: string | number; + height?: string | number; + onChange?: (val?: any) => any; + onMin?: (val: any) => any; + onMax?: (val: any) => any; + onIncrease?: (val: any) => any; + onDecrease?: (val: any) => any; + buttonLeftDisabled?: boolean; + buttonRightDisabled?: boolean; + buttonLeftText?: string; + buttonRightText?: string; + buttonLeftImage?: React.ReactElement; + buttonRightImage?: React.ReactElement; + buttonPressLeftImage?: React.ReactElement; + buttonPressRightImage?: React.ReactElement; + buttonStyle?: StyleProp; + buttonPressStyle?: StyleProp; + inputStyle?: StyleProp; + style?: StyleProp; + append?: React.ReactElement; + prepend?: React.ReactElement; +} +export default class InputSpinner extends Component { } diff --git a/types/react-native-input-spinner/react-native-input-spinner-tests.tsx b/types/react-native-input-spinner/react-native-input-spinner-tests.tsx new file mode 100644 index 0000000000..ffa35cc683 --- /dev/null +++ b/types/react-native-input-spinner/react-native-input-spinner-tests.tsx @@ -0,0 +1,18 @@ +import * as React from 'react'; +import InputSpinner from 'react-native-input-spinner'; + +class Example extends React.Component { + render() { + return ( + + + + ); + } +} diff --git a/types/react-native-input-spinner/tsconfig.json b/types/react-native-input-spinner/tsconfig.json new file mode 100644 index 0000000000..4c15db0e5c --- /dev/null +++ b/types/react-native-input-spinner/tsconfig.json @@ -0,0 +1,24 @@ +{ + "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-input-spinner-tests.tsx" + ] +} diff --git a/types/react-native-input-spinner/tslint.json b/types/react-native-input-spinner/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-input-spinner/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }