import * as react from 'react';
import { ReactNode, JSX, Context, DependencyList, useEffect, useLayoutEffect, useInsertionEffect, RefObject, CSSProperties, ComponentProps } from 'react';
import { A as AsyncEffect, R as ResizeEffect } from './types-CTCdwkaN.js';
import { R as ResizeOptions } from './ui-utils-CEm626XG.js';
import * as react_jsx_runtime from 'react/jsx-runtime';
import { b as EventListener } from './event-eVGLSgY3.js';

declare function HistoryContextProvider({ children, maxAge, }: {
    children?: ReactNode;
    maxAge: number;
}): JSX.Element;

declare function useRedoHistory(): readonly [boolean, () => void];

declare function useResetHistory(): () => void;

declare function useUndoHistory(): readonly [boolean, () => void];

type ReverseAction = () => void;
type ForwardAction = () => ReverseAction;

declare function useWriteHistory(): (forwardAction: ForwardAction) => void;

type GetState<T extends object> = (prevState: T) => Partial<T>;
type NextState<T extends object> = Partial<T> | GetState<T>;
type SetState<T extends object> = (param: NextState<T>) => void;
type StateContextType<T extends object> = [state: T, setState: SetState<T>];

declare function createStateContext<T extends object>(): react.Context<StateContextType<T>>;

type StateOf<C> = C extends Context<StateContextType<infer R>> ? R : never;
declare function StateContextProvider<Contexts extends readonly Context<StateContextType<any>>[]>({ contexts, values, children, }: {
    contexts: Contexts;
    values: {
        [i in keyof Contexts]: Partial<StateOf<Contexts[i]>>;
    };
    children?: ReactNode;
}): JSX.Element;

declare function useAsyncEffect(getEffect: () => AsyncEffect, deps?: DependencyList, useEffectCaller?: typeof useEffect | typeof useLayoutEffect | typeof useInsertionEffect): void;

declare function useDeps(deps: DependencyList | undefined): number;

declare function useElementResizeEffect(effect: ResizeEffect, divRef: RefObject<HTMLElement | SVGElement | null>, options?: ResizeOptions): void;

declare function useCallbackOnce<Args extends unknown[]>(effect: (...args: Args) => unknown, deps?: DependencyList): (...args: Args) => unknown;

declare function useMemoObjectDeep<T extends object | undefined | null>(obj: T): T;

declare function useMemoObjectShallow<T extends object | undefined | null>(obj: T): T;

declare function useUpdatingRef<T>(value: T): react.RefObject<T>;

declare function Popup({ className, style, }: {
    className?: string;
    style?: CSSProperties;
}): JSX.Element;

declare function PopupContextProvider({ children }: {
    children?: ReactNode;
}): JSX.Element;

declare function usePopupIsPersistent(): boolean;

declare function useSetPopup(): (popup: ReactNode, isPersistent?: boolean) => void;

declare function LoadingContextProvider({ children }: {
    children?: ReactNode;
}): JSX.Element;

type TaskDestructor = (() => void | Promise<void>) | void;
type Task = () => TaskDestructor | Promise<TaskDestructor>;
type TaskOptions = {
    minimumElapsedTime?: number | undefined;
};

declare function useAddLoadingTask(): (task: Task, { minimumElapsedTime }?: TaskOptions) => () => void;

declare function useLoadingEffect(getTask: () => Task, deps: DependencyList, { minimumElapsedTime }?: TaskOptions): void;

declare function useLoadingMemo<T>(getCreator: () => () => Promise<T>, deps: DependencyList, { minimumElapsedTime }?: TaskOptions): T | null;

declare function useLoadingStatus(): readonly [{
    readonly isLoading: boolean;
    readonly progress: number;
    readonly message: ReactNode;
}, (status: {
    progress?: number;
    message?: ReactNode;
}) => void];

declare function _Dropdown({ children, autoExpand, }: {
    children?: ReactNode;
    autoExpand?: boolean;
}): JSX.Element;
declare function DropdownWithContext(props: ComponentProps<typeof _Dropdown>): JSX.Element;

type ExpandPosition = "bottom-left" | "bottom-right" | "right" | "left";

declare function DropdownExpand({ children, persistOnClick, expandPos, minClientMargin, className, }: {
    children?: ReactNode;
    persistOnClick?: boolean;
    expandPos?: ExpandPosition;
    minClientMargin?: number | string;
    className?: string;
}): JSX.Element;

declare function _DropdownGroup({ children }: {
    children?: ReactNode;
}): JSX.Element;
declare function DropdownGroupWithContext(props: ComponentProps<typeof _DropdownGroup>): JSX.Element;

type DragOptions = {
    minWait?: number;
};
type DragEffect = (start: [number, number], end: [number, number]) => void;
declare function useDrag(elemRef: RefObject<HTMLElement | null>, effect: DragEffect, options?: DragOptions): readonly [boolean, [number, number] | null, [number, number] | null];

type TabId = string | number;

declare function Window({ activeTabId, onTabChanged, children, }: {
    activeTabId?: TabId | null;
    onTabChanged?: (id: TabId) => void;
    children?: ReactNode;
}): JSX.Element;

declare function Tab({ tabId, children }: {
    tabId: TabId;
    children?: ReactNode;
}): JSX.Element;

declare function WindowTabContent({ forTab, children, }: {
    forTab: TabId;
    children?: ReactNode;
}): JSX.Element;

type URLSearchParamsLike = string | URLSearchParams | [string, string][] | Record<string, string>;
declare function useSearchParams(): readonly [URLSearchParams, (params: URLSearchParamsLike | ((p: URLSearchParams) => URLSearchParamsLike), { removeParams, }?: {
    removeParams?: string[];
}) => void];

declare function useClientSize(w?: number, h?: number): readonly [number, number];

interface VirtualListProps {
    containerRef: RefObject<HTMLElement | null>;
    itemCount: number;
    itemHeight: number;
    overscan?: number;
    scrollTo?: number | null;
    renderItem: (index: number) => React.ReactNode;
}
declare function VirtualList({ containerRef, itemCount, itemHeight, overscan, scrollTo, renderItem, }: VirtualListProps): react_jsx_runtime.JSX.Element;

type Dataset = {
    name: string;
    x: number[];
    y: number[];
    color?: string;
};
type AxisLayout = {
    min: number;
    max: number;
    useLog: boolean;
};
type EventType = "mousemove" | "mousedown" | "mouseup" | "mouseleave";
type EventParams = {
    x: number;
    y: number;
};
type EventMap = {
    mousemove: EventParams;
    mousedown: EventParams;
    mouseup: void;
    mouseleave: void;
};

declare function Chart_({ children, data, layout: { margin, marginLeft, marginRight, marginTop, marginBottom, xAxis, yAxis, }, }: {
    data: Dataset[];
    layout?: {
        margin?: number;
        marginLeft?: number;
        marginRight?: number;
        marginTop?: number;
        marginBottom?: number;
        xAxis?: Partial<AxisLayout>;
        yAxis?: Partial<AxisLayout>;
    };
    children?: ReactNode;
}): react_jsx_runtime.JSX.Element;
declare function Chart(props: ComponentProps<typeof Chart_>): react_jsx_runtime.JSX.Element;

declare function Axis({ dim, interval, tickSize, className, children, stroke, strokeWidth, }: {
    dim: "x" | "y";
    interval: number;
    tickSize: number;
    className?: string;
    children?: ReactNode;
    stroke?: string;
    strokeWidth?: number;
}): react_jsx_runtime.JSX.Element;

declare function AxisTitle({ title, className, }: {
    title?: string;
    className?: string;
}): react_jsx_runtime.JSX.Element;

declare function GridLines({ className, stroke, strokeWidth, }: {
    className?: string;
    stroke?: string;
    strokeWidth?: number;
}): react_jsx_runtime.JSX.Element;

declare function TickLabels({ className, overrideLabels, }: {
    className?: string;
    overrideLabels?: (v: number, x: number, y: number) => ReactNode;
}): react_jsx_runtime.JSX.Element[];

declare function Line({ datasetName, className, strokeWidth, }: {
    datasetName: string;
    className?: string;
    strokeWidth?: number;
}): false | react_jsx_runtime.JSX.Element | undefined;

declare function Bar({ datasetNames, className, strokeWidth, gap, mode, anchorDataset, hoverStroke, hoverStrokeWidth, dimOpacity, }: {
    datasetNames: string[];
    className?: string;
    strokeWidth?: number;
    gap?: number;
    mode?: "grouped" | "stacked";
    anchorDataset?: string;
    hoverStroke?: string;
    hoverStrokeWidth?: number;
    dimOpacity?: number;
}): react_jsx_runtime.JSX.Element[] | null;

declare function Legend({ lineHeight, padding, xAnchor, yAnchor, fill, stroke, strokeWidth, }: {
    lineHeight: number;
    padding: number;
    xAnchor?: number;
    yAnchor?: number;
    fill?: string;
    stroke?: string;
    strokeWidth?: number;
}): react_jsx_runtime.JSX.Element;

declare function BoxAnnotation({ x, y, padding, xAnchor, yAnchor, className, fill, stroke, strokeWidth, children, }: {
    x: number;
    y: number;
    padding: number;
    xAnchor: number;
    yAnchor: number;
    className?: string;
    fill?: string;
    stroke?: string;
    strokeWidth?: number;
    children?: ReactNode;
}): react_jsx_runtime.JSX.Element;

declare function VLineAnnotation({ className, x, stroke, strokeWidth, }: {
    x: number;
    className?: string;
    stroke?: string;
    strokeWidth?: number;
}): react_jsx_runtime.JSX.Element;

declare function HLineAnnotation({ className, y, stroke, strokeWidth, }: {
    y: number;
    className?: string;
    stroke?: string;
    strokeWidth?: number;
}): react_jsx_runtime.JSX.Element;

declare function CircleAnnotation({ cx, cy, r, className, stroke, strokeWidth, fill, }: {
    cx: number;
    cy: number;
    r: number;
    className?: string;
    stroke?: string;
    strokeWidth?: number;
    fill?: string;
}): react_jsx_runtime.JSX.Element;

declare function Area({ datasetName, baseline, fill, fillOpacity, stroke, strokeWidth, className, }: {
    datasetName: string;
    baseline?: number;
    fill?: string;
    fillOpacity?: number;
    stroke?: string;
    strokeWidth?: number;
    className?: string;
}): react_jsx_runtime.JSX.Element | null;

declare function Crosshair({ anchorDataset, className, stroke, strokeWidth, dotRadius, }: {
    anchorDataset?: string;
    className?: string;
    stroke?: string;
    strokeWidth?: number;
    dotRadius?: number;
}): react_jsx_runtime.JSX.Element | null;

declare function Tooltip({ anchorDataset, offsetX, offsetY, renderRow, className, style, }: {
    anchorDataset?: string;
    offsetX?: number;
    offsetY?: number;
    renderRow?: (name: string, x: number, y: number, color?: string) => ReactNode;
    className?: string;
    style?: React.CSSProperties;
}): react.ReactPortal | null;

declare function useChartProjectX(): (x: number) => number;

declare function useChartProjectY(): (y: number) => number;

declare function useAxisParams(axis: "x" | "y"): AxisLayout;

declare function useChartEvent<Type extends EventType>(type: Type, listener: EventListener<EventMap, Type>): void;

type Snap = {
    x: number;
    perSeriesY: Record<string, number>;
};
declare function useChartSnap(anchorDataset?: string): Snap | null;

export { Chart, Area as ChartArea, Axis as ChartAxis, type AxisLayout as ChartAxisLayout, AxisTitle as ChartAxisTitle, Bar as ChartBar, BoxAnnotation as ChartBoxAnnotation, CircleAnnotation as ChartCircleAnnotation, Crosshair as ChartCrosshair, type Dataset as ChartDataset, type EventMap as ChartEventMap, type EventType as ChartEventType, GridLines as ChartGridLines, HLineAnnotation as ChartHLineAnnotation, Legend as ChartLegend, Line as ChartLine, TickLabels as ChartTickLabels, Tooltip as ChartTooltip, VLineAnnotation as ChartVLineAnnotation, DropdownWithContext as Dropdown, DropdownExpand, DropdownGroupWithContext as DropdownGroup, HistoryContextProvider, LoadingContextProvider, Popup, PopupContextProvider, StateContextProvider, VirtualList, Window, Tab as WindowTab, WindowTabContent, createStateContext, useAddLoadingTask, useAsyncEffect, useCallbackOnce, useAxisParams as useChartAxisParams, useChartEvent, useChartProjectX, useChartProjectY, useChartSnap, useClientSize, useDeps, useDrag, useElementResizeEffect, useLoadingEffect, useLoadingMemo, useLoadingStatus, useMemoObjectDeep, useMemoObjectShallow, usePopupIsPersistent, useRedoHistory, useResetHistory, useSearchParams, useSetPopup, useUndoHistory, useUpdatingRef, useWriteHistory };
