import { ReactNode } from 'react';
import { MetricsDimensionalFilter } from '../metrics-filters';
import { PropertyFilterToken } from '../../../ds/components/PropertyFilter/types';
declare const DATE_PRESETS: readonly [{
    readonly label: "Last 24 hours";
    readonly value: "24h";
}, {
    readonly label: "Last 3 days";
    readonly value: "3d";
}, {
    readonly label: "Last 7 days";
    readonly value: "7d";
}, {
    readonly label: "Last 14 days";
    readonly value: "14d";
}, {
    readonly label: "Last 30 days";
    readonly value: "30d";
}];
export type DatePreset = (typeof DATE_PRESETS)[number]['value'] | 'custom';
export { DATE_PRESETS };
export declare function isValidPreset(value: string | null | undefined): value is DatePreset;
export type DateRange = {
    from?: Date;
    to?: Date;
};
/** Internal — all state is derived from the URL-backed props the owner passes.
 *  There is intentionally no local mirror; keeping a mirror caused URL ↔ state
 *  feedback loops that re-rendered the entire metrics tree on every keystroke.
 */
type MetricsContextValue = {
    datePreset: DatePreset;
    setDatePreset: (v: DatePreset) => void;
    customRange: DateRange | undefined;
    setCustomRange: (v: DateRange | undefined) => void;
    dateRangeLabel: string;
    filterTokens: PropertyFilterToken[];
    setFilterTokens: (tokens: PropertyFilterToken[]) => void;
    dimensionalFilter: MetricsDimensionalFilter;
    /** Stable JSON representation of `dimensionalFilter`, safe for query keys. */
    dimensionalFilterKey: string;
    /** Base path drilldown links should target for the Traces page. */
    tracesBasePath: string | undefined;
    /** Base path drilldown links should target for the Logs page. */
    logsBasePath: string | undefined;
};
export declare const MetricsContext: import('react').Context<MetricsContextValue>;
export declare function useMetrics(): MetricsContextValue;
/**
 * URL-driven metrics provider.
 *
 * The owner (page) is expected to:
 *   - pass the current `preset` / `filterTokens` derived from `useSearchParams`
 *   - pass `onPresetChange` / `onFilterTokensChange` that update the URL
 *
 * The provider never stores its own copies — changes round-trip through the URL
 * exactly once, which keeps re-renders bounded no matter how much data is on
 * screen.
 */
export declare function MetricsProvider({ children, preset, filterTokens, onPresetChange, onFilterTokensChange, customRange, onCustomRangeChange, tracesBasePath, logsBasePath, }: {
    children: ReactNode;
    preset: DatePreset;
    filterTokens: PropertyFilterToken[];
    onPresetChange: (preset: DatePreset) => void;
    onFilterTokensChange: (tokens: PropertyFilterToken[]) => void;
    customRange?: DateRange;
    onCustomRangeChange?: (range: DateRange | undefined) => void;
    /** Base path for drilldown links to the Traces page. Defaults to `/observability` when omitted. */
    tracesBasePath?: string;
    /** Base path for drilldown links to the Logs page. Defaults to `/logs` when omitted. */
    logsBasePath?: string;
}): import("react/jsx-runtime").JSX.Element;
