import type { ComponentDef, Schema } from '@ecsia/schema'; /** One bound column the compiled loop reads/writes: which field of which component, and its column index. */ export interface EachViewSpec { readonly def: ComponentDef; readonly field: string; /** Column index within the component's ColumnSet (ctor-backed fields only — the bindColumns rule). */ readonly colIndex: number; } export interface EachPlan { /** Views in binding order; `views[k]` in the generated source is this spec's column. */ readonly specs: readonly EachViewSpec[]; /** Component ids the body writes (each gets a gated per-row trackWrite). */ readonly writtenIds: readonly number[]; /** * The generated factory source: `(args) => { ...; return (ctx) => { ...loop... } }`. `args` carries * `{ views, rows, trackWrite, tracking, handleIndex, meta }`. Recompiled per archetype by the caller * (via the shared codegen path) so each runner is a specialized V8 singleton. */ readonly factorySource: string; } /** Lookups the analyzer needs from the query/world, kept injectable so the module imports no core internals. */ export interface EachAnalyzeDeps { /** Component the query exposes under `e.` (its value term), or undefined if not a value term. */ defByName(name: string): ComponentDef | undefined; /** Registered component id, or undefined if unregistered. */ idOf(def: ComponentDef): number | undefined; /** True iff the component is REQUIRED by the query (present in every matching archetype). */ isRequired(def: ComponentDef): boolean; } /** * Analyze an `.each` body. Returns a compile plan, or null to signal "run the proxy `.each` unchanged". * Pure and side-effect-free (it reads `.toString()` and the schema only), so it is trivially testable. */ export declare function analyzeEachBody(body: (...args: never[]) => unknown, deps: EachAnalyzeDeps): EachPlan | null; //# sourceMappingURL=compile-each.d.ts.map