diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..d7300ea --- /dev/null +++ b/index.d.ts @@ -0,0 +1,70 @@ +declare module 'react-native-materialui-textfield' { + import { PureComponent, ReactNode } from 'react' + import { TextInputProps, TextStyle, StyleProp, ViewStyle } from 'react-native' + + enum LineType { + solid, + dotted, + dashed, + none + } + + interface LinePropTypes { + type: LineType + width: number + color: string + } + + interface MaterialTextFieldPropTypes extends TextInputProps { + animationDuration?: number; + + fontSize?: number; + titleFontSize?: number; + labelFontSize?: number; + labelHeight?: number; + labelPadding?: number; + inputContainerPadding?: number; + + labelTextStyle?: TextStyle; + titleTextStyle?: TextStyle; + affixTextStyle?: TextStyle; + + tintColor?: string; + textColor?: string; + baseColor?: string; + + label: string; + title?: string; + + characterRestriction?: number; + + error?: string; + errorColor?: string; + + lineWidth?: number; + activeLineWidth?: number; + + disabled?: boolean; + disabledLineType?: LineType; + disabledLineWidth?: number; + + renderAccessory?: () => ReactNode; + + prefix?: string; + suffix?: string; + + containerStyle?: StyleProp; + inputContainerStyle?: StyleProp; + + helpersNumberOfLines?: number; + } + + export class TextField extends PureComponent { + focus(): void; + blur(): void; + clear(): void; + value(): string; + isFocused(): boolean; + isRestricted(): boolean; + } + } \ No newline at end of file diff --git a/package.json b/package.json index 3d74d9f..0445127 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-materialui-textfield", - "version": "0.13.2", + "version": "0.13.3", "license": "BSD-3-Clause", "author": "Alexander Nazarov ", "contributors": [