import { GlobalCfgRenderCtx } from "../../render/internal.js"; import { ColumnFieldStatus, ColumnResolutionStatus } from "./types.js"; import "../data_column.js"; import { Column } from "../column.js"; import { ColumnRecipe } from "./index.js"; import { ColumnOverriddenId, ColumnOverriddenKey, ColumnUniversalId, PColumnSpec, PObjectId, SpecOverrides, SpecQuery } from "@milaboratories/pl-model-common"; /** * A recipe whose id is not an Overridden wrap — valid `source` for Overridden. * Mirrors the spec-level invariant on {@link ColumnOverriddenKey.source}. */ type NonOverriddenColumn = Column>; /** * Recipe wrapper that overlays {@link SpecOverrides} on top of any other * recipe. The id is `ColumnOverriddenKey { source: inner.id, specOverrides }`. * * Flat-merge invariant: `inner` is never another {@link ColumnOverriddenRecipe}. * Repeated overrides go through {@link wrap} / {@link withSpecs}, which merge * `specOverrides` at the current level and keep wrapper depth constant. * * This invariant matches the one enforced inside `unwrapOverrides` from * pl-model-common: it explicitly throws on a nested override-wrap. */ export declare class ColumnOverriddenRecipe implements ColumnRecipe { private readonly inner; private readonly overrides; /** * Wrap any recipe with overrides. If `inner` is already a * {@link ColumnOverriddenRecipe}, merges `overrides` into the existing ones * and returns a new Overridden sharing the original `inner`. No * `Overridden>` is produced. */ static wrap(col: Column, overrides: SpecOverrides): ColumnOverriddenRecipe; /** * Pick the variant from the inner recipe: data-bearing inner → * {@link DataColumnOverriddenRecipe}, otherwise the plain wrapper. * * The choice is **structural**, not a readiness check — it follows from * which kind of recipe `inner` is, which in turn follows from the id alone * (a bare `PObjectId` source is a leaf, anything else is not). So the same * id always yields the same class, whether it was built via `withSpecs` or * parsed from a string, and recipes stay value-objects that are equal iff * their ids match. * * Re-deriving from `inner` on every build is also what keeps the merge path * honest: `overridden.withSpecs(a).withSpecs(b)` cannot silently drop the * data-bearing variant. * * Discriminated by method presence rather than `instanceof DataColumnImpl` * to keep this module free of a runtime import cycle with `../data_column`. * By the flat-merge invariant `inner` is never an Overridden, so the only * recipe kind reaching here that carries `getData` is the leaf. */ private static build; /** * Static counterpart to {@link wrap}: returns the resolution status of a * {@link ColumnOverriddenKey} without constructing the recipe. Overrides * do not add references — status collapses to the source's status. */ static getStatusByKey(key: ColumnOverriddenKey, opts?: { ctx?: GlobalCfgRenderCtx; }): ColumnResolutionStatus; readonly id: ColumnOverriddenId; private specCache?; private queryCache?; private dataStatusCache?; protected constructor(inner: NonOverriddenColumn, overrides: SpecOverrides); /** Wrapped recipe — exposed so external walkers can descend. */ getInner(): Column; /** * `inner` owns all references; overrides are a pure spec patch and do not * introduce new column refs. */ getReferencedIds(): PObjectId[]; getDataStatus(): ColumnFieldStatus; /** * Take the inner spec and overlay our overrides. `applySpecOverrides` * extracts the overrides from `this.id` itself. */ getSpec(): PColumnSpec; /** * Emit a client-side `specOverride` node wrapping the inner query. * * This is a structural-but-collapsible node: it carries the override * patch through the query tree so consumers see the full recipe shape, * but it is collapsed at the host boundary (`resolvePColumn`) before * the query reaches pframe-engine. The engine never sees this node. * * Overrides do not change query topology — they are a pure spec patch. */ getQuery(): SpecQuery; /** * Flat merge: new overrides merge with existing ones; `inner` is unchanged. * The result is an Overridden of the same depth. */ withSpecs(overrides: SpecOverrides): Column; } export {}; //# sourceMappingURL=column_overrided_recipe.d.ts.map