From 6739c1e7b581debfdafa5c97c4b3673fa794f5d4 Mon Sep 17 00:00:00 2001 From: Amr Abo Elenin Date: Sun, 18 Oct 2020 16:09:43 +0300 Subject: [PATCH 1/2] add type declaration file --- src/index.d.ts | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/index.d.ts 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; +} From 547f9bfc43cf99fba147134648fb673443c21a62 Mon Sep 17 00:00:00 2001 From: Amr Abo Elenin Date: Sun, 18 Oct 2020 17:20:34 +0300 Subject: [PATCH 2/2] add to contributers --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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