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
|
Rev | Line | |
---|
[d565449] | 1 | import { Dispatch, SetStateAction } from 'react';
|
---|
| 2 | export declare type ValidityState = [boolean | undefined, ...any[]] | [undefined];
|
---|
| 3 | export interface StateValidator<V, S> {
|
---|
| 4 | (state: S): V;
|
---|
| 5 | (state: S, dispatch: Dispatch<SetStateAction<V>>): void;
|
---|
| 6 | }
|
---|
| 7 | export declare type UseStateValidatorReturn<V> = [V, () => void];
|
---|
| 8 | export 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.