import { GlobalCfgRenderCtx } from "../../render/internal.js"; import { ColumnFieldStatus, ColumnResolutionStatus } from "./types.js"; import { ColumnRecipe } from "./index.js"; import { AxisQualification, ColumnDiscoveredId, ColumnDiscoveredKey, ColumnUniversalId, PColumnSpec, PObjectId, SpecOverrides, SpecQuery } from "@milaboratories/pl-model-common"; /** * Recipe for columns identified by a {@link ColumnDiscoveredKey}: a base * column + a `path` of linkers + qualifications. * * Specifics: * - References more than one column (`column` + each `path[i].column`); * {@link getDataStatus} aggregates across the whole set. * - {@link getQuery} assembles the {@link SpecQuery} locally * ({@link buildSpecQuery}) — the hit is inlined as its own recipe's query * tree, linkers fold inside-out into nested `linkerJoin` nodes. * - {@link getSpec} passes through to the hit column's own spec: the linker * chain only enables co-indexing and does not remap the hit's `axesSpec`, so * no engine round-trip is needed (mirrors the Discovered branch of * `reconstructSpecFromId` on the host side). */ export declare class ColumnDiscoveredRecipe implements ColumnRecipe { private readonly key; private readonly columns; /** * Validate the key + resolve every referenced column via * {@link DataColumnRecipe.fromId} (which itself checks the leaf accessor reports * `hasData()`). Returns `undefined` if the key is malformed or any * referenced column is not yet spec-resolvable. * * Spec JSON is deserialized lazily on first {@link getSpec}/{@link getQuery}. */ static fromKey(key: ColumnDiscoveredKey, opts?: { ctx?: GlobalCfgRenderCtx; }): undefined | ColumnDiscoveredRecipe; /** * Static counterpart to {@link fromKey}: returns the resolution status of * a {@link ColumnDiscoveredKey} without constructing the recipe. Worst-wins * across every referenced {@link ColumnUniversalId} (hit + path linkers), * each resolved via the top-level {@link ColumnRecipe.getStatus} dispatcher. */ static getStatusByKey(key: ColumnDiscoveredKey, opts?: { ctx?: GlobalCfgRenderCtx; }): ColumnResolutionStatus; readonly id: ColumnDiscoveredId; private specCache?; private queryCache?; private dataStatusCache?; private constructor(); /** * Universal id of the hit column (excluding path/qualifications on top). * May itself be a wrapped id (Overridden / Filtered / nested Discovered) — * preserves projections applied to the underlying column. */ getHitId(): ColumnUniversalId; /** * Axis qualifications attached to the hit column itself — applied to the * outer-join entry that wraps this column at the consumer boundary. */ getColumnQualifications(): readonly AxisQualification[]; /** * Per-primary-column qualifications applied to the primary anchors on * this group's side. Keyed by the external primary column id. */ getQueriesQualifications(): Readonly>; /** * Leaf {@link PObjectId}s the recipe physically depends on: hit column + * each linker in `path`, with any projection wrappers unwrapped down to * their underlying storage column. Used to track real-data dependencies * (e.g. {@link getDataStatus}), not projected identities. */ getReferencedIds(): PObjectId[]; /** * Final spec of a discovered hit is just the hit column's own spec: the * linker chain only enables co-indexing, it does not remap the hit's * `axesSpec`, and axis qualifications live on the outer join entry (see * {@link buildSpecQuery}), not in the spec. So pass through to the hit * recipe's `getSpec()` — no engine round-trip needed. This mirrors the * Discovered branch of `reconstructSpecFromId` on the host side. */ getSpec(): PColumnSpec; /** IR for building the final spec — see {@link buildSpecQuery}. */ getQuery(): SpecQuery; getDataStatus(): ColumnFieldStatus; /** * Discovered + overrides → Overridden. Delegates to the * flat-merge factory of ColumnOverriddenRecipe; subsequent `withSpecs` * calls merge at the Overridden level (one wrapper, no nesting). */ withSpecs(overrides: SpecOverrides): ColumnRecipe; /** * Assembles the SpecQuery for this discovered hit by folding `key.path` * around the hit column. * * The hit (innermost) is built by inlining `columns[key.column].getQuery()` * — recursing into the hit's own recipe — so wrapping layers on the hit * (Overridden / Filtered / nested Discovered) appear in the produced tree. * The previous `pframeSpec.buildQuery` path was a flat * {@link PObjectId}-only call and could not express that. * * Linkers stay as plain column references on the linker side of * `linkerJoin` (the spec node has no slot for a query-side linker); the * linker's recipe id is used directly. The frame registered in * {@link getSpec} carries each recipe's final spec under that same id, so * the engine resolves linker axes from the post-projection spec. * * Path ordering matches {@link ColumnDiscoveredKey.path}: `path[0]` is * outermost, `path[N-1]` is closest to the hit. We fold from the inside * out — innermost wrap first — so the result lines up with that convention. * * `columnQualifications` / `queriesQualifications` are not emitted here — * qualifications live on a {@link SpecQueryJoinEntry} wrapper (lost on * unwrapping to {@link SpecQuery}). External consumers apply them at the * outer join via {@link getColumnQualifications} / {@link getQueriesQualifications}. */ private buildSpecQuery; } //# sourceMappingURL=column_discovered_recipe.d.ts.map