import type { Datum } from "./datumTypes";
import type { Accessor, ChartAccessor } from "./types";
import type { SelectionHookResult } from "./selectionUtils";
export interface OrdinalPieceStyleOptions {
    /** colorBy accessor — string field name or function */
    colorBy?: Accessor<string> | ChartAccessor<Datum, string>;
    /** Resolved categorical color scale (typically from useChartSetup). */
    colorScale: ((v: string) => string) | undefined;
    /** Top-level uniform `color` prop (BaseChartProps). Applied as a
     *  default-fill primitive when `colorBy` is unset. */
    color?: string;
    /** Theme categorical palette (from useThemeCategorical). */
    themeCategorical: string[] | undefined;
    /** colorScheme prop — array or string scheme name. */
    colorScheme?: string | string[];
    /** Stable category-index map for default-fill cycling. */
    categoryIndexMap: Map<string, number>;
    /** User-supplied `frameProps.pieceStyle`. Accepts the looser
     *  Frame-side `Style` type (typed fields like `fill: string`) or a
     *  function returning the same shape; we don't pin a stricter
     *  contract here because every ordinal HOC re-types pieceStyle
     *  via its own props interface. */
    userPieceStyle?: ((d: Datum, category?: string) => Record<string, unknown>) | Record<string, unknown> | unknown;
    /** Top-level primitive props — applied last so they win over HOC base + user overlay. */
    stroke?: string;
    strokeWidth?: number;
    opacity?: number;
    /**
     * Chart-shape defaults applied BEFORE the color resolution and
     * user overlay. Use for properties that are intrinsic to the
     * chart's mark shape (point radius `r`, fillOpacity for swarms /
     * dots, etc.). User-supplied `frameProps.pieceStyle` and top-level
     * primitive props can still override them.
     *
     * Static object form for shape-constant defaults
     * (`{ r: dotRadius, fillOpacity: 0.8 }` — DotPlot). Function form
     * for per-datum derivation (`(d) => ({ r: sizeBy ? getSize(d, ...) :
     * pointRadius })` — SwarmPlot's size-encoded points). The function
     * receives the same `(d, category)` args as user pieceStyle.
     */
    baseStyleExtras?: Record<string, string | number | undefined> | ((d: Datum, category?: string) => Record<string, string | number | undefined>);
    /**
     * After the base fill is resolved, also write it to `stroke`.
     * Used by statistical-summary charts (BoxPlot / ViolinPlot /
     * RidgelinePlot / Histogram) where the box outline should match
     * the box fill rather than be a separate stroke. Top-level
     * primitive `stroke` still wins via `mergeShapeStyle` if supplied.
     */
    linkStrokeToFill?: boolean;
    /**
     * When `colorBy` is unset, pass the per-piece `category` to
     * `resolveDefaultFill` so each piece cycles through the
     * colorScheme's palette (Pie / Donut / Funnel / radial charts —
     * each slice/wedge wants its own color).
     *
     * When `false` (default), the category arg is omitted and
     * `resolveDefaultFill` returns the first scheme color uniformly
     * (BarChart / StackedBarChart / GroupedBarChart — bars without
     * `colorBy` should be one color, since the user picked
     * `categoryAccessor` but explicitly didn't ask for category-driven
     * coloring). Locked by `bugRepros.test.tsx` BR-2.
     */
    cycleByCategory?: boolean;
    /** Selection hook output (typically `setup.effectiveSelectionHook`). */
    effectiveSelectionHook: SelectionHookResult | null | undefined;
    /** Resolved selection config (typically `setup.resolvedSelection`). */
    resolvedSelection: import("./types").SelectionConfig | undefined;
}
/**
 * Build a memoized `pieceStyle` function that the chart can pass
 * straight to `<StreamOrdinalFrame pieceStyle={…} />`. Composes the
 * standard base-fill / user-overlay / primitive-prop / selection
 * pipeline so each HOC doesn't re-derive it.
 *
 * @example
 * ```tsx
 * const pieceStyle = useOrdinalPieceStyle({
 *   colorBy, colorScale: setup.colorScale,
 *   color, themeCategorical, colorScheme, categoryIndexMap,
 *   userPieceStyle: frameProps?.pieceStyle,
 *   stroke, strokeWidth, opacity,
 *   effectiveSelectionHook: setup.effectiveSelectionHook,
 *   resolvedSelection: setup.resolvedSelection,
 * })
 * ```
 */
export declare function useOrdinalPieceStyle(options: OrdinalPieceStyleOptions): (d: Datum, category?: string) => Record<string, string | number | undefined>;
