import type { $ZodType } from 'zod/v4/core'; import type { SchemaLiteCollector } from './types.js'; /** * Container types that render children rather than validating themselves. * Used to detect nested container effects for fallthrough collection. * Matches the set excluded from L1 in l1-decompose.ts. */ export declare const CONTAINER_TYPES: Set; /** * Detect top-level refines/transforms/superRefines on the schema. * * In Zod v4, `z.object({}).superRefine(fn)` creates a new object schema * with the same def.type="object" but with additional checks in def.checks. * The parent chain points to the original (check-free) schema. * * We detect top-level effects by checking if the schema has checks that * differ from its parent, indicating superRefine/refine was applied. */ export declare function hasTopLevelEffects(schema: $ZodType): boolean; /** * Detect if a schema is a pipe whose input is a container type. * e.g. z.object({...}).transform(fn) produces a pipe where def.in is an object. */ export declare function isPipeWrappedContainer(schema: $ZodType): boolean; /** * Collect effects (checks/transforms) from a container schema into a collector. * * The walker calls this when it detects a container with effects, BEFORE * processing the container's children. Children are then processed with * this collector (via swapped optimizerCtx), so nested containers with * effects recursively create their own child collectors and add their * built results as fields. The collector's build() produces the final * pruned schema — an inside-out construction. * * Handles two forms: * - Direct container (superRefine/refine): extracts extra checks * - Pipe-wrapped container (transform ± checks): extracts inner checks, * transform function, and pipe-level checks */ export declare function collectContainerEffects(schema: $ZodType, collector: SchemaLiteCollector): void; /** * Create a new SchemaLiteCollector instance. * * Builds a "lite" schema for submit-time validation: * - Checks (superRefine/refine): z.object({}).loose().check(c1).check(c2) * - Transforms: z.object({}).loose().check(...).transform(fn) * - Non-decomposable pipes: original schema as-is * * @param options - Optional configuration for the collector base type. * @returns A fresh `SchemaLiteCollector` ready to accumulate checks, transforms, and fallthrough fields. * * @category Optimization */ export declare function createSchemaLiteCollector(options?: { /** Use z.any() instead of z.object({}).loose() when no fields are present. * Set for non-object containers (arrays, tuples, etc.) whose data isn't an object. */ useAnyBase?: boolean; }): SchemaLiteCollector; //# sourceMappingURL=schema-lite.d.ts.map