UNPKG

2.84 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<Omit<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>>, keyof ThemeProps<T>>> | 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;