import { Dispatch, SetStateAction } from 'react'; export declare type ValidityState = [boolean | undefined, ...any[]] | [undefined]; export interface StateValidator { (state: S): V; (state: S, dispatch: Dispatch>): void; } export declare type UseStateValidatorReturn = [V, () => void]; export default function useStateValidator(state: S, validator: StateValidator, initialState?: V): UseStateValidatorReturn;