import { EventEmitter } from "events"; import { JSX } from "react"; import { TextInput, TextInputProps } from "react-native"; export declare const inputEvents: EventEmitter<[never]>; export declare const emitInputClearEvent: () => void; export interface InputProps extends Omit { addClearListener?: boolean; /** * We are applying some optimisations to make sure the UX is smooth * These lead to some issues when the parent component wants further control of the value */ disabled?: boolean; error?: string; fixedRightPlaceholder?: string; hintText?: string; icon?: JSX.Element; leftComponentWidth?: number; loading?: boolean; onClear?(): void; onHintPress?: () => void; onSelectTap?: () => void; optional?: boolean; onChangeText?: (text: string, unmaskedText?: string) => void; /** * The placeholder can be an array of string, specifically for android, because of a bug. * On ios, the longest string will always be picked, as ios can add ellipsis. * On android, the longest string **that fits** will be picked, as android doesn't use ellipsis. * The way to use it is to put the longest string first, and the shortest string last. * * Check `HACKS.md` for more info. * * @example * const placeholders = [ * "Wow this is a great and very long placeholder", * "Wow this is a great and long placeholder", * "Wow this is a great placeholder", * "Wow", * ] * ... * */ placeholder?: string | string[]; required?: boolean; selectComponentWidth?: number; selectDisplayLabel?: string | undefined | null; showLimit?: boolean; title?: string; unit?: string | undefined | null; /** * A mask to apply to the input value. * Make sure to use mask values using only the digit 9 and non-digit characters. * * @example * * * */ mask?: string | string[] | undefined; /** * @warning This prop affects the performance of the input * and should be avoided if possible. * Use `defaultValue` instead. * See: https://github.com/facebook/react-native-website/pull/4247 */ value?: string | undefined; } type InputPropsWithSecureText = InputProps & { secureTextEntry: true; enableClearButton?: never; }; type InputPropsWithClearButton = InputProps & { enableClearButton: true; secureTextEntry?: never; }; type InputPropsWithNeither = InputProps & { enableClearButton?: boolean; secureTextEntry?: boolean; }; export type InputComponentProps = InputPropsWithSecureText | InputPropsWithClearButton | InputPropsWithNeither; export declare const HORIZONTAL_PADDING = 15; export declare const INPUT_BORDER_RADIUS = 4; export declare const INPUT_MIN_HEIGHT = 56; export declare const MULTILINE_INPUT_MIN_HEIGHT = 110; export declare const MULTILINE_INPUT_MAX_HEIGHT = 300; export declare const LABEL_HEIGHT = 25; export declare const LEFT_COMPONENT_WIDTH = 40; export declare const SELECT_COMPONENT_WIDTH = 120; export interface InputRef { focus: () => void; blur: () => void; clear: () => void; } export declare const Input: import("react").ForwardRefExoticComponent>; export type Input = TextInput; export {};