import { GlobalCfgRenderCtx } from "../render/internal.js"; import { ColumnRecipe } from "./column_recipes/index.js"; import { ColumnsSource } from "./column_providers/types.js"; import "./column_providers/index.js"; import { CollectionHandle, ColumnUniversalId, ColumnsCollectionDriverModel, ColumnsDiscoverOptions, ColumnsFilterOptions, DiscoverRootsOptions } from "@milaboratories/pl-model-common"; export interface ColumnsCollectionDeps { /** Render ctx used both for service resolution and for default ctx sources. */ readonly ctx?: GlobalCfgRenderCtx; /** Override the resolved `columnsCollection` service — primarily for tests. */ readonly driver?: ColumnsCollectionDriverModel; } /** * Shorthand literals accepted inside `ColumnsCollection`'s `sources` * array, expanded against the active render ctx: * * - `"result_pool"` – fan-out into the host's upstream-block result pool. * - `"current_block"` – main outputs + prerun (staging) accessors of the * current block, when present. */ export type ColumnsSourceShorthand = "result_pool" | "current_block"; /** * Build a {@link ColumnsCollection} from sandbox-side source descriptors. * Resolves the `columnsCollection` driver (either from `deps.driver` or via * `getService("columnsCollection")`) and asks the host to mint a fresh * handle covering the supplied sources. Pass `sources === undefined` to * fall back to the active render ctx (main outputs + prerun + result pool). * * `sources` accepts {@link ColumnsSourceShorthand} string literals * (`"result_pool"`, `"current_block"`) for the common ctx-derived sources. */ export declare function ColumnsCollection(sources?: (ColumnsCollection | ColumnsSource | ColumnsSourceShorthand)[], deps?: ColumnsCollectionDeps): ColumnsCollection; export declare function isColumnsCollection(value: unknown): value is ColumnsCollection; /** * A root found by {@link ColumnsCollectionImpl.discoverRoots}: `leaf` is the * requested column exactly as `discover({ anchors: { r: root } })` would * return it — carrying the linker `path` and qualifications — so the table is * built from `root` as the anchor plus `leaf`. */ export interface DiscoveredRoot { /** The column the leaf hangs off. */ readonly root: ColumnRecipe; /** The requested column, discovered from the root. */ readonly leaf: ColumnRecipe; /** Linker columns from the root to the leaf; empty when they join directly. */ readonly path: ColumnRecipe[]; } /** * Sandbox proxy over the host-side `ColumnsCollection` driver. The driver * owns all column-set state; this object only carries an opaque * {@link CollectionHandle} plus a reference to the driver service. * * Construct via {@link ColumnsCollection} — the bare constructor is a * trivial `(handle, driver)` pair so that `addSource` / `discover` / `filter` * can rebind a freshly-minted handle without going through source * serialisation again. * * Every method returning a `ColumnsCollection` mints a fresh handle on the * host — the host VM bridge pins it to the active render ctx, so the sandbox * never has to manage refcounts. */ export declare class ColumnsCollectionImpl { readonly handle: CollectionHandle; private readonly driver; constructor(handle: CollectionHandle, driver: ColumnsCollectionDriverModel); isEmpty(): boolean; isFinal(): boolean; getColumnIds(): ColumnUniversalId[]; getColumns(): ColumnRecipe[]; addSource(source: ColumnsSource | ColumnsCollection): ColumnsCollection; discover(options: ColumnsDiscoverOptions): ColumnsCollection; filter(options: ColumnsFilterOptions): ColumnsCollection; /** * Finds the roots the given columns hang off: the columns that, used as * `anchors` of {@link discover}, would reach them. One entry per root, leaf * and linker path; entries whose columns are not yet resolvable are skipped. */ discoverRoots(options: DiscoverRootsOptions): DiscoveredRoot[]; } /** Public type alias — value of the same name is the factory function above. */ export type ColumnsCollection = ColumnsCollectionImpl; //# sourceMappingURL=columns_collection.d.ts.map