@julo-ui/otp-input
Version:
React Input Component for entering sequences of digits
21 lines (18 loc) • 710 B
TypeScript
import * as react from 'react';
import { DescendantsManager } from '@chakra-ui/descendant';
interface UseHandleValuesOptions {
onChange: (value: string) => void;
defaultValue?: string;
value?: string;
descendants: DescendantsManager<HTMLInputElement>;
onComplete: (value: string) => void;
onFocusNext: (index: number) => void;
}
declare function useHandleValues(options: UseHandleValuesOptions): {
values: string[];
setValues: react.Dispatch<react.SetStateAction<string[]>>;
setValue: (value: string, index: number, handleFocus?: boolean) => void;
clearValue: () => void;
getNextValue: (value: string, eventValue: string) => string;
};
export { useHandleValues };