import { SpanTab, TraceDatePreset } from '../index';
import { EntityOptions, TraceStatusFilter } from '../trace-filters';
import { PropertyFilterToken } from '../../../ds/components/PropertyFilter/types';
/** Minimal interface compatible with react-router's `setSearchParams`. */
export type SetURLSearchParamsLike = (next: URLSearchParams | ((prev: URLSearchParams) => URLSearchParams), options?: {
    replace?: boolean;
    preventScrollReset?: boolean;
    state?: unknown;
}) => void;
export interface UseTraceUrlStateOptions {
    /** Called after `handleRemoveAll` clears all filter URL params. Use this to reset page-local
     *  UI state (e.g. a "group by thread" toggle) without wrapping the handler. */
    onRemoveAll?: () => void;
}
export interface UseTraceUrlStateResult {
    searchParams: URLSearchParams;
    setSearchParams: SetURLSearchParamsLike;
    datePreset: TraceDatePreset;
    selectedDateFrom: Date | undefined;
    selectedDateTo: Date | undefined;
    /** Synchronously-updated ref of the latest preset. Used to ignore onDateChange callbacks
     *  the date picker fires after a non-custom preset switch. */
    datePresetRef: React.MutableRefObject<TraceDatePreset>;
    traceIdParam: string | undefined;
    spanIdParam: string | undefined;
    spanTabParam: SpanTab | undefined;
    scoreIdParam: string | undefined;
    selectedEntityOption: EntityOptions | undefined;
    selectedStatus: TraceStatusFilter | undefined;
    filterTokens: PropertyFilterToken[];
    handleTraceClick: (traceId: string) => void;
    /** Convenience: clears the featured trace selection. Equivalent to `handleTraceClick('')`. */
    handleTraceClose: () => void;
    handleSpanChange: (spanId: string | null) => void;
    /** Convenience: clears the featured span selection. Equivalent to `handleSpanChange(null)`. */
    handleSpanClose: () => void;
    handleSpanTabChange: (tab: SpanTab) => void;
    handleScoreChange: (scoreId: string | null) => void;
    handleFilterTokensChange: (nextTokens: PropertyFilterToken[]) => void;
    handleDateChange: (value: Date | undefined, type: 'from' | 'to') => void;
    handleDatePresetChange: (preset: TraceDatePreset) => void;
    handleRemoveAll: () => void;
    /** Lower-level helper used by `handleClear`: writes a token set and clears the trace/span selection. */
    applyFilterTokens: (tokens: PropertyFilterToken[]) => void;
}
/**
 * Owns all URL-derived state and URL-modifying handlers for the traces page. Routing-agnostic —
 * pass `searchParams` and `setSearchParams` from whichever router the consumer uses.
 *
 * Stays focused on URL state: localStorage save/restore, filter discovery, and the error-view
 * short-circuit are intentionally NOT part of this hook so consumers can swap them independently.
 */
export declare function useTraceUrlState(searchParams: URLSearchParams, setSearchParams: SetURLSearchParamsLike, options?: UseTraceUrlStateOptions): UseTraceUrlStateResult;
