import type { Ref, RefObject, ReactElement, ReactNode } from "react";
import { useChartMode } from "./hooks";
import { type ChartSetupResult } from "./useChartSetup";
import type { ChartMode, SelectionConfig, LinkedHoverProp } from "./types";
import type { OnObservationCallback } from "../../store/ObservationStore";
import { type PartialMargin, type MarginType } from "../../types/marginType";
import type { Datum } from "./datumTypes";
import type { RealtimeFrameHandle } from "../../realtime/types";
/**
 * Margin shorthand → sided form. The Stream*Frame margin props only
 * accept the sided object form, so HOCs that expose the user-friendly
 * number shorthand have to expand it themselves. Centralized here so
 * every custom-layout HOC normalizes consistently.
 */
export declare function normalizeUserMargin(m: PartialMargin | undefined): Partial<MarginType> | undefined;
interface ScaffoldOptions {
    /** Ref forwarded by the HOC. The hook binds the imperative handle internally. */
    imperativeRef: Ref<RealtimeFrameHandle> | undefined;
    /** Which `useFrameImperativeHandle` variant to bind. XY/ordinal frames share "xy". */
    imperativeVariant: "xy" | "network";
    /** Margin shorthand or sided form from the HOC's `margin` prop. */
    margin: PartialMargin | undefined;
    width?: number;
    height?: number;
    showGrid?: boolean;
    enableHover?: boolean;
    showLegend?: boolean;
    title?: string;
    mode?: ChartMode;
    xLabel?: string;
    yLabel?: string;
}
interface ScaffoldResult<TFrameHandle> {
    /** Ref to attach to the inner Stream*Frame component. */
    frameRef: RefObject<TFrameHandle | null>;
    /** Result of `useChartMode` — width/height/showGrid/etc. with mode defaults applied. */
    resolved: ReturnType<typeof useChartMode>;
    /** User margin normalized to the sided form, or undefined if not supplied. */
    normalizedMargin: Partial<MarginType> | undefined;
}
/**
 * Scaffold shared by all three custom-layout HOCs: imperative-handle
 * binding, chart-mode resolution, margin normalization. Network HOCs
 * stop here; data-shaped HOCs layer `useChartSetup` on top via
 * `useCustomChartSetup`.
 */
export declare function useCustomChartScaffold<TFrameHandle>(options: ScaffoldOptions): ScaffoldResult<TFrameHandle>;
interface DataSetupOptions extends ScaffoldOptions {
    /** Raw `data` prop from the HOC (may be undefined in push mode). */
    data: Datum[] | undefined;
    /** Label used by useChartSetup for observation events ("XYCustomChart", "OrdinalCustomChart"). */
    chartTypeLabel: string;
    /** Whether the hover callback should unwrap the datum (ordinal/network = true, XY = false). */
    unwrapData: boolean;
    /** Color scheme threaded into useChartSetup's color resolution. */
    colorScheme?: string | string[];
    /** Pass-through chart-setup inputs. */
    selection?: SelectionConfig;
    linkedHover?: LinkedHoverProp;
    onObservation?: OnObservationCallback;
    onClick?: (datum: any, ev: {
        x: number;
        y: number;
    }) => void;
    chartId?: string;
    loading?: boolean;
    loadingContent?: ReactNode | false;
    emptyContent?: ReactNode;
}
interface DataSetupResult<TFrameHandle> extends ScaffoldResult<TFrameHandle> {
    /** Sparse-filtered copy of the input data array. */
    safeData: Datum[];
    /** Full `useChartSetup` result — selection/legend/behavior wiring for the streamProps. */
    setup: ChartSetupResult;
    /** If non-null, the HOC should render this immediately (loading skeleton or empty state). */
    earlyReturn: ReactElement | null;
}
/**
 * Scaffold + `useChartSetup` wiring for the data-shaped custom-layout
 * HOCs (`XYCustomChart`, `OrdinalCustomChart`). Each HOC stays in charge
 * of its own frame-specific streamProps; the hook only owns the
 * orchestration that is genuinely identical.
 */
export declare function useCustomChartSetup<TFrameHandle>(options: DataSetupOptions): DataSetupResult<TFrameHandle>;
export {};
