import { SchemaIR } from "../types.js"; import { CodeGenContext, FastGen, FastScope } from "./context.js"; //#region src/core/codegen/fast-path.d.ts /** * @param inputExpr the input expression this node validates * @param ctx shared codegen context * @param extractable whether THIS node may be hoisted (false for the root and a * helper's own top node — see generateFast); children are always extractable * @param scope size accumulator for the function being assembled (a child * visit shares the parent's scope; a hoisted helper body gets a fresh one) * @param discSkipKey discriminated-union option marker (see FastGen.discSkipKey); * carried only on the option's own node, never auto-propagated to children * @param acceptance emit an acceptance predicate instead of a by-reference one * (see FastGen.acceptance); inherited by children and hosted helpers */ declare function createFastGen(inputExpr: string, ctx: CodeGenContext, extractable?: boolean, scope?: FastScope, discSkipKey?: string, acceptance?: boolean): FastGen; /** * Generate a boolean expression string that validates input against the schema. * Returns `null` if the schema (or any nested part) is not eligible for fast checking. * * Size-gated extraction: when inlining `ir` would push the function being * assembled past EXTRACT_CAP, it is hoisted into its own boolean helper * `function __fo_N(p){return ;}` and replaced by a call. This keeps * every emitted function under V8's TurboFan optimization budget — a single * giant fast-check otherwise drops to the slower Maglev tier (measured ~3-4.5x * on deeply-nested schemas). The running total `g.scope.used` is EXACT emitted * chars (the returned string's length); only the extract look-ahead is an * estimate, scaled for access-path length. Small schemas never approach the * cap, so their output is byte-identical to the fully-inlined form; large * aggregates do split (still semantically identical — only the boolean's shape * changes). */ declare function generateFast(ir: SchemaIR, g: FastGen): string | null; //#endregion export { createFastGen, generateFast }; //# sourceMappingURL=fast-path.d.ts.map