import type { Datum } from "../charts/shared/datumTypes";
/**
 * OrdinalPipelineStore — stateful pipeline for ordinal chart data.
 *
 * Owns: data ingestion (RingBuffer), scale computation (o-band + r-linear),
 * value domain logic (per-lane sums for swimlane, zero-inclusion for bars),
 * and scene layout delegation to ordinalSceneBuilders/*.
 *
 * Key design decisions:
 *   - Swimlane domain uses per-lane sums, not individual values, because
 *     stacked bars within a lane must fit within the lane's total range.
 *   - Zero-inclusion for bar/swimlane is skipped when explicit rExtent is
 *     set (either end non-null), enabling zoom/brush without domain override.
 *   - Scene builders are pure functions; this store coordinates them.
 *
 * Consumed by: StreamOrdinalFrame (sole consumer).
 */
import { type ScaleLinear } from "d3-scale";
import { type Quadtree } from "d3-quadtree";
import type { OrdinalPipelineConfig, OrdinalScales, OrdinalSceneNode, OrdinalColumn, OrdinalLayout } from "./ordinalTypes";
import type { Changeset, PointSceneNode } from "./types";
import type { ActiveTransition } from "./pipelineTransitionUtils";
export declare class OrdinalPipelineStore {
    private buffer;
    private rExtent;
    /** Per-accessor extents for multiAxis mode */
    private rExtents;
    private config;
    private getO;
    private getR;
    /** All resolved rAccessors (length > 1 when multiAxis) */
    private rAccessors;
    private getStack;
    private getGroup;
    private getColor;
    private getConnector;
    private getDataId;
    /** Discovered categories in insertion order */
    private categories;
    /** True once a non-bounded (push) changeset has been ingested */
    private _hasStreamingData;
    /** Lazy color map built from colorScheme for resolvePieceStyle */
    private _colorSchemeMap;
    private _colorSchemeIndex;
    private timestampBuffer;
    activeTransition: ActiveTransition | null;
    private prevPositionMap;
    /** Exit nodes awaiting fade-out removal */
    exitNodes: import("./ordinalTypes").OrdinalSceneNode[];
    lastIngestTime: number;
    scales: OrdinalScales | null;
    /** Per-accessor scales for multiAxis */
    multiScales: (ScaleLinear<number, number>)[];
    scene: OrdinalSceneNode[];
    columns: Record<string, OrdinalColumn>;
    version: number;
    /** Bumped whenever the buffer is mutated. Used to invalidate per-frame caches. */
    private _dataVersion;
    private static readonly QUADTREE_THRESHOLD;
    private _pointQuadtree;
    /** Largest visual point radius in the current scene. */
    private _maxPointRadius;
    /** Cached datum→index map for applyDecay/applyPulse. Keyed by `_dataVersion`. */
    private _datumIndexCache;
    /** Cached category→indices map for applyPulse wedge path. Keyed by `_dataVersion`. */
    private _categoryIndexCache;
    private _hasRenderedOnce;
    constructor(config: OrdinalPipelineConfig);
    ingest(changeset: Changeset): boolean;
    private pushValueExtent;
    private evictValueExtent;
    /** For timeline type: resolve rAccessor as a [start, end] pair */
    private getRawRange;
    computeScene(layout: OrdinalLayout): void;
    private resolveRAccessorName;
    private resolveCategories;
    private computeValueDomain;
    private buildColumns;
    private getSceneContext;
    private buildSceneNodes;
    private resolvePieceStyle;
    private getColorFromScheme;
    private resolveSummaryStyle;
    computeDecayOpacity(bufferIndex: number, bufferSize: number): number;
    /**
     * Build (or return cached) datum→buffer-index map. Cached against
     * `_dataVersion` so the per-frame applyDecay/applyPulse calls don't
     * rebuild it during animation when the buffer hasn't changed.
     */
    private getDatumIndexMap;
    /**
     * Build (or return cached) category→[indices] map used by applyPulse for
     * wedge nodes. Cached against `_dataVersion` so the per-wedge inner loop
     * collapses from O(data) to O(matches-for-this-category).
     */
    private getCategoryIndexMap;
    /**
     * Build (or clear) a quadtree spatial index for point scene nodes.
     * Useful for swarm plots — other ordinal types (bar/wedge/box/violin) are
     * not indexed because they're typically few in number or already O(1) hit
     * tests via bbox checks.
     */
    private rebuildPointQuadtree;
    /** Quadtree spatial index for point hit testing, or null when below threshold. */
    get pointQuadtree(): Quadtree<PointSceneNode> | null;
    /** Largest visual point radius in the current scene. */
    get maxPointRadius(): number;
    private applyDecay;
    private applyPulse;
    get hasActivePulses(): boolean;
    /** Synthesize a zero-state prevPositionMap for animated intro (first render). */
    private synthesizeIntroPositions;
    /** Build a stable identity key for a scene node based on its content, not array index */
    private getNodeKey;
    private snapshotPositions;
    private startTransition;
    advanceTransition(now: number): boolean;
    getData(): Datum[];
    /**
     * Remove data items by ID. Requires dataIdAccessor to be configured.
     * Returns the removed items. Marks the store dirty for scene rebuild.
     */
    remove(id: string | string[]): Datum[];
    /**
     * Update data items by ID. Requires dataIdAccessor.
     * Returns the previous values. Categories and extents are rebuilt.
     */
    update(id: string | string[], updater: (d: Datum) => Datum): Datum[];
    clear(): void;
    get size(): number;
    getOAccessor(): (d: Datum) => string;
    getRAccessor(): (d: Datum) => number;
    updateConfig(config: Partial<OrdinalPipelineConfig>): void;
}
