import { d as CodeGen, e as CompileMode, K as KeywordDefinition, f as KeywordCompileContext } from './runtime-BXoST4J7.cjs'; export { g as CodeEmitter, b as CompiledRegex, h as CreateDepsOptions, N as NameGenerator, P as PathSegmentLike, i as RawExpression, a as RegexCompiler, S as SchemaRegistry, j as Scope, V as ValidatorDeps, k as booleanLiteral, l as collectDynamicAnchors, m as createDeps, n as deepEqual, o as nonNegativeIntegerLiteral, p as numberLiteral, q as pathJoinExpr, r as positiveNumberLiteral, s as quoteString, t as rawExpr, u as typeOf, w as wrapErrors } from './runtime-BXoST4J7.cjs'; import { i as SchemaObject, S as SchemaOrBoolean } from './types-Dzi0PpYX.cjs'; export { S as SUBSCHEMA_ARRAY_POSITIONS, a as SUBSCHEMA_MAP_POSITIONS, b as SUBSCHEMA_SINGLE_POSITIONS } from './subschema-positions-DVmZKEu5.cjs'; import './errors-BahYESV_.cjs'; /** * Well-known identifier names used inside generated validator source so that * keyword authors and the compiler speak the same language. * * @public */ declare const NAMES: { /** Root data reference, passed into the outermost validator. */ readonly ROOT_DATA: "rootData"; /** The data value currently under validation in a given scope. */ readonly DATA: "data"; /** The path array carrying the data location being validated. */ readonly PATH: "path"; /** The errors accumulator for the current schema scope. */ readonly ERRORS: "errors"; /** The runtime dependencies injected into the compiled validator. */ readonly DEPS: "deps"; /** The map of sibling/child compiled validators. */ readonly REFS: "refs"; /** Pre-compiled regular expressions referenced by `pattern` / `patternProperties`. */ readonly PATTERNS: "patterns"; /** Format validators registered at compile time. */ readonly FORMATS: "formats"; /** * Extra function parameter: an optional `Set` that, when * supplied, receives the keys the function evaluated. Used to * propagate `unevaluatedProperties` tracking across composition * (`allOf` / `anyOf` / `oneOf` / `$ref` / `if-then-else`). * `undefined` means the caller doesn't need this information. */ readonly OUT_EVAL_PROPS: "outEvalProps"; /** Same as {@link NAMES.OUT_EVAL_PROPS} but for array indices. */ readonly OUT_EVAL_ITEMS: "outEvalItems"; }; /** * Inputs accepted by {@link createKeywordContext}. The compiler assembles * these from its own state; keyword authors never construct them directly. * * @public */ interface KeywordContextInputs { gen: CodeGen; schema: unknown; parentSchema: SchemaObject; data: string; path: string; errors: string; /** * Extra path segments that the inliner has accumulated without * materializing them into `path`. See * {@link KeywordCompileContext.pathSegments}. Defaults to empty. */ pathSegments?: readonly string[]; compileSubschema: (schema: SchemaOrBoolean, mode?: CompileMode) => string; resolveRef: (ref: string) => string; /** * Whether a `$ref` is a recursion back-edge (its target is still on * the compile stack). Defaults to always-`false` when omitted. Used by * the `$ref` keyword to decide whether to emit the `maxDepth` guard. */ isRecursiveRef?: (ref: string) => boolean; evaluatedPropertiesVar?: string | null; evaluatedItemsVar?: string | null; /** * When `true`, a finite `maxErrors` was configured and push / loop * sites should emit the extra budget checks. When `false`, emit plain * `errors.push(x)` / unchecked loops; zero runtime overhead. */ gated?: boolean; /** * When `true`, a finite `maxDepth` was configured and the `$ref` * keyword should emit the recursion-depth guard at back-edges. When * `false` (the default), refs compile to a plain call. */ depthGated?: boolean; /** * When `true`, predicate mode is active: the generated function * returns `boolean`, not `ValidationError | null`. Every * error-emission site collapses to `return false;` and the * error-expression argument is discarded. */ predicate?: boolean; /** * When `true`, flat-collection mode is active: each generated function * returns a flat `ValidationError[]` of leaves (no branch wrappers) * instead of a single tree node. Lift sites append the callee's list * onto the accumulator (`deps.appendErrors`) rather than pushing one * node, and the inline-wrap step is suppressed. Mutually exclusive * with {@link KeywordContextInputs.predicate}. */ flat?: boolean; /** * Whether the compile unit uses `unevaluated*` (functions thread * evaluated-key out-params). Defaults to `false`. Gates the * predicate-decision optimization in composition keywords. See * {@link KeywordCompileContext.unevaluatedTracking}. */ unevaluatedTracking?: boolean; /** * The compiler's full keyword registry. Used by * {@link KeywordCompileContext.validateSubschema} to inline a * subschema's single keyword directly instead of compiling it to a * fresh function. Optional: when omitted, subschema emission always * takes the function-call path. */ byKeyword?: ReadonlyMap; /** * Depth counter for recursive multi-keyword inlining. Callers never * set this directly; the context threads it through * {@link KeywordCompileContext.validateSubschema} so deeply-nested * inline chains eventually fall back to the function-call path * rather than blowing up the compiled source. */ inlineDepth?: number; /** * Callback for hoisting a schema-derived constant out of the * validator body to the module-level prelude. See * {@link KeywordCompileContext.hoistConstant}. */ hoistConstant?: (expr: string, prefix?: string) => string; /** * Per-function-body memo backing * {@link KeywordCompileContext.scopeLocal}. The compiler creates one * map per validator function and threads the same instance into every * keyword context for that function, so keywords sharing a key reuse a * single emitted `const`. Omitted in inline contexts, where each * keyword emits its own local (no cross-keyword sharing needed). */ scopeLocals?: Map; } declare function createKeywordContext(inputs: KeywordContextInputs): KeywordCompileContext; export { CodeGen, type KeywordContextInputs, NAMES, createKeywordContext };