diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..ff272f0 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,56 @@ +declare module "react-native-button-component" { + + import * as React from 'react'; + + export interface InnerButtonProperties { + imageAnim?: object, + textAnim?: object, + textStyle?: number | React.TextStyle, + imageStyle?: number | React.ImageStyle, + progressAnim?: object, + progressStyle?: number | React.ViewStyle, + progressSize?: number, + progressWidth?: number, + progressTintColor?: string, + progressBackgroundColor?: string, + progressFill?: number, + progressText?: string, + textInsideProgress?: boolean, + progress?: boolean, + spinnerAnim?: object, + spinner?: boolean, + spinnerSize?: number, + spinnerType?: string, + spinnerStyle?: number | React.ViewStyle, + spinnerColor?: string, + image?: any, + text?: string, + } + + export interface ButtonProperties extends InnerButtonProperties { + states?: ButtonComponentProperties, + buttonState?: ButtonComponentProperties | string, + } + + export interface ButtonComponentProperties extends ButtonProperties, React.Props{ + width?: number, + height?: number, + type?: "primary" | "secondary" | string, + shape?: "rectangle" | "cicle" | string, + gradientStart?: object, + gradientEnd?: object, + gradientLocations?: Array, + backgroundColors?: Array, + buttonStyle?: number | React.ViewStyle, + style?: number | React.ViewStyle, + progressSize?: number, + onPress?: Function, + } + + export interface ButtonComponentStatic extends React.NativeMethodsMixin, React.ComponentClass{} + + var ButtonComponent: ButtonComponentStatic; + type ButtonComponent = ButtonComponentStatic; + + export default ButtonComponent; +} \ No newline at end of file diff --git a/package.json b/package.json index 08b52df..820a8f2 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "react-native-button-component", - "version": "0.1.15", + "version": "0.1.16", "description": "A Beautiful, Customizable React Native Button component for iOS & Android", "main": "index.js", + "typings": "index.d.ts", "directories": { "doc": "docs", "example": "example"