/** * storeSurface.ts * * Forma - store 수준 훅 표면(hook surface) 캐시 * Per-store cached hook surfaces shared by useFormaState / useForm * * store 하나당 한 번만 생성되는 안정(stable) 메서드 묶음을 제공하여, * 렌더마다 useCallback 래퍼 ~13개 + 대형 반환 리터럴을 만들던 비용을 제거한다. * useValue/useFormValue 같은 훅 위임도 순수 위임(`(path) => useFieldValue(store, path)`)이라 * store 수준 함수로 캐시할 수 있다. (React 를 런타임 import 하지 않아 node:test 로 직접 검증 가능) * * @license MIT License * @copyright 2025 KIM YOUNG JIN (Kim Young Jin) * @author KIM YOUNG JIN (ehfuse@gmail.com) */ import type { FieldStore } from "../core/FieldStore"; import type { UseFormaStateReturn } from "./useFormaState"; import type { UseFormReturn } from "../types/form"; /** * 개별 필드 구독 훅 시그니처 (React 훅 — 표면 생성 시 주입받아 사용) * Field-subscription hook signature (a React hook, injected at surface creation) */ export type FieldValueHook = (store: FieldStore, path: string) => any; /** * useFormaState 반환값 중 store 수준에서 안정적으로 캐시 가능한 부분 * The store-level (identity-stable) portion of UseFormaStateReturn */ export type StateSurface> = Omit, "actions" | "clearPersisted" | "hasPersisted">; /** * useForm 반환값 중 store 수준에서 안정적으로 캐시 가능한 부분 * The store-level (identity-stable) portion of UseFormReturn */ export type FormSurface> = Pick, "useValue" | "useFormValue" | "getFormValue" | "getFormValues" | "setFormValue" | "setFormValues" | "setInitialFormValues" | "handleFormChange" | "handleDatePickerChange" | "_store">; /** * store 수준 useFormaState 훅 표면을 반환한다 (store 당 1회 생성 후 재사용, 식별자 안정) * Return the store-level useFormaState hook surface (created once per store, identity-stable) */ export declare function getStateSurface>(store: FieldStore, useFieldValueHook: FieldValueHook): StateSurface; /** * store 수준 useForm 훅 표면을 반환한다 (store 당 1회 생성 후 재사용, 식별자 안정) * Return the store-level useForm hook surface (created once per store, identity-stable) */ export declare function getFormSurface>(store: FieldStore, useFieldValueHook: FieldValueHook): FormSurface; //# sourceMappingURL=storeSurface.d.ts.map