import { type IInsightDefinition } from "@gooddata/sdk-model";
import { type IPushData, type VisualizationEnvironment } from "@gooddata/sdk-ui";
import { type IGeoLngLat } from "@gooddata/sdk-ui-geo";
import { type IVisualizationProperties } from "../../../interfaces/Visualization.js";
/**
 * Type guard for {@link IGeoLngLat}.
 *
 * Values coming from `visualizationProperties.controls` are loosely typed
 * (`Record<string, any>`). This guard narrows them safely.
 *
 * @internal
 */
export declare function isGeoLngLat(value: unknown): value is IGeoLngLat;
/**
 * Snapshot of the current map center and zoom.
 *
 * @internal
 */
export interface ILiveMapView {
    center?: IGeoLngLat;
    zoom?: number;
}
/**
 * Context required by {@link LiveMapViewTracker.syncCustomViewportSnapshot}
 * to decide whether and how to persist the current map position.
 *
 * @internal
 */
export interface ISyncViewportContext {
    environment: VisualizationEnvironment;
    visualizationProperties: IVisualizationProperties;
    pushData: (data: IPushData) => void;
    setVisualizationProperties: (properties: IVisualizationProperties) => void;
}
/**
 * Handlers returned by {@link LiveMapViewTracker.createSyncedHandlers}.
 *
 * @internal
 */
export interface ISyncedMapHandlers {
    handleCenterPositionChanged: (center: IGeoLngLat) => void;
    handleZoomChanged: (zoom: number) => void;
}
/**
 * Mixin-like helper that tracks the live map center/zoom reported via callbacks
 * and exposes a `getCurrentMapView()` function suitable for the config panel.
 *
 * Both `PluggableGeoAreaChart` and `PluggableGeoPushpinChartNext` have identical
 * private state for this purpose. This helper encapsulates it once.
 *
 * @internal
 */
export declare class LiveMapViewTracker {
    private currentMapCenter?;
    private currentMapZoom?;
    private insightContextKey?;
    readonly handleCenterPositionChanged: (center: IGeoLngLat) => void;
    readonly handleZoomChanged: (zoom: number) => void;
    getCurrentMapView(visualizationProperties: IVisualizationProperties): ILiveMapView;
    /**
     * Persists the current map center and zoom into visualization properties
     * when the viewport mode is "custom" and the environment is Analytical Designer.
     *
     * This is called after every center/zoom callback from the map component so
     * that the saved insight always reflects the user's last viewport position.
     * The `ignoreUndoRedo` flag prevents these automatic updates from polluting
     * the undo stack.
     */
    syncCustomViewportSnapshot(ctx: ISyncViewportContext): void;
    /**
     * Returns center/zoom handlers that update the live snapshot and
     * automatically persist the viewport when conditions are met.
     *
     * The sync is coalesced via a microtask so that rapid center+zoom
     * callback pairs result in a single `pushData` call with both values.
     */
    createSyncedHandlers(getContext: () => ISyncViewportContext): ISyncedMapHandlers;
    /**
     * Resets the live snapshot when the insight configuration changes.
     * This ensures that stale center/zoom values from a previous render cycle
     * are not returned via `getCurrentMapView()`.
     */
    resetIfInsightChanged(insight: IInsightDefinition): void;
}
/**
 * Accessors that let {@link createSyncedViewportHandlers} read/write the
 * chart state it needs without requiring public access to protected fields.
 *
 * @internal
 */
export interface IGeoChartAccessors {
    getEnvironment: () => string;
    getVisualizationProperties: () => IVisualizationProperties;
    setVisualizationProperties: (properties: IVisualizationProperties) => void;
    pushData: (data: IPushData) => void;
}
/**
 * Creates synced viewport handlers for a pluggable geo chart.
 *
 * This is a convenience wrapper around {@link LiveMapViewTracker.createSyncedHandlers}
 * that builds the {@link ISyncViewportContext} from accessor functions, eliminating
 * identical boilerplate in `PluggableGeoAreaChart` and `PluggableGeoPushpinChartNext`.
 *
 * @internal
 */
export declare function createSyncedViewportHandlers(tracker: LiveMapViewTracker, accessors: IGeoChartAccessors): ISyncedMapHandlers;
//# sourceMappingURL=liveMapViewTracking.d.ts.map