import { type DateZoom } from '../types/api/paginatedQuery';
import { type DashboardConfig, type DateZoomConfig, type DateZoomControl } from '../types/dashboard';
import type { Explore } from '../types/explore';
import { type CompiledDimension } from '../types/field';
import type { MetricQuery } from '../types/metricQuery';
import { type ChartConfig } from '../types/savedCharts';
import { DateGranularity } from '../types/timeFrames';
/**
 * Collects all DATE and TIMESTAMP dimensions from an explore, keyed by item ID.
 */
export declare const getTimeDimensionsMap: (explore: Explore) => Record<string, CompiledDimension>;
/**
 * Resolves a time-interval dimension (e.g. `order_date_month`) to its base
 * dimension (e.g. `order_date`). If the dimension has no `timeInterval` or the
 * base can't be parsed from the ID, returns the dimension itself.
 *
 * When the base dimension ID is resolved but not found in the map, returns
 * `undefined` — callers should handle this as an unexpected state.
 */
export declare const resolveBaseDimension: (dimId: string, dim: CompiledDimension, timeDimensionsMap: Record<string, CompiledDimension>) => CompiledDimension | undefined;
export type DateZoomCapabilities = {
    availableCustomGranularities: Record<string, string>;
    hasTimestampDimension: boolean;
    hasDateDimension: boolean;
};
/**
 * Collects all dimensions from an explore, keyed by item ID.
 */
export declare const getAllDimensionsMap: (explore: Explore) => Record<string, CompiledDimension>;
/**
 * Resolves any dimension from the metric query to its base time dimension.
 * Handles three cases:
 * - Standard time-interval dims (e.g. order_date_month) → resolves via getDateDimension
 * - Custom granularity dims (e.g. order_date_fiscal_quarter) → resolves via timeIntervalBaseDimensionName
 * - Plain date/timestamp dims → returns the dimension itself
 */
export declare const resolveToBaseTimeDimension: (dimId: string, allDimensionsMap: Record<string, CompiledDimension>, timeDimensionsMap: Record<string, CompiledDimension>) => CompiledDimension | undefined;
export declare const getDateZoomCapabilities: (explore: Explore, metricQuery: MetricQuery) => DateZoomCapabilities;
/**
 * Resolves which field a chart's date zoom should target. For cartesian charts
 * whose x-axis resolves to a time dimension, that's the x-axis field — so
 * callers can pass it as `dateZoom.xAxisFieldId` and have the backend re-grain
 * the same field the chart actually plots, instead of auto-picking the first
 * date dimension in the query. Uses the same `resolveToBaseTimeDimension` check
 * the backend applies, so custom/string-typed interval x-axes (e.g. a
 * fiscal-quarter dimension) are targeted too. Returns undefined when the
 * backend's auto-pick should stand (non-cartesian charts, non-time x-axis, or
 * no x-axis).
 */
export declare const getDateZoomXAxisFieldId: (chartConfig: ChartConfig, explore: Explore | undefined) => string | undefined;
export type ChartZoomableField = {
    fieldId: string;
    label: string;
    tableName: string;
};
/**
 * The date fields a chart can actually be zoomed on: the dimensions in the
 * chart's own `metricQuery` that resolve to a base DATE/TIMESTAMP dimension.
 * This is the set a date-zoom control should offer for a tile, narrower than
 * the dashboard-filter field set, which exposes every filterable dimension in
 * the explore regardless of whether the chart plots it.
 *
 * The returned `fieldId` is the queried dimension id (e.g. `orders_order_date_month`),
 * matching the `xAxisFieldId` the backend re-grains in `_getDateZoomExplore`.
 */
export declare const getChartZoomableFields: (explore: Explore, metricQuery: MetricQuery) => ChartZoomableField[];
export declare const EMPTY_DATE_ZOOM_CONFIG: DateZoomConfig;
export declare const normalizeDateZoomConfig: (config: DashboardConfig | undefined) => DateZoomConfig;
export declare const isEmptyDateZoomConfig: (config: DateZoomConfig) => boolean;
export declare const getTileControl: (config: DateZoomConfig, tileUuid: string) => DateZoomControl | undefined;
export declare const getControlActiveGranularity: (control: DateZoomControl, runtimeGranularities: Record<string, DateGranularity | string>) => DateGranularity | string;
export type ResolveTileDateZoomArgs = {
    config: DateZoomConfig;
    tileUuid: string;
    runtimeGranularities: Record<string, DateGranularity | string>;
    globalGranularity: DateGranularity | string | undefined;
    defaultXAxisFieldId: string | undefined;
};
export declare const resolveTileDateZoom: ({ config, tileUuid, runtimeGranularities, globalGranularity, defaultXAxisFieldId, }: ResolveTileDateZoomArgs) => DateZoom | undefined;
export declare const normalizeGranularityParam: (param: string) => DateGranularity | string;
export declare const copyDateZoomTileTargets: (config: DateZoomConfig, mapping: Array<{
    fromTileUuid: string;
    toTileUuid: string;
}>) => DateZoomConfig;
export declare const pruneDateZoomConfig: (config: DateZoomConfig) => DateZoomConfig;
/**
 * Drops the date-zoom targets for the given tiles (e.g. tiles deleted from the
 * dashboard) and prunes any control left with no targets. Returns the same
 * reference when none of the tiles had a target, so callers can skip a no-op
 * config update on dashboards that don't use controls.
 */
export declare const removeDateZoomTileTargets: (config: DateZoomConfig, tileUuids: string[]) => DateZoomConfig;
//# sourceMappingURL=dateZoom.d.ts.map