UNPKG

@awsui/components-react

Version:

AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A

24 lines (23 loc) 930 B
import { RefObject } from 'react'; import { InputProps } from '../../../input'; import { NonCancelableEventHandler, CancelableEventHandler } from '../../events'; import MaskFormat from './utils/mask-format'; interface UseMaskHook { value: string; onChange: NonCancelableEventHandler<InputProps.ChangeDetail>; onKeyDown: CancelableEventHandler<InputProps.KeyDetail>; onBlur: NonCancelableEventHandler<null>; onPaste: (event: ClipboardEvent) => void; } interface UseMaskProps { value: string; onChange: (value: string) => void; onKeyDown?: (event: CustomEvent) => void; onBlur?: () => void; format: MaskFormat; autofix?: boolean; inputRef: RefObject<HTMLInputElement>; disableAutocompleteOnBlur?: boolean; } declare const useMask: ({ value, onBlur, onChange, onKeyDown, format, inputRef, autofix, disableAutocompleteOnBlur }: UseMaskProps) => UseMaskHook; export default useMask;