/** * The options for the `useKeyFilter` hook. */ export interface UseKeyFilterOptions { /** * Sets the pattern for key filtering. * @default /./ */ pattern?: 'pint' | 'int' | 'pnum' | 'money' | 'num' | 'hex' | 'email' | 'alpha' | 'alphanum' | RegExp; /** * When enabled, instead of blocking keys, input is validated internally to test against the regular expression. * @default false */ validateOnly?: boolean; } export interface UseKeyFilterExposes { /** * Handles input events for key filter. * Processes character input and composition events while applying the filter pattern. * @param event - The form or composition event from the input element */ onBeforeInput: (event: React.CompositionEvent) => void; /** * Handles keypress events for character input validation. * Validates and places characters according to the filter pattern. * @param event - The keyboard event from the input element */ onKeyPress: (event: React.KeyboardEvent) => void; /** * Handles paste events for clipboard content insertion. * Processes pasted content according to the mask pattern. * @param event - The clipboard event from the input element */ onPaste: (event: React.ClipboardEvent) => void; /** * Validates the current input value against the filter pattern. * @param event - The form event from the input element * @returns true if the value matches the pattern, false otherwise */ validate: (event: React.FormEvent) => boolean; } export declare function useKeyFilter(options: UseKeyFilterOptions): UseKeyFilterExposes;