import type { Carte } from "./carte.js"; import type { UIAdapter } from "./ui-adapter.js"; export interface PlanValidationError { /** Index of the panel where the error occurred, or -1 for plan-level errors. */ panel: number; /** Dotted path within the panel/plan. */ path: string; message: string; } export type PlanValidationResult = { valid: true; errors: []; } | { valid: false; errors: PlanValidationError[]; }; declare const validatedPlanBrand: unique symbol; export type ValidatedPlan = import("./plan.js").Plan & { readonly [validatedPlanBrand]: true; }; export type ParsePlanResult = { ok: true; plan: ValidatedPlan; } | { ok: false; errors: PlanValidationError[]; }; /** * Validates a plan against a carte and a UI adapter: * 1. Plan shape (layout + panels) parses * 2. Every `query.id` exists and `ctx` passes its `access` predicate * 3. Every `query.params` validates against the entry's `params` schema * 4. Every `component.id` exists in the UI adapter * 5. Every prop is either a literal matching its schema, or a `{ $bind }` ref * whose target exists in the entry's `returns` shape (or its array element). * `$bind` on a non-bindable prop produces a friendly error rather than a * raw Zod union mismatch. * 6. Required props are present */ export declare function parsePlan(plan: unknown, carte: Carte, uiAdapter: UIAdapter, ctx: TCtx): ParsePlanResult; export declare function validatePlan(plan: unknown, carte: Carte, uiAdapter: UIAdapter, ctx: TCtx): PlanValidationResult; export {}; //# sourceMappingURL=validate.d.ts.map