import type { BaseDataSeries } from "../../Model/BaseDataSeries"; import type { SCRTDoubleVector } from "../../../types/TSciChart"; /** * The axis a {@link IColumnSlot} ranges on. */ export declare enum EColumnSlotRole { X = "X", Y = "Y" } /** * Describes one column slot declared by a renderable series - the discoverable, * queryable answer to "what fields does this series consume, and what are they * currently bound to". TS analogue of the C++ `SCRTColumnSlot` (see * `SCRTRenderableSeries2D.h`), plus a `bindable` flag gating which slots this * phase of the substrate allows {@link ColumnBindings.bind} to target. */ export interface IColumnSlot { /** Slot name, e.g. "x", "y", "y1", "open", "high", "low", "close", "z" */ name: string; /** Which axis this slot participates in ranging for */ role: EColumnSlotRole; /** True when the series cannot draw without this slot resolving */ required: boolean; /** True when this slot's values participate in the series' autorange */ usedForRange: boolean; /** Human-readable purpose, surfaced to reflection/tooling */ description?: string; /** True when {@link ColumnBindings.bind} is currently allowed to target this slot */ bindable: boolean; /** The data-series column override for this slot; undefined = default (unbound) */ boundColumn?: string | number; } /** * Declares the column slots a renderable series consumes and how each maps onto a * data-series column - the TS port of the C++ `SCRTColumnBindings` concept (see * `SCRTRenderableSeries2D.h` / `.cpp`). Slots are declared once, at construction * time, by the series (and its ancestors); {@link bind} / {@link clearBinding} * then let callers retarget a *bindable* slot onto a named or indexed column. * * `resolve` mirrors both the C++ `SCRTColumnBindings::Resolve` and the existing * `yArrayFilter` logic in {@link BaseRenderableSeries.getNativeYValues}: an unknown * slot name, an unbound slot, or a typo'd/out-of-range binding all resolve to * `undefined` so a mistake never blanks the chart - the caller is expected to fall * back to its own default column in that case. */ export declare class ColumnBindings { private readonly slots; private versionProperty; /** Monotonic version, bumped by {@link bind} / {@link clearBinding} (feeds resample-cache invalidation) */ get version(): number; /** * Declare a slot. Intended to be called only from series constructors (base then * subclass, immediately after `super(...)`). Duplicate names (by {@link IColumnSlot.name}) * are ignored - the first declaration wins. */ declareSlot(slot: Omit): void; /** * Map a slot to a data-series column, by column index or by column name. * @throws if the slot is not declared, or the slot is declared with `bindable: false` */ bind(slotName: string, column: string | number): void; /** Remove a slot's override, reverting it to its default (unbound) column. Unknown slots are a no-op. */ clearBinding(slotName: string): void; /** The column currently bound to a slot, or undefined when unbound/unknown. */ getBoundColumn(slotName: string): string | number | undefined; /** The queryable schema - a defensive copy, safe for callers to inspect but not to mutate live state through. */ getColumnSchema(): ReadonlyArray>; /** * Resolve a slot's column values against `dataSeries`. * - No binding (or unknown slot / missing dataSeries) -> `undefined` (caller uses its own default path) * - Numeric binding -> `dataSeries.getNativeYValues(index)` * - String binding -> `dataSeries.getYValuesByName(name, EDataSeriesValueType.Default)`, when * `dataSeries` exposes `getYValuesByName` (only {@link BaseDataSeries} does - duck-checked) * - Unknown column name / out-of-range index -> `undefined`, never throws */ resolve(slotName: string, dataSeries: BaseDataSeries): SCRTDoubleVector | undefined; private findSlot; }