UNPKG

@mitcsutt/kiln-forms

Version:

Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui

13 lines (12 loc) • 710 B
import type { UntypedCondition } from './types.js'; /** * Evaluates a JSON condition against form values (root paths) and the render context. * Pure: no React, no form instance. `all: []` is true, `any: []` is false. * * @privateRemarks Design reference §10.3. */ export declare function evaluateCondition(c: UntypedCondition, values: unknown, context?: Record<string, unknown>): boolean; /** The value paths a condition reads, de-duplicated in first-seen order (context keys excluded). */ export declare function conditionDeps(c: UntypedCondition): readonly string[]; /** True when the condition reads the render `context` anywhere. */ export declare function usesContext(c: UntypedCondition): boolean;