import { type AgFunnelSeriesStyle, type TextOrSegments, _ModuleSupport } from 'ag-charts-community';
import type { DomainWithMetadata, Point, RequireOptional } from 'ag-charts-core';
import { ChartAxisDirection } from 'ag-charts-core';
import type { BaseFunnelProperties } from './baseFunnelSeriesProperties';
import { FunnelConnector } from './funnelConnector';
export type Bounds = {
    x: number;
    y: number;
    width: number;
    height: number;
};
export type FunnelNodeLabelDatum = Readonly<Point> & {
    datumIndex: number;
    text: TextOrSegments;
    textAlign: CanvasTextAlign;
    textBaseline: CanvasTextBaseline;
    datum: any;
    itemId: string;
    series: _ModuleSupport.CartesianSeriesNodeDatum['series'];
    visible: boolean;
};
export interface FunnelNodeDatum extends _ModuleSupport.CartesianSeriesNodeDatum, Readonly<Point> {
    readonly index: number;
    readonly width: number;
    readonly height: number;
    readonly label: FunnelNodeLabelDatum | undefined;
    readonly visible: boolean;
    readonly crisp: boolean;
    readonly opacity?: number;
    readonly clipBBox?: _ModuleSupport.BBox;
}
interface FunnelConnectorDatum {
    readonly datum: FunnelNodeDatum;
    readonly datumIndex: number;
    readonly x0: number;
    readonly y0: number;
    readonly x1: number;
    readonly y1: number;
    readonly x2: number;
    readonly y2: number;
    readonly x3: number;
    readonly y3: number;
    readonly opacity: number;
}
interface FunnelContext extends _ModuleSupport.AbstractBarSeriesNodeDataContext<FunnelNodeDatum, FunnelNodeLabelDatum> {
    connectorData: FunnelConnectorDatum[];
}
/**
 * Base type interface for funnel series types.
 * Constrains datum, label, context, and properties types while leaving node and options open for subclasses.
 */
export interface BaseFunnelSeriesTypes extends _ModuleSupport.AbstractBarSeriesTypes {
    readonly node: _ModuleSupport.QuadtreeCompatibleNode;
    readonly properties: BaseFunnelProperties<this['options']>;
    readonly datum: FunnelNodeDatum;
    readonly label: FunnelNodeLabelDatum;
    readonly context: FunnelContext;
}
export interface FunnelAnimationData<TNode extends _ModuleSupport.QuadtreeCompatibleNode> extends _ModuleSupport.CartesianAnimationData<TNode, FunnelNodeDatum, FunnelNodeLabelDatum, FunnelContext> {
}
declare class FunnelSeriesNodeEvent<TEvent extends string = _ModuleSupport.SeriesNodeEventTypes> extends _ModuleSupport.SeriesNodeEvent<FunnelNodeDatum, TEvent> {
    readonly xKey?: string;
    readonly yKey?: string;
    constructor(type: TEvent, nativeEvent: Event, datum: FunnelNodeDatum, series: BaseFunnelSeries<BaseFunnelSeriesTypes>);
}
export declare abstract class BaseFunnelSeries<TTypes extends BaseFunnelSeriesTypes> extends _ModuleSupport.AbstractBarSeries<TTypes> {
    protected readonly NodeEvent: typeof FunnelSeriesNodeEvent;
    protected readonly connectorNodeGroup: _ModuleSupport.Group<unknown>;
    protected connectorSelection: _ModuleSupport.Selection<FunnelConnector<any>, FunnelConnectorDatum>;
    get pickModeAxis(): "main-category";
    constructor({ moduleCtx, animationResetFns, }: {
        moduleCtx: _ModuleSupport.ModuleContext;
        animationResetFns: {
            datum: (node: _ModuleSupport.NodeOf<TTypes>, datum: FunnelNodeDatum) => _ModuleSupport.AnimationValue & Partial<_ModuleSupport.NodeOf<TTypes>>;
        };
    });
    setZIndex(zIndex: number): boolean;
    protected isVertical(): boolean;
    protected abstract connectorEnabled(): boolean;
    protected abstract connectorStyle(index: number): RequireOptional<AgFunnelSeriesStyle> & {
        opacity: number;
    };
    private connectionFactory;
    getKeyAxis(direction: ChartAxisDirection): string | undefined;
    processData(dataController: _ModuleSupport.DataController): Promise<void>;
    getSeriesDomain(direction: ChartAxisDirection): DomainWithMetadata<any>;
    getSeriesRange(_direction: ChartAxisDirection, _visibleRange: [any, any]): [number, number];
    createNodeData(): FunnelContext | undefined;
    protected abstract getItemStyle(_: Partial<FunnelNodeDatum>, _isHighlight: boolean): RequireOptional<AgFunnelSeriesStyle>;
    protected abstract createLabelData({ datumIndex, rect, yDatum, datum, }: {
        datumIndex: number;
        rect: Bounds;
        barAlongX: boolean;
        yDatum: number;
        datum: any;
        visible: boolean;
    }): FunnelNodeLabelDatum | undefined;
    protected updateNodes(seriesHighlighted: boolean, nodeRefresh: boolean): void;
    protected updateDatumSelection(opts: {
        nodeData: FunnelNodeDatum[];
        datumSelection: _ModuleSupport.Selection<_ModuleSupport.NodeOf<TTypes>, FunnelNodeDatum>;
    }): _ModuleSupport.Selection<_ModuleSupport.NodeOf<TTypes>, FunnelNodeDatum>;
    private updateConnectorSelection;
    private updateConnectorNodes;
    protected updateLabelSelection(opts: {
        labelData: FunnelNodeLabelDatum[];
        labelSelection: FunnelAnimationData<_ModuleSupport.NodeOf<TTypes>>['labelSelection'];
    }): _ModuleSupport.Selection<_ModuleSupport.Text<any>, FunnelNodeLabelDatum>;
    protected updateLabelNodes(opts: {
        labelSelection: _ModuleSupport.Selection<_ModuleSupport.Text, FunnelNodeLabelDatum>;
        isHighlight?: boolean;
    }): void;
    protected getHighlightLabelData(_labelData: FunnelNodeLabelDatum[], highlightedItem: FunnelNodeDatum): FunnelNodeLabelDatum[] | undefined;
    protected abstract tooltipStyle(datum: any, datumIndex: number): Required<AgFunnelSeriesStyle>;
    getTooltipContent(datumIndex: number): _ModuleSupport.TooltipContent | undefined;
    protected resetAllAnimation(data: _ModuleSupport.CartesianAnimationData<_ModuleSupport.NodeOf<TTypes>, FunnelNodeDatum, FunnelNodeLabelDatum, FunnelContext>): void;
    animateEmptyUpdateReady({ labelSelection }: FunnelAnimationData<_ModuleSupport.NodeOf<TTypes>>): void;
    animateWaitingUpdateReady(data: FunnelAnimationData<_ModuleSupport.NodeOf<TTypes>>): void;
    private getDatumId;
    protected isLabelEnabled(): boolean;
    protected computeFocusBounds({ datumIndex }: _ModuleSupport.PickFocusInputs): _ModuleSupport.BBox | undefined;
    private legendItemSymbol;
    getLegendData(legendType: _ModuleSupport.ChartLegendType): _ModuleSupport.CategoryLegendDatum[];
    protected hasItemStylers(): boolean;
}
export {};
