UNPKG

react-native-advanced-input-mask

Version:

Text input mask for React Native on iOS, Android and web. Synchronous and easy formatting without hustle

57 lines (50 loc) 1.51 kB
import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent"; import type { HostComponent } from "react-native"; import type { ViewProps } from "react-native/Libraries/Components/View/ViewPropTypes"; import type { DirectEventHandler, Int32, } from "react-native/Libraries/Types/CodegenTypes"; export type OnAdvancedMaskTextChange = Readonly<{ extracted: string; formatted: string; tailPlaceholder: string; }>; type CustomTransformation = { transformationChar: string; transformationString: string; }; type Notation = { /** * A symbol in format string. */ character: string; /** * An associated character set of acceptable input characters. */ characterSet: string; /** * Is it an optional symbol or mandatory? */ isOptional: boolean; }; export interface NativeProps extends ViewProps { affinityCalculationStrategy?: Int32; affinityFormat?: ReadonlyArray<string>; allowSuggestions?: boolean; autocomplete?: boolean; autocompleteOnFocus?: boolean; autoSkip?: boolean; customNotations?: ReadonlyArray<Notation>; customTransformation?: Readonly<CustomTransformation>; allowedKeys?: string; defaultValue?: string; isRTL?: boolean; onAdvancedMaskTextChange?: DirectEventHandler<OnAdvancedMaskTextChange>; primaryMaskFormat: string; value?: string; validationRegex?: string; } export default codegenNativeComponent<NativeProps>( "AdvancedTextInputMaskDecoratorView", ) as HostComponent<NativeProps>;