UNPKG

@react-bunker/input-mask

Version:

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

16 lines (15 loc) 715 B
import { FormEventHandler } from 'react'; import { masks } from '../helpers/pre-assembled-masks'; import { Mask, HTMLInput } from '../types'; export declare function useMask(prop?: Mask | ((mask: typeof masks) => Mask)): { ref: import('react').RefObject<HTMLInput | null>; bindInputEvent: (oninput?: FormEventHandler<HTMLInputElement>) => (evt: import('react').FormEvent<HTMLInput>) => import('react').FormEvent<HTMLInput>; input: () => { unmasked: string | undefined; masked: string | undefined; }; props: { ref: import('react').RefObject<HTMLInput | null>; onInput: (evt: import('react').FormEvent<HTMLInput>) => import('react').FormEvent<HTMLInput>; }; };