[recharts] add state for Tooltip, Legend and ResponsiveContainer (#36854)

This commit is contained in:
Konstantin Azizov 2019-07-16 22:23:35 +02:00 committed by Andrew Branch
parent 312461a4d9
commit b6a240ce84

View File

@ -13,6 +13,7 @@
// Kosaku Kurino <https://github.com/kousaku-maron>
// Leon Ng <https://github.com/iflp>
// Dave Vedder <https://github.com/veddermatic>
// Konstantin Azizov <https://github.com/g07cha>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@ -61,6 +62,16 @@ export type PickedCSSStyleDeclarationKeys =
'stopColor' | 'strokeDasharray' | 'strokeLinecap' | 'strokeLinejoin' | 'textAnchor' |
'textDecoration' | 'unicodeBidi' | 'visibility' | 'writingMode' | 'transform';
export interface BoxSize {
boxWidth: number;
boxHeight: number;
}
export interface ContainerSize {
containerWidth: number;
containerHeight: number;
}
export interface Point {
x: number;
y: number;
@ -398,7 +409,7 @@ export interface LegendProps {
onBBoxUpdate?: BBoxUpdateCallback;
}
export class Legend extends React.Component<LegendProps> { }
export class Legend extends React.Component<LegendProps, BoxSize> {}
export interface LineProps extends EventAttributes, Partial<PresentationAttributes>, Animatable {
className?: string;
@ -731,7 +742,7 @@ export interface ResponsiveContainerProps {
className?: string | number;
}
export class ResponsiveContainer extends React.Component<ResponsiveContainerProps> { }
export class ResponsiveContainer extends React.Component<ResponsiveContainerProps, ContainerSize> {}
export interface ScatterPoint {
cx?: number;
@ -840,14 +851,14 @@ export interface TooltipProps extends Animatable {
coordinate?: Coordinate;
position?: Coordinate;
label?: string | number;
labelFormatter?: LabelFormatter;
labelFormatter?: LabelFormatter;
payload?: TooltipPayload[];
itemSorter?: ItemSorter<TooltipPayload>;
filterNull?: boolean;
useTranslate3d?: boolean;
}
export class Tooltip extends React.Component<TooltipProps> { }
export class Tooltip extends React.Component<TooltipProps, BoxSize> {}
export interface TreemapProps extends EventAttributes, Animatable {
width?: number;