import { createLegend } from "./legendUtils";
import type { SelectionHookResult } from "./selectionUtils";
import type { OnObservationCallback } from "../../store/ObservationStore";
import type { Accessor, SelectionConfig, LinkedHoverProp, ChartMode } from "./types";
import type { MarginType, PartialMargin } from "../../types/marginType";
import type { TransitionConfig } from "../../stream/types";
import type { Datum } from "./datumTypes";
/**
 * Default fill color used when no colorBy is specified
 */
export declare const DEFAULT_COLOR = "#007bff";
/**
 * Returns the theme's categorical palette, or undefined if no ThemeProvider or
 * the palette is empty. Safe to call outside a ThemeProvider (returns undefined).
 */
export declare function useThemeCategorical(): string[] | undefined;
/**
 * Return the ambient theme's sequential scheme name (e.g. "blues", "viridis")
 * for magnitude encodings. Safe to call outside a ThemeProvider (returns undefined).
 */
export declare function useThemeSequential(): string | undefined;
/**
 * Return the ambient theme's diverging scheme name (e.g. "RdBu", "PiYG")
 * for midpoint encodings (likert, ±deviation). Safe to call outside a
 * ThemeProvider (returns undefined).
 */
export declare function useThemeDiverging(): string | undefined;
/**
 * Resolve the effective color for a data element when no colorBy is specified.
 * Priority: color prop > theme categorical > colorScheme > DEFAULT_COLOR.
 * When a palette is available, cycles through colors by category name.
 */
export declare function resolveDefaultFill(color: string | undefined, themeCategorical: string[] | undefined, colorScheme: string | string[] | undefined, category: string | undefined, categoryIndexMap: Map<string, number>): string;
/**
 * Resolve an accessor (string key or function) into a function.
 * Used across chart components to normalize `valueAccessor`, `categoryAccessor`, etc.
 */
export declare function resolveAccessor<T = any>(accessor: string | ((d: Datum, i?: number) => T)): (d: Datum) => T;
/**
 * Hook to create a color scale from data and colorBy configuration.
 * Returns undefined when colorBy is absent or data is empty (push API mode).
 * Supports both string and function accessors for colorBy.
 */
export declare function useColorScale(data: Array<Datum>, colorBy: string | ((d: any, i?: number) => any) | undefined, colorScheme?: string | string[]): ((v: string) => string) | undefined;
/**
 * Hook to sort data by a value accessor.
 * Used by BarChart and DotPlot.
 *
 * `"auto"` and function comparators are pass-through here. The frame-
 * level `resolveCategories` decides the visual category order:
 *   • `"auto"` → insertion order when streaming, value-desc when static.
 *   • function → runs as a category-key comparator on the axis list.
 * The HOC's row-level `data` order only seeds insertion order via the
 * store's category Set; rearranging rows with a category comparator
 * makes no sense (it would call the comparator with row objects instead
 * of strings), so we decline to sort in both cases.
 */
export declare function useSortedData(data: Array<Datum>, sort: boolean | "asc" | "desc" | "auto" | ((a: string, b: string) => number), valueAccessor: Accessor<number>): Array<Datum>;
/**
 * Hook to set up selection and linked hover for a chart component.
 * Consolidates normalizeLinkedHover, useSelection, useLinkedHover,
 * and the customHoverBehavior callback that every HOC chart repeats.
 *
 * @param unwrapData - Deprecated / no-op. Hover data is always unwrapped
 *   (stream frames wrap the raw datum in { data, time, value, x, y }).
 */
export declare function useChartSelection({ selection, linkedHover, fallbackFields, unwrapData: _unwrapData, onObservation, chartType, chartId, onClick, hoverHighlight, colorByField, }: {
    selection?: SelectionConfig;
    linkedHover?: LinkedHoverProp;
    fallbackFields?: string[];
    unwrapData?: boolean;
    onObservation?: OnObservationCallback;
    chartType?: string;
    chartId?: string;
    onClick?: (datum: any, event: {
        x: number;
        y: number;
    }) => void;
    hoverHighlight?: boolean;
    colorByField?: string;
}): {
    activeSelectionHook: SelectionHookResult | null;
    hoverSelectionHook: SelectionHookResult | null;
    customHoverBehavior: (d: Datum | null) => void;
    customClickBehavior: (d: Datum | null) => void;
    /** Stable ID for this chart instance, used to suppress linked crosshair on source chart */
    crosshairSourceId: string;
};
/**
 * Compute crosshair props for StreamXYFrame from linkedHover config.
 * Returns undefined when linkedHover is not in x-position mode.
 */
export declare function getCrosshairProps(linkedHover: unknown, crosshairSourceId: string): {
    linkedCrosshairName: string;
    linkedCrosshairSourceId: string;
} | undefined;
/**
 * Hook to create a legend and compute margins with legend-aware adjustment.
 * Consolidates the shouldShowLegend / createLegend / margin merge / right-margin
 * expansion pattern that every chart with color encoding repeats.
 */
export type LegendPosition = "right" | "left" | "top" | "bottom";
export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, legendPosition, userMargin, defaults, categories, }: {
    data: Array<Datum>;
    colorBy: Accessor<string> | undefined;
    colorScale: ((v: string) => string) | undefined;
    showLegend: boolean | undefined;
    legendPosition?: LegendPosition;
    userMargin: PartialMargin | undefined;
    defaults?: MarginType;
    categories?: string[];
}): {
    legend: ReturnType<typeof createLegend> | undefined;
    margin: MarginType;
    legendPosition: LegendPosition;
};
export type LegendInteractionMode = "highlight" | "isolate" | "none";
export interface LegendInteractionState {
    highlightedCategory: string | null;
    isolatedCategories: Set<string>;
    onLegendHover: (item: {
        label: string;
    } | null) => void;
    onLegendClick: (item: {
        label: string;
    }) => void;
    /** Selection predicate that dims non-matching data — use with wrapStyleWithSelection */
    legendSelectionHook: {
        isActive: boolean;
        predicate: (d: Datum) => boolean;
    } | null;
}
/**
 * Hook managing legend highlight/isolate interaction.
 * - "highlight": hover over a legend item produces a selection hook that
 *   `wrapStyleWithSelection` uses to dim non-matching data. The actual
 *   dim opacity resolves in this order: per-chart
 *   `selection.unselectedOpacity` → `theme.colors.selectionOpacity` →
 *   `DEFAULT_SELECTION_OPACITY` fallback.
 * - "isolate": click toggles category visibility; click all to reset
 */
export declare function useLegendInteraction(mode: LegendInteractionMode | undefined, colorBy: string | ((d: Datum) => string) | undefined, allCategories: string[]): LegendInteractionState;
interface ChartModeInput {
    width?: number;
    height?: number;
    showAxes?: boolean;
    showGrid?: boolean;
    enableHover?: boolean;
    showLegend?: boolean;
    showLabels?: boolean;
    showCategoryTicks?: boolean;
    /** "vertical" | "horizontal" — used to shrink the category-axis margin when showCategoryTicks is false */
    orientation?: string;
    title?: string;
    description?: string;
    summary?: string;
    accessibleTable?: boolean;
    xLabel?: string;
    yLabel?: string;
    categoryLabel?: string;
    valueLabel?: string;
    /** When truthy, enableHover is forced true regardless of mode (LinkedCharts needs hover) */
    linkedHover?: any;
}
interface ChartModeResult {
    width: number;
    height: number;
    showAxes: boolean;
    showGrid: boolean;
    enableHover: boolean;
    showLegend: boolean | undefined;
    showLabels: boolean | undefined;
    title: string | undefined;
    description: string | undefined;
    summary: string | undefined;
    accessibleTable: boolean | undefined;
    xLabel: string | undefined;
    yLabel: string | undefined;
    categoryLabel: string | undefined;
    valueLabel: string | undefined;
    marginDefaults: {
        top: number;
        bottom: number;
        left: number;
        right: number;
    };
    /** True when mode is context or sparkline — the "hide interactive chrome" union. */
    compactMode: boolean;
}
/**
 * Resolve chart display mode into concrete prop defaults.
 * User-provided values always override mode defaults.
 */
export declare function useChartMode(mode: ChartMode | undefined, userProps: ChartModeInput, primaryDefaults?: {
    width?: number;
    height?: number;
}): ChartModeResult;
/**
 * Resolve the `animate` prop into a `TransitionConfig` for Stream Frames.
 * Returns undefined when animate is falsy (no transition).
 */
export declare function resolveAnimateConfig(animate: boolean | {
    duration?: number;
    easing?: "linear" | "ease-out";
} | undefined): TransitionConfig | undefined;
export {};
