import * as React from 'react'; import type { ColorValue, StyleProp, ViewStyle } from 'react-native'; import type { SvgProps } from 'react-native-svg'; import type { ChartDefinition, ChartPoint, ChartScene, ChartTextMeasurer, ChartTextTypography, ChartTooltipInput, ChartValue } from '@tanstack/charts/types'; import { type NativePaintResolver } from './paint.js'; import type { NativeChartTooltipRenderContext } from './Tooltip.js'; export interface NativeChartRenderContext { scene: ChartScene; } export interface ChartProps = ChartDefinition> { definition: TDefinition & NativeTooltipCompatibility; accessibilityLabel: string; accessibilityHint?: string; width?: number; height?: number; aspectRatio?: number; style?: StyleProp; color?: ColorValue; focusFill?: ColorValue; fontFamily?: string; fontStyle?: SvgProps['fontStyle']; fontStretch?: SvgProps['fontStretch']; letterSpacing?: number; direction?: ChartTextTypography['direction']; locale?: string; fontScale?: number; idPrefix?: string; testID?: string; measureText?: ChartTextMeasurer; resolvePaint?: NativePaintResolver; onFocusChange?: (point: ChartPoint | null) => void; onFocusGroupChange?: (points: readonly ChartPoint[]) => void; onSelect?: (point: ChartPoint | null) => void; onRender?: (context: NativeChartRenderContext) => void; renderTooltip?: (context: NativeChartTooltipRenderContext) => React.ReactNode; } type DefinitionDatum = TDefinition extends { readonly __datum?: infer TDatum; } ? TDatum : unknown; type DefinitionXValue = TDefinition extends { readonly __xValue?: infer TXValue extends ChartValue; } ? TXValue : ChartValue; type DefinitionYValue = TDefinition extends { readonly __yValue?: infer TYValue extends ChartValue; } ? TYValue : ChartValue; export declare function Chart>(props: ChartProps, DefinitionXValue, DefinitionYValue, TDefinition>): React.JSX.Element; type NativeTooltipCompatibility = TDefinition extends { tooltip: infer TTooltip; } ? TTooltip extends false | ChartTooltipInput ? unknown : never : unknown; export {};