import type { RefObject, MutableRefObject } from "react";
import type { StreamOrdinalFrameHandle } from "../../stream/ordinalTypes";
import type { Datum } from "./datumTypes";
export interface AggregatedRow {
    __likertCategory: string;
    /** Stacking key — may be sentinel value for neutral halves */
    __likertLevel: string;
    /** Human-readable level label — always the original level name (for legend/selection) */
    __likertLevelLabel: string;
    __likertCount: number;
    __likertPct: number;
    __likertLevelIndex: number;
}
/** Sentinel level names for the neutral split halves */
export declare const NEUTRAL_NEG = "__likert_neutral_neg";
export declare const NEUTRAL_POS = "__likert_neutral_pos";
export declare function resolveAccessorFn<T>(accessor: string | ((d: Datum) => T) | undefined, fallback: string): (d: Datum) => T;
/**
 * Generate a diverging color scheme for N levels.
 *
 * Two paths:
 *   • `themeDivergingSchemeName` supplied → sample the named d3-scale-chromatic
 *     diverging interpolator at N evenly-spaced positions. Gives consumers the
 *     ability to change the palette by changing the active theme's
 *     `colors.diverging` string, without touching chart code.
 *   • No scheme name → the original Carbon-inspired hardcoded palette
 *     (preserves exact pre-theming behavior for consumers without a
 *     ThemeProvider, and for custom themes that don't declare `diverging`).
 *
 * Interpolates from red → gray → blue for odd, red → blue for even.
 */
export declare function defaultDivergingScheme(n: number, themeDivergingSchemeName?: string): string[];
export declare function aggregateData(data: any[], levels: string[], getCat: (d: Datum) => string, getScore: ((d: Datum) => number) | null, getLevel: ((d: Datum) => string) | null, getCount: ((d: Datum) => number) | null): AggregatedRow[];
export declare function toDivergingValues(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
export declare function orderForDiverging(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
interface UseLikertAggregationConfig {
    data: any[] | undefined;
    levels: string[];
    categoryAccessor?: string | ((d: Datum) => string);
    valueAccessor?: string | ((d: Datum) => number);
    levelAccessor?: string | ((d: Datum) => string);
    countAccessor?: string | ((d: Datum) => number);
    isDiverging: boolean;
    frameRef: RefObject<StreamOrdinalFrameHandle | null>;
}
interface UseLikertAggregationResult {
    /** Pre-processed data for static mode */
    processedData: AggregatedRow[];
    /** Re-aggregate all accumulated data (call from push handlers) */
    reAggregate: (rawData: any[]) => void;
    /** Ref holding accumulated raw data for push mode */
    accumulatorRef: MutableRefObject<any[]>;
}
/**
 * Encapsulates Likert-specific data aggregation:
 * - Resolves accessor functions
 * - Aggregates raw/pre-aggregated data to percentages
 * - Applies diverging transforms (sign flip, neutral split, stacking order)
 * - Provides re-aggregation callback for push API streaming
 */
export declare function useLikertAggregation({ data, levels, categoryAccessor, valueAccessor, levelAccessor, countAccessor, isDiverging, frameRef, }: UseLikertAggregationConfig): UseLikertAggregationResult;
export {};
