mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added definitions for react-native-input-spinner (#43678)
* lint and config added * input spinner typings added * test file added * updated with semi colons * version fix * version test fix
This commit is contained in:
parent
1d68e381aa
commit
74a8df8b7f
58
types/react-native-input-spinner/index.d.ts
vendored
Normal file
58
types/react-native-input-spinner/index.d.ts
vendored
Normal file
@ -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 <https://github.com/mkrishnan-codes>
|
||||
// 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<ViewStyle>;
|
||||
buttonPressStyle?: StyleProp<ViewStyle>;
|
||||
inputStyle?: StyleProp<ViewStyle>;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
append?: React.ReactElement;
|
||||
prepend?: React.ReactElement;
|
||||
}
|
||||
export default class InputSpinner extends Component<ReactNativeInputSpinnerProps> { }
|
||||
@ -0,0 +1,18 @@
|
||||
import * as React from 'react';
|
||||
import InputSpinner from 'react-native-input-spinner';
|
||||
|
||||
class Example extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<InputSpinner
|
||||
min={0}
|
||||
max={50}
|
||||
value={10}
|
||||
step={5}
|
||||
rounded={true}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
24
types/react-native-input-spinner/tsconfig.json
Normal file
24
types/react-native-input-spinner/tsconfig.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
1
types/react-native-input-spinner/tslint.json
Normal file
1
types/react-native-input-spinner/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user