diff --git a/README.md b/README.md index 69478be..3b010e0 100755 --- a/README.md +++ b/README.md @@ -170,4 +170,5 @@ npm i react-native-smooth-pincode-input * [Elements](https://github.com/elementsinteractive) * [Dawid Urbas](https://github.com/mrruby) * [bsnelder](https://github.com/bsnelder) -* [Nocks](https://github.com/nocksapp) \ No newline at end of file +* [Nocks](https://github.com/nocksapp) +* [blazk0](https://github.com/blazk0) \ No newline at end of file diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..5d0dc48 --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,47 @@ +/** + * TypeScript declaration for https://github.com/xamous/react-native-smooth-pincode-input + * + * @author Amr Mostafa + */ + +declare module 'react-native-smooth-pincode-input' { + import React from 'react'; + import { + TextStyle, + ViewStyle, + ImageStyle, + StyleProp, + KeyboardType, + } from 'react-native'; + import * as Animatable from 'react-native-animatable'; + + interface Props { + value: string; + codeLength?: number; + cellSize?: number; + cellSpacing?: number; + placeholder?: JSX.Element | string; + mask?: JSX.Element | string; + maskDelay?: number; + password?: boolean; + autoFocus?: boolean; + editable?: boolean; + animated?: boolean; + animationFocused?: + | string + | Animatable.CustomAnimation; + restrictToNumbers?: boolean; + containerStyle?: StyleProp; + cellStyle?: StyleProp; + cellStyleFocused?: StyleProp; + textStyle?: StyleProp; + onFulfill?: () => void; + onTextChange: (text: string) => void; + onBackspace?: () => void; + keyboardType?: KeyboardType; + } + + class SmoothPinCodeInput extends React.Component {} + + export default SmoothPinCodeInput; +}