/** 유효성 규칙: 유효하면 true, 아니면 에러 메시지 문자열 반환 (sd types/form Rule 포팅) */ export type Rule = (value: unknown) => true | string; /** rules를 순서대로 실행해 첫 실패 메시지를 반환. 모두 통과하면 "" */ export declare function runRules(value: unknown, rules?: Rule[]): string; /** SForm에 등록되는 필드 항목 */ export interface FormFieldEntry { /** 폼 연동용 name (validationError names·focus 대상 식별) */ name: string; /** 현재 값에 rules를 실행하고 에러 상태를 반영한 뒤 valid 여부 반환 */ validate: () => boolean; /** 검증 에러 상태만 초기화 (값은 소비자 소유) */ resetValidation: () => void; } export interface FormContextValue { /** 필드를 등록하고 해제 함수를 반환 */ register: (entry: FormFieldEntry) => () => void; } export declare const FormContext: import("react").Context; /** 가장 가까운 SForm의 context (없으면 null) */ export declare function useFormContext(): FormContextValue | null; /** * 폼 필드 등록 훅. SForm 내부이면 등록되고, 밖이면 no-op. * validate/resetValidation은 항상 최신 클로저를 참조하도록 ref로 래핑한다. */ export declare function useFormField(field: { name?: string; validate: () => boolean; resetValidation: () => void; }): void;