diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index 661d72c1aa..aac323179f 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -146,7 +146,7 @@ export interface CartesianAxisProps { width?: number; height?: number; orientation?: 'top' | 'bottom' | 'left' | 'right'; - viewBox?: any; + viewBox?: ViewBox; axisLine?: boolean | any; tickLine?: boolean | any; minTickGap?: number; @@ -537,9 +537,9 @@ export interface ReferenceAreaProps { y1?: number | string; y2?: number | string; alwaysShow?: boolean; - viewBox: any; - xAxis: any; - yAxis: any; + viewBox?: ViewBox; + xAxis?: any; + yAxis?: any; label?: string | number | React.ReactElement | RechartsFunction; isFront?: boolean; } @@ -574,9 +574,9 @@ export interface ReferenceLineProps { x?: number | string; y?: number | string; alwaysShow?: boolean; - viewBox: any; - xAxis: any; - yAxis: any; + viewBox?: ViewBox; + xAxis?: any; + yAxis?: any; label?: string | number | React.ReactElement | RechartsFunction; isFront?: boolean; } @@ -685,7 +685,7 @@ export interface TooltipProps { wrapperStyle?: any; labelStyle?: any; cursor?: boolean | any | React.ReactElement | React.StatelessComponent; - viewBox: ViewBox; + viewBox?: ViewBox; active?: boolean; coordinate?: Coordinate; payload?: TooltipPayload[]; @@ -713,7 +713,7 @@ export interface TreemapProps { } export interface Label { - viewBox?: any; + viewBox?: ViewBox; formatter?: RechartsFunction; value: string | number; position?: PositionType; diff --git a/types/recharts/recharts-tests.tsx b/types/recharts/recharts-tests.tsx index ddbbbe95f6..5c370e042c 100644 --- a/types/recharts/recharts-tests.tsx +++ b/types/recharts/recharts-tests.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import { CartesianGrid, Line, LineChart, XAxis, YAxis } from 'recharts'; +import { CartesianGrid, Line, LineChart, XAxis, YAxis, Tooltip, ReferenceLine, ReferenceArea } from 'recharts'; const Component = (props: {}) => { const data = [ @@ -21,6 +21,9 @@ const Component = (props: {}) => { + + + ); };