import { PColumnDataUniversal } from "../internal.js"; import { DeriveLabelsOptions } from "../../labels/derive_distinct_labels.js"; import "./label.js"; import { APColumnSelectorWithSplit, PColumnSelectorWithSplit } from "./split_selectors.js"; import { AnchoredIdDeriver, AnchoredPColumnSelector, AxisId, PColumn, PColumnSelector, PColumnSpec, ResolveAnchorsOptions, SUniversalPColumnId } from "@milaboratories/pl-model-common"; export interface ColumnProvider { selectColumns(selectors: ((spec: PColumnSpec) => boolean) | PColumnSelector | PColumnSelector[]): PColumn[]; } export interface AxisLabelProvider { findLabels(axis: AxisId): Record | undefined; } /** Lazy calculates the data, returns undefined if data is not ready. */ export type PColumnWithLabel = PColumn & { label: string; }; /** Universal column is a column that uses a universal column id, and always have label. */ export type PColumnUniversal = PColumnWithLabel & { id: SUniversalPColumnId; }; /** @deprecated Use PColumnWithLabel instead. */ export type PColumnEntryWithLabel = PColumn & { label: string; }; /** @deprecated Use PColumnUniversal instead. */ export type PColumnEntryUniversal = PColumnEntryWithLabel & { id: SUniversalPColumnId; }; type UniversalPColumnOptsNoDeriver = { /** If provided, columns matching the provided selectors will be excluded from the result. */ exclude?: AnchoredPColumnSelector | AnchoredPColumnSelector[]; labelOps?: DeriveLabelsOptions; /** If true, incomplete data will cause the column to be skipped instead of returning undefined for the whole request. */ dontWaitAllData?: boolean; /** * If true, the derived label will override the 'pl7.app/label' annotation * in the resulting PColumnSpec. It also forces `includeNativeLabel` in `labelOps` to true, * unless `labelOps.includeNativeLabel` is explicitly set to false. * Default value in getUniversalEntries is false, in getColumns it is true. */ overrideLabelAnnotation?: boolean; /** If true, resulting columns will be enriched by other columns considering linker columns. Default is false. */ enrichByLinkers?: boolean; }; type UniversalPColumnOpts = UniversalPColumnOptsNoDeriver & { anchorCtx: AnchoredIdDeriver; } & ResolveAnchorsOptions; export declare class PColumnCollection { private readonly defaultProviderStore; private readonly providers; private readonly axisLabelProviders; constructor(); addColumnProvider(provider: ColumnProvider): this; addAxisLabelProvider(provider: AxisLabelProvider): this; addColumns(columns: PColumn[]): this; addColumn(column: PColumn): this; /** Fetches labels for a given axis from the registered providers */ private findLabels; getUniversalEntries(predicateOrSelectors: ((spec: PColumnSpec) => boolean) | APColumnSelectorWithSplit | APColumnSelectorWithSplit[], opts: UniversalPColumnOpts): PColumnEntryUniversal[] | undefined; getUniversalEntries(predicateOrSelectors: ((spec: PColumnSpec) => boolean) | PColumnSelectorWithSplit | PColumnSelectorWithSplit[], opts?: UniversalPColumnOptsNoDeriver): PColumnEntryWithLabel[] | undefined; getColumns(predicateOrSelectors: ((spec: PColumnSpec) => boolean) | APColumnSelectorWithSplit | APColumnSelectorWithSplit[], opts: UniversalPColumnOpts): PColumn[] | undefined; getColumns(predicateOrSelectors: ((spec: PColumnSpec) => boolean) | PColumnSelectorWithSplit | PColumnSelectorWithSplit[], opts?: UniversalPColumnOptsNoDeriver): PColumn[] | undefined; } export {}; //# sourceMappingURL=column_collection.d.ts.map