import { StateDispatch } from '../types'; type UseValidatedStateReturn = [state: T, error: E | null, setState: StateDispatch]; /** A `setState` wrapper that performs some validation on any new state values * @param intialState - The initial state value to store * @param validator - a validator function to check any new state values against before updating. * The validator is expected to return either nothing, or a value of type `E`. If nothing is returned * the value is assumed to valid and will be updated. If a value is returned, it will be set as the error value * @returns an array of: * - The state value * - The current error value (defaults to null) * - state setter function */ export declare function useValidatedState(intialState: T, validator: (newState: T) => void | E): UseValidatedStateReturn; export {};