import * as React from "react"; import { type CanvasRef } from "@shopify/react-native-skia"; import { type ComposedGesture } from "react-native-gesture-handler"; import { type MutableRefObject } from "react"; import type { ScaleLinear } from "d3-scale"; import type { AxisProps, CartesianChartRenderArg, InputFields, NumericalFields, SidedNumber, ChartBounds, YAxisInputProps, XAxisInputProps, FrameInputProps, ChartPressPanConfig, Viewport, GestureHandlerConfig } from "../types"; import type { ChartPressState, ChartPressStateInit } from "./hooks/useChartPressState"; import { type ChartTransformState } from "./hooks/useChartTransformState"; import { type PanTransformGestureConfig, type PinchTransformGestureConfig } from "./utils/transformGestures"; export type CartesianActionsHandle = T extends ChartPressState ? S extends ChartPressStateInit ? { handleTouch: (v: T, x: number, y: number) => void; } : never : never; export type CartesianChartRef = { canvas: CanvasRef | null; actions: CartesianActionsHandle; }; type CartesianChartProps, XK extends keyof InputFields, YK extends keyof NumericalFields> = { data: RawData[]; xKey: XK; yKeys: YK[]; padding?: SidedNumber; domainPadding?: SidedNumber; domain?: { x?: [number] | [number, number]; y?: [number] | [number, number]; }; viewport?: Viewport; chartPressState?: ChartPressState<{ x: InputFields[XK]; y: Record; }> | ChartPressState<{ x: InputFields[XK]; y: Record; }>[]; chartPressConfig?: { pan?: ChartPressPanConfig; }; gestureHandlerConfig?: GestureHandlerConfig; children: (args: CartesianChartRenderArg) => React.ReactNode; renderOutside?: (args: CartesianChartRenderArg) => React.ReactNode; axisOptions?: Partial, "xScale" | "yScale">>; onChartBoundsChange?: (bounds: ChartBounds) => void; onScaleChange?: (xScale: ScaleLinear, yScale: ScaleLinear) => void; /** * @deprecated This prop will eventually be replaced by the new `chartPressConfig`. For now it's being kept around for backwards compatibility sake. */ gestureLongPressDelay?: number; xAxis?: XAxisInputProps; yAxis?: YAxisInputProps[]; frame?: FrameInputProps; transformState?: ChartTransformState; transformConfig?: { pan?: PanTransformGestureConfig; pinch?: PinchTransformGestureConfig; }; customGestures?: ComposedGesture; actionsRef?: MutableRefObject[XK]; y: Record; }> | undefined> | null>; ref?: React.Ref[XK]; y: Record; }> | undefined>>; }; export declare function CartesianChart, XK extends keyof InputFields, YK extends keyof NumericalFields>({ transformState, children, ref, ...rest }: CartesianChartProps): React.JSX.Element; export {};