import type { AxisID, BoxBounds, CartesianAxisDirection, DeepReadonly, DefinedZoomState, MementoOriginator, Scale, ZoomMinMax, ZoomState } from 'ag-charts-core';
import type { AgZoomEventSource, AgZoomRange } from 'ag-charts-types';
import type { EventsHub, ZoomEventSourceDetail, ZoomMemento } from '../../core/eventsHub';
import type { BBox } from '../../scene/bbox';
import { BaseManager } from '../../util/baseManager';
import type { TypedEvent } from '../../util/observable';
import type { ISeries } from '../series/seriesTypes';
import type { UpdateService } from '../updateService';
type CoreZoomEntry = ZoomMinMax & {
    direction: CartesianAxisDirection;
};
export type CoreZoomState = Record<AxisID, CoreZoomEntry>;
export type CoreZoomStateSafeRetrieval = {
    readonly [K in AxisID]: CoreZoomEntry | undefined;
};
export type SimpleAxis = {
    id: AxisID;
    direction: CartesianAxisDirection;
};
export type CartesianAxisLike = SimpleAxis & {
    visibleRange: [number, number];
    scale: Scale<any, any>;
    range: [number, number];
    boundSeries: ISeries<any, any, any>[];
    min?: number;
    max?: number;
};
export type UpdateZoomSourcing = {
    source: AgZoomEventSource;
    sourceDetail: ZoomEventSourceDetail;
};
export type UpdateZoomChanges = Record<AxisID, ZoomMinMax | undefined>;
export type UpdateZoomParams = UpdateZoomSourcing & {
    isReset: boolean;
    changes: UpdateZoomChanges;
};
declare function refreshCoreState(nextAxes: Array<CartesianAxisLike> | Array<SimpleAxis>, state: CoreZoomStateSafeRetrieval): CoreZoomState;
export declare function userInteraction<D extends ZoomEventSourceDetail>(sourceDetail: D): {
    source: "user-interaction";
    sourceDetail: D;
};
/**
 * Manages the current zoom state for a chart. Tracks the requested zoom from distinct dependents
 * and handles conflicting zoom requests.
 */
export declare class ZoomManager extends BaseManager implements MementoOriginator<ZoomMemento> {
    private readonly eventsHub;
    private readonly fireChartEvent;
    mementoOriginatorKey: "zoom";
    private state;
    private readonly axes;
    private didLayoutAxes;
    private pendingZoomEventSource?;
    private lastRestoredState;
    private lastRestoredRequiredRange?;
    private lastRestoredRequiredRangeDirection?;
    private independentAxes;
    private navigatorModule;
    private zoomModule;
    private pendingMemento;
    constructor(eventsHub: EventsHub, updateService: UpdateService, fireChartEvent: <TEvent extends TypedEvent>(event: TEvent) => void);
    toCoreZoomState(axisZoom: DeepReadonly<ZoomState>): CoreZoomState;
    toZoomState(coreZoom: DeepReadonly<CoreZoomStateSafeRetrieval>): ZoomState | undefined;
    createMemento(): ZoomMemento;
    guardMemento(blob: unknown, messages: string[]): blob is ZoomMemento | undefined;
    restoreMemento(version: string, mementoVersion: string, memento: ZoomMemento | undefined): void;
    private findAxis;
    getAxes(): CartesianAxisLike[];
    setAxes(nextAxes: Parameters<typeof refreshCoreState>[0]): void;
    setIndependentAxes(independent?: boolean): void;
    setNavigatorEnabled(enabled?: boolean): void;
    setZoomModuleEnabled(enabled?: boolean): void;
    isNavigatorEnabled(): boolean;
    isZoomEnabled(): boolean;
    updateZoom({ source, sourceDetail }: UpdateZoomSourcing, newZoom?: ZoomState): boolean;
    private computeChangedAxesIds;
    updateChanges(params: UpdateZoomParams): boolean;
    resetZoom({ source, sourceDetail }: UpdateZoomSourcing): void;
    resetAxisZoom({ source, sourceDetail }: UpdateZoomSourcing, axisId: AxisID): void;
    panToBBox(seriesRect: BBox, target: BoxBounds): boolean;
    fireZoomPanStartEvent(callerId: 'navigator' | 'zoom'): void;
    extendToEnd(sourcing: UpdateZoomSourcing, direction: CartesianAxisDirection, extent: number): void;
    extendWith({ source, sourceDetail }: UpdateZoomSourcing, direction: CartesianAxisDirection, fn: (end: Date | number) => Date | number): void;
    updateWith({ source, sourceDetail }: UpdateZoomSourcing, direction: CartesianAxisDirection, fn: (start: Date | number, end: Date | number) => [Date | number, Date | number]): void;
    getZoom(): ZoomState | undefined;
    getAxisZoom(axisId: AxisID): ZoomMinMax;
    getAxisZooms(): CoreZoomStateSafeRetrieval;
    getCoreZoom(): CoreZoomStateSafeRetrieval;
    getRestoredZoom(): CoreZoomStateSafeRetrieval;
    getPrimaryAxisId(direction: CartesianAxisDirection): AxisID | undefined;
    private getBoundSeries;
    constrainZoomToItemCount(zoom: DefinedZoomState, minVisibleItems: number, shouldAutoscale: boolean): DefinedZoomState;
    isVisibleItemsCountAtLeast(zoom: DefinedZoomState, minVisibleItems: number, opts: {
        autoScaleYAxis: boolean;
        includeYVisibleRange: boolean;
    }): boolean;
    private getMementoRanges;
    private restoreRequiredRange;
    private constrainZoomToRequiredWidth;
    private dispatch;
    getRange(axisId: AxisID, ratio: ZoomMinMax): AgZoomRange | undefined;
    private getRangeDirection;
    private getRangeAxis;
    rangeToRatio(axisId: AxisID, range: AgZoomRange): ZoomMinMax | undefined;
    rangeToRatioDirection(direction: CartesianAxisDirection, range: AgZoomRange): ZoomMinMax | undefined;
    private rangeToRatioAxis;
    getPrimaryAxis(direction: CartesianAxisDirection): CartesianAxisLike | undefined;
    private getDomainExtents;
    private getDomainPixelExtents;
}
export {};
