diff --git a/src/core/types.ts b/src/core/types.ts new file mode 100644 index 0000000..de3ff00 --- /dev/null +++ b/src/core/types.ts @@ -0,0 +1,14 @@ +import { Dispatch, SetStateAction } from "react"; + +export type ValueGetter = () => T; +export type ValueSetter = (value: T) => void; + +export type AsyncGetter = () => Promise; +export type AsyncSetter = (value: T) => Promise; + +export type Validator = (value: T) => boolean; +export type AsyncValidator = (value: T) => Promise; + +export type Transformer = (value: T) => R; + +export type SetState = Dispatch>;