source: imaps-frontend/node_modules/react-use/esm/useStateValidator.d.ts@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 481 bytes
RevLine 
[d565449]1import { Dispatch, SetStateAction } from 'react';
2export declare type ValidityState = [boolean | undefined, ...any[]] | [undefined];
3export interface StateValidator<V, S> {
4 (state: S): V;
5 (state: S, dispatch: Dispatch<SetStateAction<V>>): void;
6}
7export declare type UseStateValidatorReturn<V> = [V, () => void];
8export default function useStateValidator<V extends ValidityState, S>(state: S, validator: StateValidator<V, S>, initialState?: V): UseStateValidatorReturn<V>;
Note: See TracBrowser for help on using the repository browser.