import React, { type KeyboardEvent } from 'react'; import './MaskedInput.scss'; declare const SELECTION_DIRECTION: { readonly FORWARD: "forward"; readonly BACKWARD: "backward"; readonly NONE: "none"; }; export type SelectionSegment = { selectionStart: number; selectionEnd: number; selectionDirection?: (typeof SELECTION_DIRECTION)[keyof typeof SELECTION_DIRECTION]; }; type MaskedInputProps = { /** An extra class name to add to the component */ className?: string; /** The regex pattern this masked input must match */ pattern: string; /** Input placeholder */ placeholder?: string; /** The current value to display */ value: string; /** One or more examples of valid values. Used when deciding if next keystroke is valid (as rest of the current value may be incomplete) */ example: string | string[]; /** The current selection to use for the input */ selection?: SelectionSegment; /** Called when the value changes. Note the value may still be incomplete. */ onChange?: (value: string) => void; /** Called when selection changes */ onSelect?: (segment: SelectionSegment) => void; /** Called when enter is pressed */ onSubmit?: (event: KeyboardEvent) => void; /** Retrieve the next value for a provided segment */ getNextSegmentValue?: (segment: SelectionSegment, delta: number, segmentValue: string, value: string) => string; getPreferredReplacementString?: (value: string, replaceIndex: number, replaceChar: string, selectionStart: number, selectionEnd: number) => string; /** Normalize pasted text before validation. Defaults to returning text unchanged. */ normalizePastedText?: (text: string) => string; onFocus?: React.FocusEventHandler; onBlur?: React.FocusEventHandler; 'data-testid'?: string; }; /** * A masked input for entering data from a template. * Won't work by itself, must use within another component and handle updating the value/selection. */ declare const MaskedInput: React.ForwardRefExoticComponent>; export default MaskedInput; //# sourceMappingURL=MaskedInput.d.ts.map