import { ChartAxisDirection, type DomainWithMetadata, type LabelPlacement, type MeasuredLabel, type PlacedLabel, type Point, type Scale, type SizedPoint } from 'ag-charts-core';
import { type AgBubbleSeriesOptions, type AgBubbleSeriesStylerParams, type AgBubbleSeriesStylerResult, type AgDrawingMode, type AgScatterSeriesStylerParams, type AgSeriesMarkerStyle } from 'ag-charts-types';
import type { ModuleContext } from '../../../module/moduleContext';
import type { BBox } from '../../../scene/bbox';
import type { Selection } from '../../../scene/selection';
import { Text } from '../../../scene/shape/text';
import type { QuadtreeNearest } from '../../../scene/util/quadtree';
import type { ChartAxis } from '../../chartAxis';
import type { DataController } from '../../data/dataController';
import type { CategoryLegendDatum } from '../../legend/legendDatum';
import { Marker } from '../../marker/marker';
import { type TooltipContent } from '../../tooltip/tooltip';
import { type PickFocusInputs, type SeriesNodePickMatch, type SeriesNodeStyleContext } from '../series';
import { HighlightState } from '../seriesProperties';
import type { ErrorBoundSeriesNodeDatum, SeriesNodeEventTypes } from '../seriesTypes';
import { BubbleSeriesProperties } from './bubbleSeriesProperties';
import { CartesianSeries, CartesianSeriesNodeEvent } from './cartesianSeries';
import type { CartesianAnimationDataOf, CartesianMarkerLikeContext, CartesianSeriesNodeDataContext, CartesianSeriesNodeDatum, CartesianSeriesTypes } from './cartesianSeriesTypes';
type BubbleScatterAnimationData = CartesianAnimationDataOf<BubbleSeriesTypes>;
declare class BubbleScatterSeriesNodeEvent<TEvent extends string = SeriesNodeEventTypes> extends CartesianSeriesNodeEvent<TEvent> {
    readonly sizeKey?: string;
    constructor(type: TEvent, nativeEvent: Event, datum: BubbleScatterNodeDatum, series: BubbleSeries);
}
export interface BubbleScatterNodeDatum extends CartesianSeriesNodeDatum, ErrorBoundSeriesNodeDatum {
    readonly point: Readonly<SizedPoint>;
    readonly sizeValue: any;
    readonly label: MeasuredLabel;
    readonly placement: LabelPlacement;
    readonly anchor: Point;
    readonly count: number;
    readonly dilation: number;
    readonly area: number;
    readonly selected: boolean | undefined;
    style?: AgSeriesMarkerStyle;
}
interface BubbleSeriesNodeDataContext extends CartesianSeriesNodeDataContext<BubbleScatterNodeDatum, BubbleScatterNodeDatum> {
    styles: SeriesNodeStyleContext<AgSeriesMarkerStyle>;
}
/**
 * Consolidated type interface for BubbleSeries.
 * Defines all type parameters in one place for the series.
 */
interface BubbleSeriesTypes extends CartesianSeriesTypes {
    readonly node: Marker;
    readonly options: AgBubbleSeriesOptions;
    readonly properties: BubbleSeriesProperties;
    readonly datum: BubbleScatterNodeDatum;
    readonly label: BubbleScatterNodeDatum;
    readonly context: BubbleSeriesNodeDataContext;
    readonly stackContext: never;
    readonly createNodeDataContext: BubbleSeriesNodeDatumContext;
}
/** Context object caching expensive lookups for createNodeData(). */
interface BubbleSeriesNodeDatumContext extends CartesianMarkerLikeContext<BubbleScatterNodeDatum> {
    readonly yKey: string;
    readonly xDataValues: any[];
    readonly yDataValues: any[];
    readonly sizeDataValues: number[] | undefined;
    readonly labelDataValues: any[] | undefined;
    readonly xFilterDataValues: any[] | undefined;
    readonly yFilterDataValues: any[] | undefined;
    readonly sizeFilterDataValues: number[] | undefined;
    readonly sizeScale: Scale<any, number>;
    readonly sizeKey: string | undefined;
    readonly labelKey: string | undefined;
    readonly sizeName: string | undefined;
    readonly labelName: string | undefined;
    readonly legendItemName: string | undefined;
    readonly labelsEnabled: boolean;
    readonly labelPlacement: LabelPlacement;
    readonly labelAnchor: Point;
    readonly labelTextDomain: any[];
    readonly labelPadding: {
        left: number;
        right: number;
        top: number;
        bottom: number;
    };
    readonly labelTextMeasurer: {
        measureLines: (text: string) => {
            width: number;
            height: number;
        };
    };
    readonly label: BubbleSeriesProperties['label'];
    readonly visible: boolean;
}
export declare class BubbleSeries extends CartesianSeries<BubbleSeriesTypes> {
    static readonly className: string;
    static readonly type: string;
    protected readonly NodeEvent: typeof BubbleScatterSeriesNodeEvent;
    properties: BubbleSeriesProperties;
    private dataAggregation;
    private readonly sizeScale;
    private placedLabelData;
    get pickModeAxis(): "main-category";
    get type(): "bubble" | "scatter";
    constructor(moduleCtx: ModuleContext);
    processData(dataController: DataController): Promise<void>;
    xCoordinateRange(xValue: any, pixelSize: number, index: number): [number, number];
    yCoordinateRange(yValues: any[], pixelSize: number, index: number): [number, number];
    getSeriesDomain(direction: ChartAxisDirection): DomainWithMetadata<any>;
    getSeriesRange(_direction: ChartAxisDirection, visibleRange: [number, number]): [number, number];
    getVisibleItems(xVisibleRange: [number, number], yVisibleRange: [number, number] | undefined, minVisibleItems: number): number;
    private aggregateData;
    private aggregationOptions;
    /**
     * Creates and returns a context object that caches expensive property lookups
     * and scale conversions. Called once per createNodeData() invocation.
     */
    protected createNodeDatumContext(xAxis: ChartAxis, yAxis: ChartAxis): BubbleSeriesNodeDatumContext | undefined;
    /**
     * Populates the node data array by iterating over visible data.
     * Strategy selection happens inside: simple or aggregation path.
     */
    protected populateNodeData(ctx: BubbleSeriesNodeDatumContext): void;
    /**
     * Initializes the result context object with default values.
     * Called before populate phase to allow early return for invisible series.
     */
    protected initializeResult(ctx: BubbleSeriesNodeDatumContext): BubbleSeriesNodeDataContext;
    /**
     * Validates datum state and upserts node - centralizes duplicated upsert pattern.
     */
    private upsertBubbleNodeDatum;
    /**
     * Simple iteration path for ungrouped data without aggregation.
     */
    private createNodeDataSimple;
    /**
     * Aggregation path for large datasets using quadtree-based 2D spatial aggregation.
     */
    private createNodeDataWithAggregation;
    /**
     * Validates and prepares state needed for node creation/update.
     * Returns undefined if datum should be skipped (invalid data).
     */
    private prepareNodeDatumState;
    /**
     * Computes label text and measurements for a datum.
     * Separated to enable skipping when labels are disabled.
     */
    private computeLabel;
    /**
     * Creates a minimal skeleton node - actual values set by updateNodeDatum.
     */
    private createSkeletonNodeDatum;
    /**
     * Updates node properties in-place.
     * Shared by both create (skeleton + update) and incremental update paths.
     */
    private updateNodeDatum;
    protected isPathOrSelectionDirty(): boolean;
    getLabelData(): BubbleScatterNodeDatum[];
    protected updateDatumSelection(opts: {
        nodeData: BubbleScatterNodeDatum[];
        datumSelection: Selection<Marker, BubbleScatterNodeDatum>;
    }): Selection<Marker, BubbleScatterNodeDatum>;
    updateDatumStyles(opts: {
        datumSelection: Selection<Marker, BubbleScatterNodeDatum>;
        isHighlight: boolean;
    }): void;
    protected updateDatumNodes(opts: {
        datumSelection: Selection<Marker, BubbleScatterNodeDatum>;
        isHighlight: boolean;
        drawingMode: AgDrawingMode;
    }): void;
    updatePlacedLabelData(labelData: PlacedLabel<BubbleScatterNodeDatum>[]): void;
    private updateHighlightLabelSelection;
    protected updateLabelNodes(opts: {
        labelSelection: Selection<Text, BubbleScatterNodeDatum>;
        isHighlight?: boolean;
    }): void;
    protected updateLabelSelection(opts: {
        labelData: BubbleScatterNodeDatum[];
        labelSelection: Selection<Text, BubbleScatterNodeDatum>;
    }): Selection<Text, BubbleScatterNodeDatum>;
    makeStylerParams(highlightStateEnum?: HighlightState): AgBubbleSeriesStylerParams<unknown, unknown> | AgScatterSeriesStylerParams<unknown, unknown>;
    private makeLabelFormatterParams;
    getTooltipContent(datumIndex: number): TooltipContent | undefined;
    private legendItemSymbol;
    getLegendData(): CategoryLegendDatum[];
    animateEmptyUpdateReady({ datumSelection, labelSelection }: BubbleScatterAnimationData): void;
    protected resetDatumAnimation(data: BubbleScatterAnimationData): void;
    protected isLabelEnabled(): boolean;
    protected nodeFactory(): Marker;
    getStyle(highlightState?: HighlightState): Required<AgBubbleSeriesStylerResult>;
    getSizeRange(): [number, number];
    getFormattedMarkerStyle(datum: BubbleScatterNodeDatum): AgSeriesMarkerStyle & {
        size: number;
    };
    protected computeFocusBounds(opts: PickFocusInputs): BBox | undefined;
    protected hasItemStylers(): boolean;
    protected initQuadTree(quadtree: QuadtreeNearest<BubbleScatterNodeDatum>): void;
    protected pickNodeDataClosestDatum(point: Point): SeriesNodePickMatch | undefined;
}
export {};
