react-native-form-model
Version:
An easily testable and opinionated React Native form model builder written in pure JavaScript.
21 lines (20 loc) • 1.02 kB
TypeScript
import React from 'react';
import { TextInput as NativeTextInput, TextInputProps } from 'react-native';
import ControlField, { ControlFieldProps, ControlFieldState } from './ControlField';
declare type OmittedTextInputProps = 'value' | 'parse' | 'validate' | 'format' | 'onChangeText' | 'onSubmitEditing' | 'onEndEditing' | 'onBlur' | 'onFocus' | 'onValueChange' | 'onValidation';
declare type TextInputForwardProps = Omit<TextInputProps, OmittedTextInputProps>;
export interface TextInputFieldProps<T> extends ControlFieldProps<T, string>, TextInputForwardProps {
secure?: boolean;
mode?: 'plain' | 'contained';
}
export interface TextInputFieldState<T> extends ControlFieldState<T, string> {
}
/** @deprecated */
export default class TextInputField<T = string> extends ControlField<T, string, TextInputFieldProps<T>, TextInputFieldState<T>> {
textInputRef: React.RefObject<NativeTextInput>;
get isCustom(): boolean;
focus(): void;
blur(): void;
renderCustom(): JSX.Element;
}
export {};