From 43b445c10b41b4c413eacf3ac9ace21360779c9b Mon Sep 17 00:00:00 2001 From: maofeng Date: Thu, 19 Jun 2025 22:39:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=B7=A5=E5=85=B7=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/types.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/core/types.ts 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>;