From 48e32a92e7cd577442b3f1704548fb09d5ae7ba7 Mon Sep 17 00:00:00 2001 From: Gonzalo D'Elia Date: Wed, 16 Oct 2019 18:54:37 -0300 Subject: [PATCH] Upgraded types to latest version: Added id field for Bar, Line, Scatter, Area and properties gap and leaveTimeOut in Brush (#38680) --- types/recharts/index.d.ts | 9 ++++++++- types/recharts/recharts-tests.tsx | 31 +++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index c527465e46..304243f539 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Recharts 1.1 +// Type definitions for Recharts 1.7 // Project: http://recharts.org/, https://github.com/recharts/recharts // Definitions by: Raphael Mueller // Roy Xue @@ -14,6 +14,7 @@ // Leon Ng // Dave Vedder // Konstantin Azizov +// Gonzalo Nicolas D'Elia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -192,6 +193,7 @@ export interface AreaProps extends EventAttributes, Partial { } @@ -233,6 +235,7 @@ export interface BarProps extends EventAttributes, Partial | object; // see label section at http://recharts.org/#/en-US/api/Bar label?: boolean | Label | LabelProps | React.SFC | React.ReactElement | ContentRenderer; + id?: string; } export class Bar extends React.Component { } @@ -260,6 +263,8 @@ export interface BrushProps { children?: React.ReactNode; onChange?: RechartsFunction; updateId?: string | number; + gap?: number; + leaveTimeOut?: number; } export class Brush extends React.Component { } @@ -434,6 +439,7 @@ export interface LineProps extends EventAttributes, Partial; points?: Point[]; + id?: string; } export class Line extends React.Component { } @@ -772,6 +778,7 @@ export interface ScatterProps extends EventAttributes, Partial; dataKey?: DataKey; name?: string | number; + id?: string; } export class Scatter extends React.Component { } diff --git a/types/recharts/recharts-tests.tsx b/types/recharts/recharts-tests.tsx index 56eff54aa6..622f142d5a 100644 --- a/types/recharts/recharts-tests.tsx +++ b/types/recharts/recharts-tests.tsx @@ -5,7 +5,7 @@ import { CartesianGrid, Line, LineChart, PieChart, Pie, Sector, XAxis, YAxis, Tooltip, ReferenceLine, ReferenceArea, ResponsiveContainer, Label, LabelList, Brush, - ScatterChart, ZAxis, Legend, Scatter, Bar, BarChart, Text + ScatterChart, ZAxis, Legend, Scatter, Bar, BarChart, Text, Area, AreaChart } from 'recharts'; interface ComponentState { @@ -103,9 +103,11 @@ class Component extends React.Component<{}, ComponentState> { - + + + { - + @@ -201,7 +203,7 @@ class Component extends React.Component<{}, ComponentState> { + + + + + + + + + + + + + + + + + + + + ); }