/** * Returns a state that changes only if the next value pass its validator */ declare const useValidatedState: >(validator: TValidator, initialValue?: TValue | undefined) => [TValue, (nextValue: TValue) => void, ValidationResult]; export type Validator = (value: TValue) => boolean; export interface ValidationResult { changed: boolean; valid?: boolean; } export default useValidatedState;