UNPKG

5.42 kBTypeScriptView Raw
1import React from 'react';
2import { TextInput, Animated, ViewStyle, StyleProp, TextStyle, TextInputProps } from 'react-native';
3import { IconNode } from '../icons/Icon';
4import { ThemeProps } from '../config';
5export declare type InputProps = React.ComponentPropsWithRef<typeof TextInput> & {
6 containerStyle?: StyleProp<ViewStyle>;
7 disabled?: boolean;
8 disabledInputStyle?: StyleProp<TextStyle>;
9 inputContainerStyle?: StyleProp<ViewStyle>;
10 leftIcon?: IconNode;
11 leftIconContainerStyle?: StyleProp<ViewStyle>;
12 rightIcon?: IconNode;
13 rightIconContainerStyle?: StyleProp<ViewStyle>;
14 inputStyle?: StyleProp<TextStyle>;
15 InputComponent?: typeof React.Component;
16 errorProps?: object;
17 errorStyle?: StyleProp<TextStyle>;
18 errorMessage?: string;
19 label?: string | React.ReactNode;
20 labelStyle?: StyleProp<TextStyle>;
21 labelProps?: object;
22 renderErrorMessage?: boolean;
23};
24declare class Input extends React.Component<InputProps & Partial<ThemeProps<InputProps>>> {
25 input: any;
26 shakeAnimationValue: Animated.Value;
27 focus(): void;
28 blur(): void;
29 clear(): void;
30 isFocused(): boolean;
31 setNativeProps(nativeProps: Partial<TextInputProps>): void;
32 shake: () => void;
33 render(): JSX.Element;
34}
35export { Input };
36declare const _default: React.FunctionComponent<Pick<TextInputProps & React.RefAttributes<TextInput> & {
37 containerStyle?: StyleProp<ViewStyle>;
38 disabled?: boolean;
39 disabledInputStyle?: StyleProp<TextStyle>;
40 inputContainerStyle?: StyleProp<ViewStyle>;
41 leftIcon?: IconNode;
42 leftIconContainerStyle?: StyleProp<ViewStyle>;
43 rightIcon?: IconNode;
44 rightIconContainerStyle?: StyleProp<ViewStyle>;
45 inputStyle?: StyleProp<TextStyle>;
46 InputComponent?: typeof React.Component;
47 errorProps?: object;
48 errorStyle?: StyleProp<TextStyle>;
49 errorMessage?: string;
50 label?: React.ReactNode;
51 labelStyle?: StyleProp<TextStyle>;
52 labelProps?: object;
53 renderErrorMessage?: boolean;
54} & Partial<ThemeProps<InputProps>>, "style" | "onLayout" | "testID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "disabled" | "allowFontScaling" | "numberOfLines" | "nativeID" | "maxFontSizeMultiplier" | "selectionColor" | "textBreakStrategy" | "hitSlop" | "onBlur" | "onFocus" | "hasTVPreferredFocus" | "tvParallaxProperties" | "containerStyle" | "pointerEvents" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "ref" | "label" | "placeholder" | "key" | "value" | "onContentSizeChange" | "onScroll" | "scrollEnabled" | "autoCapitalize" | "autoCorrect" | "autoFocus" | "blurOnSubmit" | "caretHidden" | "contextMenuHidden" | "defaultValue" | "editable" | "keyboardType" | "maxLength" | "multiline" | "onChange" | "onChangeText" | "onEndEditing" | "onSelectionChange" | "onSubmitEditing" | "onTextInput" | "onKeyPress" | "placeholderTextColor" | "returnKeyType" | "secureTextEntry" | "selectTextOnFocus" | "selection" | "textAlign" | "inputAccessoryViewID" | "clearButtonMode" | "clearTextOnFocus" | "dataDetectorTypes" | "enablesReturnKeyAutomatically" | "keyboardAppearance" | "passwordRules" | "rejectResponderTermination" | "selectionState" | "spellCheck" | "textContentType" | "autoCompleteType" | "importantForAutofill" | "disableFullscreenUI" | "inlineImageLeft" | "inlineImagePadding" | "returnKeyLabel" | "underlineColorAndroid" | "textAlignVertical" | "showSoftInputOnFocus" | "disabledInputStyle" | "inputContainerStyle" | "leftIcon" | "leftIconContainerStyle" | "rightIcon" | "rightIconContainerStyle" | "inputStyle" | "InputComponent" | "errorProps" | "errorStyle" | "errorMessage" | "labelStyle" | "labelProps" | "renderErrorMessage">> | React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<TextInput> & {
55 containerStyle?: StyleProp<ViewStyle>;
56 disabled?: boolean;
57 disabledInputStyle?: StyleProp<TextStyle>;
58 inputContainerStyle?: StyleProp<ViewStyle>;
59 leftIcon?: IconNode;
60 leftIconContainerStyle?: StyleProp<ViewStyle>;
61 rightIcon?: IconNode;
62 rightIconContainerStyle?: StyleProp<ViewStyle>;
63 inputStyle?: StyleProp<TextStyle>;
64 InputComponent?: typeof React.Component;
65 errorProps?: object;
66 errorStyle?: StyleProp<TextStyle>;
67 errorMessage?: string;
68 label?: React.ReactNode;
69 labelStyle?: StyleProp<TextStyle>;
70 labelProps?: object;
71 renderErrorMessage?: boolean;
72} & Partial<ThemeProps<InputProps>>>;
73export default _default;