From e023c3998e2fc2103cbea173f34d65981c7a9150 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sun, 16 Jul 2017 21:21:10 +0200 Subject: [PATCH 1/5] Type definitions for Recharts --- types/recharts/README.MD | 4 + types/recharts/index.d.ts | 786 +++++++++++++++++++++++++++++ types/recharts/test/index.tsx | 19 + types/recharts/tsconfig.json | 24 + types/recharts/types-metadata.json | 25 + 5 files changed, 858 insertions(+) create mode 100644 types/recharts/README.MD create mode 100644 types/recharts/index.d.ts create mode 100644 types/recharts/test/index.tsx create mode 100644 types/recharts/tsconfig.json create mode 100644 types/recharts/types-metadata.json diff --git a/types/recharts/README.MD b/types/recharts/README.MD new file mode 100644 index 0000000000..063a6dab3c --- /dev/null +++ b/types/recharts/README.MD @@ -0,0 +1,4 @@ +Typings for [Recharts](http://recharts.org/), a composable charting library built on React components + +The [Recharts website](https://github.com/recharts/recharts.org) has comprehensive API documentation which is generated from JavaScript files. +Those files are used as input to generate these typings. diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts new file mode 100644 index 0000000000..ae37eced47 --- /dev/null +++ b/types/recharts/index.d.ts @@ -0,0 +1,786 @@ +// Type definitions for Recharts v0.22.1 +// Project: http://recharts.org/ +// Definitions by: Maarten Mulders +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import * as React from 'react'; + +type Function = () => any; +type Percentage = string; + +interface AreaProps { + type?: 'basis' | 'basisClosed' | 'basisOpen' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | Function, + dataKey?: string | number, + xAxisId?: string | number, + yAxisId?: string | number, + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', + dot?: Boolean | any | React.ReactElement | Function, + activeDot?: Boolean | any | React.ReactElement | Function, + label?: Boolean | any | React.ReactElement | Function, + stroke?: string, + layout?: 'horizontal' | 'vertical', + baseLine?: number | any[], + points?: any[], + stackId?: string | number, + connectNulls?: Boolean, + unit?: string | number, + name?: string | number, + isAnimationActive?: Boolean, + animationBegin?: number, + animationDuration?: number, + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class Area extends React.Component { +} + +interface AreaChartProps { + layout?: 'horizontal' | 'vertical', + syncId?: string, + width: number, + height: number, + data: any[], + margin?: any, + stackOffset?: 'expand' | 'none' | 'wiggle' | 'silhouette', + baseValue?: number | 'dataMin' | 'dataMax' | 'auto', + onClick?: Function, + onMouseEnter?: Function, + onMouseMove?: Function, + onMouseLeave?: Function, +} +export class AreaChart extends React.Component { +} + +interface BarProps { + layout?: 'horizontal' | 'vertical', + dataKey?: string | number, + xAxisId?: string | number, + yAxisId?: string | number, + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', + label?: Boolean | any | React.ReactElement | Function, + data?: any[], + barSize?: number, + maxBarSize?: number, + minPointSize?: number, + shape?: React.ReactElement | Function, + stackId?: string | number, + unit?: string | number, + name?: string | number, + isAnimationActive?: Boolean, + animationBegin?: number, + animationDuration?: number, + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class Bar extends React.Component { +} + +interface BarChartProps { + layout?: 'horizontal' | 'vertical', + syncId?: string, + width?: number, + height?: number, + data?: any[], + margin?: any, + barCategoryGap?: Percentage | number, + barGap?: Percentage | number, + barSize?: number, + maxBarSize?: number, + stackOffset?: 'expand' | 'none' | 'wiggle' | 'silhouette' | 'sign', + onClick?: Function, + onMouseEnter?: Function, + onMouseMove?: Function, + onMouseLeave?: Function, +} +export class BarChart extends React.Component { +} + +interface BrushProps { + dataKey: number | string, + x?: number, + y?: number, + width?: number, + height?: number, + data: any[], + travellerWidth?: number, + startIndex?: number, + endIndex?: number, + tickFormatter?: Function, + onChange?: Function, +} +export class Brush extends React.Component { +} + +interface CartesianAxisProps { + x?: number, + y?: number, + width?: number, + height?: number, + orientation?: 'top' | 'bottom' | 'left' | 'right', + viewBox?: any, + axisLine?: Boolean | any, + tickLine?: Boolean | any, + minTickGap?: number, + tickSize?: number, + interval?: "preserveStart" | "preserveEnd" | "preserveStartEnd" | number, + tick?: Boolean | any | React.ReactElement | Function, + label?: string | number | React.ReactElement | Function, + mirror?: Boolean, +} +export class CartesianAxis extends React.Component { +} + +interface CartesianGridProps { + x?: number, + y?: number, + width?: number, + height?: number, + horizontal?: Boolean, + vertical?: Boolean, + horizontalPoints?: any[], + verticalPoints?: any[], +} +export class CartesianGrid extends React.Component { +} + +interface CellProps { + fill?: string, + stroke?: string, +} +export class Cell extends React.Component { +} + +interface ComposedChartProps { + layout?: 'horizontal' | 'vertical', + syncId?: string, + width?: number, + height?: number, + data?: any[], + margin?: any, + barCategoryGap?: Percentage | number, + barGap?: number, + barSize?: number, + onClick?: Function, + onMouseEnter?: Function, + onMouseMove?: Function, + onMouseLeave?: Function, +} +export class ComposedChart extends React.Component { +} + +interface CrossProps { + x?: number, + y?: number, + top?: number, + left?: number, + width?: number, + height?: number, +} +export class Cross extends React.Component { +} + +interface CurveProps { + type?: 'basis' | 'basisClosed' | 'basisOpen' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | Function, + points: any[], + layout?: 'horizontal' | 'vertical', + baseLine?: number | any[], + connectNulls?: Boolean, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class Curve extends React.Component { +} + +interface DotProps { + cx: number, + cy: number, + r: number, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseMove?: Function, + onMouseLeave?: Function, +} +export class Dot extends React.Component { +} + +interface ErrorBarProps { + dataKey?: string | number, + width?: number, + strokeWidth?: string, + stroke?: string, + direction?: string, +} +export class ErrorBar extends React.Component { +} + +interface LegendProps { + width?: number, + height?: number, + layout?: 'horizontal' | 'vertical', + align?: 'left' | 'center' | 'right', + verticalAlign?: 'top' | 'middle' | 'bottom', + iconSize?: number, + iconType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye', + payload?: any[], + chartWidth: number, + chartHeight: number, + margin?: any, + content?: React.ReactElement | Function, + wrapperStyle?: any, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class Legend extends React.Component { +} + +interface LineProps { + type?: 'basis' | 'basisClosed' | 'basisOpen' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | Function, + dataKey: string | number, + xAxisId?: string | number, + yAxisId?: string | number, + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', + dot?: Boolean | any | React.ReactElement | Function, + activeDot?: Boolean | any | React.ReactElement | Function, + label?: Boolean | any | React.ReactElement | Function, + points: any[], + layout?: 'horizontal' | 'vertical', + connectNulls?: Boolean, + unit?: string | number, + name?: string | number, + isAnimationActive?: Boolean, + animationBegin?: number, + animationDuration?: number, + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class Line extends React.Component { +} + +interface LineChartProps { + layout?: 'horizontal' | 'vertical', + syncId?: string, + width?: number, + height?: number, + data?: any[], + margin?: any, + onClick?: Function, + onMouseEnter?: Function, + onMouseMove?: Function, + onMouseLeave?: Function, +} +export class LineChart extends React.Component { +} + +interface PieProps { + cx?: Percentage | number, + cy?: Percentage | number, + innerRadius?: Percentage | number, + outerRadius?: Percentage | number, + startAngle?: number, + endAngle?: number, + minAngle?: number, + paddingAngle?: number, + nameKey?: string, + valueKey?: string, + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', + label?: Boolean | any | React.ReactElement | Function, + labelLine?: Boolean | any | React.ReactElement | Function, + data: any[], + activeIndex: any[], + activeShape: any | React.ReactElement | Function, + isAnimationActive?: Boolean, + animationBegin?: number, + animationDuration?: number, + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' | Function, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class Pie extends React.Component { +} + +interface PieChartProps { + width: number, + height: number, + margin?: any, + onClick?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class PieChart extends React.Component { +} + +interface PolarAngleAxisProps { + dataKey: string | number, + cx: number, + cy: number, + radius: Percentage | number, + axisLine?: boolean | any, + axisLineType?: string, + tickLine?: boolean | any, + tick?: boolean | any | React.ReactElement | Function, + ticks: any[], + orient?: string, + tickFormatter: Function, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class PolarAngleAxis extends React.Component { +} + +interface PolarGridProps { + cx: number, + cy: number, + innerRadius: number, + outerRadius: number, + polarAngles: any[], + polarRadius: any[], + gridType?: 'polygon' | 'circle', +} +export class PolarGrid extends React.Component { +} + +interface PolarRadiusAxisProps { + angle?: number, + cx: number, + cy: number, + domain?: any[], + label?: string | number | React.ReactElement | Function, + orientation?: "left" | "right" | "middle", + axisLine?: boolean | any, + tick?: boolean | any | Element | Function, + tickFormatter: Function, + tickCount?: number, + scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | Function, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class PolarRadiusAxis extends React.Component { +} + +interface PolygonProps { + points: any[], + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class Polygon extends React.Component { +} + +interface RadarProps { + dataKey: string | number, + points: any[], + shape: Element | Function, + dot?: boolean | any | Element | Function, + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', + label?: boolean | any | Element | Function, + isAnimationActive?: Boolean, + animationBegin?: number, + animationDuration?: number, + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', +} +export class Radar extends React.Component { +} + +interface RadarChartProps { + width: number, + height: number, + cx?: Percentage | number, + cy?: Percentage | number, + startAngle?: number, + innerRadius?: Percentage | number, + outerRadius?: Percentage | number, + margin?: any, + clockWise?: boolean, + onMouseEnter?: Function, + onMouseLeave?: Function, + onClick?: Function, +} +export class RadarChart extends React.Component { +} + +interface RadialBarProps { + cx?: number, + cy?: number, + startAngle?: number, + endAngle?: number, + maxAngle?: number, + minAngle?: number, + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', + label?: Boolean | any | React.ReactElement | Function, + background?: Boolean | any | React.ReactElement | Function, + data: any[], + isAnimationActive?: Boolean, + animationBegin?: number, + animationDuration?: number, + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class RadialBar extends React.Component { +} + +interface RadialBarChartProps { + width?: number, + height?: number, + data?: any[], + margin?: any, + barCategoryGap?: Percentage | number, + barGap?: number, + cx?: Percentage | number, + cy?: Percentage | number, + innerRadius?: Percentage | number, + outerRadius?: Percentage | number, + barSize?: number, + onMouseEnter?: Function, + onMouseLeave?: Function, + onClick?: Function, +} +export class RadialBarChart extends React.Component { +} + +interface RectangleProps { + x?: number, + y?: number, + width?: number, + height?: number, + radius?: number, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class Rectangle extends React.Component { +} + +interface ReferenceAreaProps { + xAxisId?: string | number, + yAxisId?: string | number, + x1?: number | string, + x2?: number | string, + y1?: number | string, + y2?: number | string, + alwaysShow?: Boolean, + viewBox: any, + xAxis: any, + yAxis: any, + label?: string | number | React.ReactElement | Function, + isFront?: Boolean, +} +export class ReferenceArea extends React.Component { +} + +interface ReferenceDotProps { + xAxisId?: string | number, + yAxisId?: string | number, + x: number | string, + y: number | string, + alwaysShow?: Boolean, + xAxis: any, + yAxis: any, + label?: string | number | React.ReactElement | Function, + isFront?: Boolean, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseMove?: Function, + onMouseLeave?: Function, +} +export class ReferenceDot extends React.Component { +} + +interface ReferenceLineProps { + xAxisId?: string | number, + yAxisId?: string | number, + x?: number | string, + y?: number | string, + alwaysShow?: Boolean, + viewBox: any, + xAxis: any, + yAxis: any, + label?: string | number | React.ReactElement | Function, + isFront?: Boolean, +} +export class ReferenceLine extends React.Component { +} + +interface ResponsiveContainerProps { + aspect?: number, + width?: Percentage | number, + height?: Percentage | number, + minWidth?: number, + minHeight?: number, + debounce?: number, +} +export class ResponsiveContainer extends React.Component { +} + +interface ScatterProps { + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', + xAxisId?: string | number, + yAxisId?: string | number, + zAxisId?: string | number, + line?: Boolean | any | React.ReactElement | Function, + shape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | React.ReactElement | Function, + lineType?: 'joint' | 'fitting', + points: any[], + isAnimationActive?: Boolean, + animationBegin?: number, + animationDuration?: number, + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class Scatter extends React.Component { +} + +interface ScatterChartProps { + width: number, + height: number, + margin?: any, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class ScatterChart extends React.Component { +} + +interface SectorProps { + cx?: number, + cy?: number, + innerRadius?: number, + outerRadius?: number, + startAngle?: number, + endAngle?: number, + cornerRadius?: number, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class Sector extends React.Component { +} + +interface TextProps { + scaleToFit?: Boolean, + angle?: number, + width?: number, + textAnchor?: 'start' | 'middle' | 'end' | 'inherit', + verticalAnchor?: 'start' | 'middle' | 'end', +} +export class Text extends React.Component { +} + +interface TooltipProps { + separator?: string, + offset?: number, + itemStyle?: any, + wrapperStyle?: any, + labelStyle?: any, + cursor?: Boolean | any | React.ReactElement, + viewBox: any, + active?: Boolean, + coordinate?: any, + payload?: any[], + label?: string | number, + content?: React.ReactElement | Function, + formatter?: Function, + labelFormatter?: Function, + itemSorter?: Function, + isAnimationActive?: Boolean, + animationBegin?: number, + animationDuration?: number, + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', +} +export class Tooltip extends React.Component { +} + +interface TreemapProps { + width: number, + height: number, + dataKey?: string, + aspectRatio: number, + isAnimationActive?: Boolean, + animationBegin?: number, + animationDuration?: number, + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', +} +export class Treemap extends React.Component { +} + +interface XAxisProps { + hide?: Boolean, + dataKey?: string | number, + xAxisId?: string | number, + width?: number, + height?: number, + orientation?: 'bottom' | 'top', + type?: 'number' | 'category', + allowDecimals?: Boolean, + allowDataOverflow?: Boolean, + tickCount?: number, + domain?: any[], + interval?: "preserveStart" | "preserveEnd" | "preserveStartEnd" | number, + padding?: any, + minTickGap?: number, + axisLine?: Boolean | any, + tickLine?: Boolean | any, + tickSize?: number, + tickFormatter?: Function, + ticks?: any[], + tick?: Boolean | any | React.ReactElement, + mirror?: Boolean, + reversed?: Boolean, + label?: string | number | React.ReactElement, + scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | Function, + unit?: string | number, + name?: string | number, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class XAxis extends React.Component { +} + +interface YAxisProps { + hide?: Boolean, + dataKey?: string | number, + yAxisId?: string | number, + width?: number, + height?: number, + orientation?: 'left' | 'right', + type?: 'number' | 'category', + domain?: any[], + interval?: "preserveStart" | "preserveEnd" | "preserveStartEnd" | number, + padding?: any, + minTickGap?: number, + allowDecimals?: Boolean, + allowDataOverflow?: Boolean, + axisLine?: Boolean | any, + tickLine?: Boolean | any, + tickSize?: number, + tickFormatter?: Function, + ticks?: any[], + tick?: Boolean | any | React.ReactElement, + mirror?: Boolean, + reversed?: Boolean, + label?: string | number | React.ReactElement, + scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | Function, + unit?: string | number, + name?: string | number, + onClick?: Function, + onMouseDown?: Function, + onMouseUp?: Function, + onMouseMove?: Function, + onMouseOver?: Function, + onMouseOut?: Function, + onMouseEnter?: Function, + onMouseLeave?: Function, +} +export class YAxis extends React.Component { +} + +interface ZAxisProps { + dataKey: string | number, + zAxisId?: string | number, + range?: any[], + unit?: string | number, + name?: string | number, + scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | Function, +} +export class ZAxis extends React.Component { +} + diff --git a/types/recharts/test/index.tsx b/types/recharts/test/index.tsx new file mode 100644 index 0000000000..f7d415a615 --- /dev/null +++ b/types/recharts/test/index.tsx @@ -0,0 +1,19 @@ +import * as React from 'react' +import * as ReactDOM from 'react-dom'; + +import { CartesianGrid, LineChart, Line, Tooltip, XAxis, YAxis } from 'recharts'; + +const Component = (props: {}) => { + return ( + + + + + + + + ); +} + + +ReactDOM.render(, document.getElementById('app')); diff --git a/types/recharts/tsconfig.json b/types/recharts/tsconfig.json new file mode 100644 index 0000000000..41fddb0ef2 --- /dev/null +++ b/types/recharts/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": false, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/index.tsx" + ], + "jsx": "react" +} diff --git a/types/recharts/types-metadata.json b/types/recharts/types-metadata.json new file mode 100644 index 0000000000..795b5eb678 --- /dev/null +++ b/types/recharts/types-metadata.json @@ -0,0 +1,25 @@ +{ + "authors": "Maarten Mulders ", + "libraryDependencies": [ + "react" + ], + "moduleDependencies": [], + "libraryMajorVersion": 0, + "libraryMinorVersion": 12, + "typeScriptVersion": "2.0", + "libraryName": "recharts", + "typingsPackageName": "recharts", + "projectName": "http://recharts.org/", + "sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped", + "sourceBranch": "master", + "globals": [ + ], + "declaredModules": [ + "recharts" + ], + "files": [ + "index.d.ts" + ], + "hasPackageJson": false, + "contentHash": "be2be503d947ebda48e7af156e1b24198540234a732125ceb62c14ce759d98d5" +} From da6e0916d846a155bf37978d783667c2abe0f733 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sun, 16 Jul 2017 21:30:07 +0200 Subject: [PATCH 2/5] Fix test file --- types/recharts/test/index.tsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/types/recharts/test/index.tsx b/types/recharts/test/index.tsx index f7d415a615..62d3b6f830 100644 --- a/types/recharts/test/index.tsx +++ b/types/recharts/test/index.tsx @@ -1,19 +1,20 @@ -import * as React from 'react' +import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import { CartesianGrid, LineChart, Line, Tooltip, XAxis, YAxis } from 'recharts'; +import { Recharts } from 'recharts'; + +const data: any[] = []; const Component = (props: {}) => { return ( - - - - - - - + + + + + + + ); -} - +}; ReactDOM.render(, document.getElementById('app')); From 50a0fed497f0438de57e5b32d11baaf22c91d8b2 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sun, 16 Jul 2017 21:57:09 +0200 Subject: [PATCH 3/5] Fix tslint issues --- types/recharts/index.d.ts | 1517 +++++++++++++++++----------------- types/recharts/tsconfig.json | 8 +- types/recharts/tslint.json | 3 + 3 files changed, 746 insertions(+), 782 deletions(-) create mode 100644 types/recharts/tslint.json diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index ae37eced47..b858309147 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -1,786 +1,747 @@ -// Type definitions for Recharts v0.22.1 +// Type definitions for Recharts 0.22 // Project: http://recharts.org/ // Definitions by: Maarten Mulders // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// import * as React from 'react'; -type Function = () => any; -type Percentage = string; +export namespace Recharts { + type Percentage = string; + type RechartsFunction = () => void; -interface AreaProps { - type?: 'basis' | 'basisClosed' | 'basisOpen' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | Function, - dataKey?: string | number, - xAxisId?: string | number, - yAxisId?: string | number, - legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', - dot?: Boolean | any | React.ReactElement | Function, - activeDot?: Boolean | any | React.ReactElement | Function, - label?: Boolean | any | React.ReactElement | Function, - stroke?: string, - layout?: 'horizontal' | 'vertical', - baseLine?: number | any[], - points?: any[], - stackId?: string | number, - connectNulls?: Boolean, - unit?: string | number, - name?: string | number, - isAnimationActive?: Boolean, - animationBegin?: number, - animationDuration?: number, - animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, + interface AreaProps { + type?: 'basis' | 'basisClosed' | 'basisOpen' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | RechartsFunction; + dataKey?: string | number; + xAxisId?: string | number; + yAxisId?: string | number; + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'; + dot?: boolean | any | React.ReactElement | RechartsFunction; + activeDot?: boolean | any | React.ReactElement | RechartsFunction; + label?: boolean | any | React.ReactElement | RechartsFunction; + stroke?: string; + layout?: 'horizontal' | 'vertical'; + baseLine?: number | any[]; + points?: any[]; + stackId?: string | number; + connectNulls?: boolean; + unit?: string | number; + name?: string | number; + isAnimationActive?: boolean; + animationBegin?: number; + animationDuration?: number; + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Area extends React.Component { + } + interface AreaChartProps { + layout?: 'horizontal' | 'vertical'; + syncId?: string; + width: number; + height: number; + data: any[]; + margin?: any; + stackOffset?: 'expand' | 'none' | 'wiggle' | 'silhouette'; + baseValue?: number | 'dataMin' | 'dataMax' | 'auto'; + onClick?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class AreaChart extends React.Component { + } + interface BarProps { + layout?: 'horizontal' | 'vertical'; + dataKey?: string | number; + xAxisId?: string | number; + yAxisId?: string | number; + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'; + label?: boolean | any | React.ReactElement | RechartsFunction; + data?: any[]; + barSize?: number; + maxBarSize?: number; + minPointSize?: number; + shape?: React.ReactElement | RechartsFunction; + stackId?: string | number; + unit?: string | number; + name?: string | number; + isAnimationActive?: boolean; + animationBegin?: number; + animationDuration?: number; + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Bar extends React.Component { + } + interface BarChartProps { + layout?: 'horizontal' | 'vertical'; + syncId?: string; + width?: number; + height?: number; + data?: any[]; + margin?: any; + barCategoryGap?: Percentage | number; + barGap?: Percentage | number; + barSize?: number; + maxBarSize?: number; + stackOffset?: 'expand' | 'none' | 'wiggle' | 'silhouette' | 'sign'; + onClick?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class BarChart extends React.Component { + } + interface BrushProps { + dataKey: number | string; + x?: number; + y?: number; + width?: number; + height?: number; + data: any[]; + travellerWidth?: number; + startIndex?: number; + endIndex?: number; + tickFormatter?: RechartsFunction; + onChange?: RechartsFunction; + } + class Brush extends React.Component { + } + interface CartesianAxisProps { + x?: number; + y?: number; + width?: number; + height?: number; + orientation?: 'top' | 'bottom' | 'left' | 'right'; + viewBox?: any; + axisLine?: boolean | any; + tickLine?: boolean | any; + minTickGap?: number; + tickSize?: number; + interval?: "preserveStart" | "preserveEnd" | "preserveStartEnd" | number; + tick?: boolean | any | React.ReactElement | RechartsFunction; + label?: string | number | React.ReactElement | RechartsFunction; + mirror?: boolean; + } + class CartesianAxis extends React.Component { + } + interface CartesianGridProps { + x?: number; + y?: number; + width?: number; + height?: number; + horizontal?: boolean; + vertical?: boolean; + horizontalPoints?: any[]; + verticalPoints?: any[]; + } + class CartesianGrid extends React.Component { + } + interface CellProps { + fill?: string; + stroke?: string; + } + class Cell extends React.Component { + } + interface ComposedChartProps { + layout?: 'horizontal' | 'vertical'; + syncId?: string; + width?: number; + height?: number; + data?: any[]; + margin?: any; + barCategoryGap?: Percentage | number; + barGap?: number; + barSize?: number; + onClick?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class ComposedChart extends React.Component { + } + interface CrossProps { + x?: number; + y?: number; + top?: number; + left?: number; + width?: number; + height?: number; + } + class Cross extends React.Component { + } + interface CurveProps { + type?: 'basis' | 'basisClosed' | 'basisOpen' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | RechartsFunction; + points: any[]; + layout?: 'horizontal' | 'vertical'; + baseLine?: number | any[]; + connectNulls?: boolean; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Curve extends React.Component { + } + interface DotProps { + cx: number; + cy: number; + r: number; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Dot extends React.Component { + } + interface ErrorBarProps { + dataKey?: string | number; + width?: number; + strokeWidth?: string; + stroke?: string; + direction?: string; + } + class ErrorBar extends React.Component { + } + interface LegendProps { + width?: number; + height?: number; + layout?: 'horizontal' | 'vertical'; + align?: 'left' | 'center' | 'right'; + verticalAlign?: 'top' | 'middle' | 'bottom'; + iconSize?: number; + iconType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye'; + payload?: any[]; + chartWidth: number; + chartHeight: number; + margin?: any; + content?: React.ReactElement | RechartsFunction; + wrapperStyle?: any; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Legend extends React.Component { + } + interface LineProps { + type?: 'basis' | 'basisClosed' | 'basisOpen' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | RechartsFunction; + dataKey: string | number; + xAxisId?: string | number; + yAxisId?: string | number; + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'; + dot?: boolean | any | React.ReactElement | RechartsFunction; + activeDot?: boolean | any | React.ReactElement | RechartsFunction; + label?: boolean | any | React.ReactElement | RechartsFunction; + points: any[]; + layout?: 'horizontal' | 'vertical'; + connectNulls?: boolean; + unit?: string | number; + name?: string | number; + isAnimationActive?: boolean; + animationBegin?: number; + animationDuration?: number; + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Line extends React.Component { + } + interface LineChartProps { + layout?: 'horizontal' | 'vertical'; + syncId?: string; + width?: number; + height?: number; + data?: any[]; + margin?: any; + onClick?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class LineChart extends React.Component { + } + interface PieProps { + cx?: Percentage | number; + cy?: Percentage | number; + innerRadius?: Percentage | number; + outerRadius?: Percentage | number; + startAngle?: number; + endAngle?: number; + minAngle?: number; + paddingAngle?: number; + nameKey?: string; + valueKey?: string; + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'; + label?: boolean | any | React.ReactElement | RechartsFunction; + labelLine?: boolean | any | React.ReactElement | RechartsFunction; + data: any[]; + activeIndex: any[]; + activeShape: any | React.ReactElement | RechartsFunction; + isAnimationActive?: boolean; + animationBegin?: number; + animationDuration?: number; + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' | RechartsFunction; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Pie extends React.Component { + } + interface PieChartProps { + width: number; + height: number; + margin?: any; + onClick?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class PieChart extends React.Component { + } + interface PolarAngleAxisProps { + dataKey: string | number; + cx: number; + cy: number; + radius: Percentage | number; + axisLine?: boolean | any; + axisLineType?: string; + tickLine?: boolean | any; + tick?: boolean | any | React.ReactElement | RechartsFunction; + ticks: any[]; + orient?: string; + tickFormatter: RechartsFunction; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class PolarAngleAxis extends React.Component { + } + interface PolarGridProps { + cx: number; + cy: number; + innerRadius: number; + outerRadius: number; + polarAngles: any[]; + polarRadius: any[]; + gridType?: 'polygon' | 'circle'; + } + class PolarGrid extends React.Component { + } + interface PolarRadiusAxisProps { + angle?: number; + cx: number; + cy: number; + domain?: any[]; + label?: string | number | React.ReactElement | RechartsFunction; + orientation?: "left" | "right" | "middle"; + axisLine?: boolean | any; + tick?: boolean | any | Element | RechartsFunction; + tickFormatter: RechartsFunction; + tickCount?: number; + scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | RechartsFunction; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class PolarRadiusAxis extends React.Component { + } + interface PolygonProps { + points: any[]; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Polygon extends React.Component { + } + interface RadarProps { + dataKey: string | number; + points: any[]; + shape: Element | RechartsFunction; + dot?: boolean | any | Element | RechartsFunction; + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'; + label?: boolean | any | Element | RechartsFunction; + isAnimationActive?: boolean; + animationBegin?: number; + animationDuration?: number; + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'; + } + class Radar extends React.Component { + } + interface RadarChartProps { + width: number; + height: number; + cx?: Percentage | number; + cy?: Percentage | number; + startAngle?: number; + innerRadius?: Percentage | number; + outerRadius?: Percentage | number; + margin?: any; + clockWise?: boolean; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + onClick?: RechartsFunction; + } + class RadarChart extends React.Component { + } + interface RadialBarProps { + cx?: number; + cy?: number; + startAngle?: number; + endAngle?: number; + maxAngle?: number; + minAngle?: number; + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'; + label?: boolean | any | React.ReactElement | RechartsFunction; + background?: boolean | any | React.ReactElement | RechartsFunction; + data: any[]; + isAnimationActive?: boolean; + animationBegin?: number; + animationDuration?: number; + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class RadialBar extends React.Component { + } + interface RadialBarChartProps { + width?: number; + height?: number; + data?: any[]; + margin?: any; + barCategoryGap?: Percentage | number; + barGap?: number; + cx?: Percentage | number; + cy?: Percentage | number; + innerRadius?: Percentage | number; + outerRadius?: Percentage | number; + barSize?: number; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + onClick?: RechartsFunction; + } + class RadialBarChart extends React.Component { + } + interface RectangleProps { + x?: number; + y?: number; + width?: number; + height?: number; + radius?: number; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Rectangle extends React.Component { + } + interface ReferenceAreaProps { + xAxisId?: string | number; + yAxisId?: string | number; + x1?: number | string; + x2?: number | string; + y1?: number | string; + y2?: number | string; + alwaysShow?: boolean; + viewBox: any; + xAxis: any; + yAxis: any; + label?: string | number | React.ReactElement | RechartsFunction; + isFront?: boolean; + } + class ReferenceArea extends React.Component { + } + interface ReferenceDotProps { + xAxisId?: string | number; + yAxisId?: string | number; + x: number | string; + y: number | string; + alwaysShow?: boolean; + xAxis: any; + yAxis: any; + label?: string | number | React.ReactElement | RechartsFunction; + isFront?: boolean; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class ReferenceDot extends React.Component { + } + interface ReferenceLineProps { + xAxisId?: string | number; + yAxisId?: string | number; + x?: number | string; + y?: number | string; + alwaysShow?: boolean; + viewBox: any; + xAxis: any; + yAxis: any; + label?: string | number | React.ReactElement | RechartsFunction; + isFront?: boolean; + } + class ReferenceLine extends React.Component { + } + interface ResponsiveContainerProps { + aspect?: number; + width?: Percentage | number; + height?: Percentage | number; + minWidth?: number; + minHeight?: number; + debounce?: number; + } + class ResponsiveContainer extends React.Component { + } + interface ScatterProps { + legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none'; + xAxisId?: string | number; + yAxisId?: string | number; + zAxisId?: string | number; + line?: boolean | any | React.ReactElement | RechartsFunction; + shape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | React.ReactElement | RechartsFunction; + lineType?: 'joint' | 'fitting'; + points: any[]; + isAnimationActive?: boolean; + animationBegin?: number; + animationDuration?: number; + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Scatter extends React.Component { + } + interface ScatterChartProps { + width: number; + height: number; + margin?: any; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class ScatterChart extends React.Component { + } + interface SectorProps { + cx?: number; + cy?: number; + innerRadius?: number; + outerRadius?: number; + startAngle?: number; + endAngle?: number; + cornerRadius?: number; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class Sector extends React.Component { + } + interface TextProps { + scaleToFit?: boolean; + angle?: number; + width?: number; + textAnchor?: 'start' | 'middle' | 'end' | 'inherit'; + verticalAnchor?: 'start' | 'middle' | 'end'; + } + class Text extends React.Component { + } + interface TooltipProps { + separator?: string; + offset?: number; + itemStyle?: any; + wrapperStyle?: any; + labelStyle?: any; + cursor?: boolean | any | React.ReactElement; + viewBox: any; + active?: boolean; + coordinate?: any; + payload?: any[]; + label?: string | number; + content?: React.ReactElement | RechartsFunction; + formatter?: RechartsFunction; + labelFormatter?: RechartsFunction; + itemSorter?: RechartsFunction; + isAnimationActive?: boolean; + animationBegin?: number; + animationDuration?: number; + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'; + } + class Tooltip extends React.Component { + } + interface TreemapProps { + width: number; + height: number; + dataKey?: string; + aspectRatio: number; + isAnimationActive?: boolean; + animationBegin?: number; + animationDuration?: number; + animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear'; + } + class Treemap extends React.Component { + } + interface XAxisProps { + hide?: boolean; + dataKey?: string | number; + xAxisId?: string | number; + width?: number; + height?: number; + orientation?: 'bottom' | 'top'; + type?: 'number' | 'category'; + allowDecimals?: boolean; + allowDataOverflow?: boolean; + tickCount?: number; + domain?: any[]; + interval?: "preserveStart" | "preserveEnd" | "preserveStartEnd" | number; + padding?: any; + minTickGap?: number; + axisLine?: boolean | any; + tickLine?: boolean | any; + tickSize?: number; + tickFormatter?: RechartsFunction; + ticks?: any[]; + tick?: boolean | any | React.ReactElement; + mirror?: boolean; + reversed?: boolean; + label?: string | number | React.ReactElement; + scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | RechartsFunction; + unit?: string | number; + name?: string | number; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class XAxis extends React.Component { + } + interface YAxisProps { + hide?: boolean; + dataKey?: string | number; + yAxisId?: string | number; + width?: number; + height?: number; + orientation?: 'left' | 'right'; + type?: 'number' | 'category'; + domain?: any[]; + interval?: "preserveStart" | "preserveEnd" | "preserveStartEnd" | number; + padding?: any; + minTickGap?: number; + allowDecimals?: boolean; + allowDataOverflow?: boolean; + axisLine?: boolean | any; + tickLine?: boolean | any; + tickSize?: number; + tickFormatter?: RechartsFunction; + ticks?: any[]; + tick?: boolean | any | React.ReactElement; + mirror?: boolean; + reversed?: boolean; + label?: string | number | React.ReactElement; + scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | RechartsFunction; + unit?: string | number; + name?: string | number; + onClick?: RechartsFunction; + onMouseDown?: RechartsFunction; + onMouseUp?: RechartsFunction; + onMouseMove?: RechartsFunction; + onMouseOver?: RechartsFunction; + onMouseOut?: RechartsFunction; + onMouseEnter?: RechartsFunction; + onMouseLeave?: RechartsFunction; + } + class YAxis extends React.Component { + } + interface ZAxisProps { + dataKey: string | number; + zAxisId?: string | number; + range?: any[]; + unit?: string | number; + name?: string | number; + scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | RechartsFunction; + } + class ZAxis extends React.Component { + } } -export class Area extends React.Component { -} - -interface AreaChartProps { - layout?: 'horizontal' | 'vertical', - syncId?: string, - width: number, - height: number, - data: any[], - margin?: any, - stackOffset?: 'expand' | 'none' | 'wiggle' | 'silhouette', - baseValue?: number | 'dataMin' | 'dataMax' | 'auto', - onClick?: Function, - onMouseEnter?: Function, - onMouseMove?: Function, - onMouseLeave?: Function, -} -export class AreaChart extends React.Component { -} - -interface BarProps { - layout?: 'horizontal' | 'vertical', - dataKey?: string | number, - xAxisId?: string | number, - yAxisId?: string | number, - legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', - label?: Boolean | any | React.ReactElement | Function, - data?: any[], - barSize?: number, - maxBarSize?: number, - minPointSize?: number, - shape?: React.ReactElement | Function, - stackId?: string | number, - unit?: string | number, - name?: string | number, - isAnimationActive?: Boolean, - animationBegin?: number, - animationDuration?: number, - animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class Bar extends React.Component { -} - -interface BarChartProps { - layout?: 'horizontal' | 'vertical', - syncId?: string, - width?: number, - height?: number, - data?: any[], - margin?: any, - barCategoryGap?: Percentage | number, - barGap?: Percentage | number, - barSize?: number, - maxBarSize?: number, - stackOffset?: 'expand' | 'none' | 'wiggle' | 'silhouette' | 'sign', - onClick?: Function, - onMouseEnter?: Function, - onMouseMove?: Function, - onMouseLeave?: Function, -} -export class BarChart extends React.Component { -} - -interface BrushProps { - dataKey: number | string, - x?: number, - y?: number, - width?: number, - height?: number, - data: any[], - travellerWidth?: number, - startIndex?: number, - endIndex?: number, - tickFormatter?: Function, - onChange?: Function, -} -export class Brush extends React.Component { -} - -interface CartesianAxisProps { - x?: number, - y?: number, - width?: number, - height?: number, - orientation?: 'top' | 'bottom' | 'left' | 'right', - viewBox?: any, - axisLine?: Boolean | any, - tickLine?: Boolean | any, - minTickGap?: number, - tickSize?: number, - interval?: "preserveStart" | "preserveEnd" | "preserveStartEnd" | number, - tick?: Boolean | any | React.ReactElement | Function, - label?: string | number | React.ReactElement | Function, - mirror?: Boolean, -} -export class CartesianAxis extends React.Component { -} - -interface CartesianGridProps { - x?: number, - y?: number, - width?: number, - height?: number, - horizontal?: Boolean, - vertical?: Boolean, - horizontalPoints?: any[], - verticalPoints?: any[], -} -export class CartesianGrid extends React.Component { -} - -interface CellProps { - fill?: string, - stroke?: string, -} -export class Cell extends React.Component { -} - -interface ComposedChartProps { - layout?: 'horizontal' | 'vertical', - syncId?: string, - width?: number, - height?: number, - data?: any[], - margin?: any, - barCategoryGap?: Percentage | number, - barGap?: number, - barSize?: number, - onClick?: Function, - onMouseEnter?: Function, - onMouseMove?: Function, - onMouseLeave?: Function, -} -export class ComposedChart extends React.Component { -} - -interface CrossProps { - x?: number, - y?: number, - top?: number, - left?: number, - width?: number, - height?: number, -} -export class Cross extends React.Component { -} - -interface CurveProps { - type?: 'basis' | 'basisClosed' | 'basisOpen' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | Function, - points: any[], - layout?: 'horizontal' | 'vertical', - baseLine?: number | any[], - connectNulls?: Boolean, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class Curve extends React.Component { -} - -interface DotProps { - cx: number, - cy: number, - r: number, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseMove?: Function, - onMouseLeave?: Function, -} -export class Dot extends React.Component { -} - -interface ErrorBarProps { - dataKey?: string | number, - width?: number, - strokeWidth?: string, - stroke?: string, - direction?: string, -} -export class ErrorBar extends React.Component { -} - -interface LegendProps { - width?: number, - height?: number, - layout?: 'horizontal' | 'vertical', - align?: 'left' | 'center' | 'right', - verticalAlign?: 'top' | 'middle' | 'bottom', - iconSize?: number, - iconType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'star' | 'triangle' | 'wye', - payload?: any[], - chartWidth: number, - chartHeight: number, - margin?: any, - content?: React.ReactElement | Function, - wrapperStyle?: any, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class Legend extends React.Component { -} - -interface LineProps { - type?: 'basis' | 'basisClosed' | 'basisOpen' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | Function, - dataKey: string | number, - xAxisId?: string | number, - yAxisId?: string | number, - legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', - dot?: Boolean | any | React.ReactElement | Function, - activeDot?: Boolean | any | React.ReactElement | Function, - label?: Boolean | any | React.ReactElement | Function, - points: any[], - layout?: 'horizontal' | 'vertical', - connectNulls?: Boolean, - unit?: string | number, - name?: string | number, - isAnimationActive?: Boolean, - animationBegin?: number, - animationDuration?: number, - animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class Line extends React.Component { -} - -interface LineChartProps { - layout?: 'horizontal' | 'vertical', - syncId?: string, - width?: number, - height?: number, - data?: any[], - margin?: any, - onClick?: Function, - onMouseEnter?: Function, - onMouseMove?: Function, - onMouseLeave?: Function, -} -export class LineChart extends React.Component { -} - -interface PieProps { - cx?: Percentage | number, - cy?: Percentage | number, - innerRadius?: Percentage | number, - outerRadius?: Percentage | number, - startAngle?: number, - endAngle?: number, - minAngle?: number, - paddingAngle?: number, - nameKey?: string, - valueKey?: string, - legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', - label?: Boolean | any | React.ReactElement | Function, - labelLine?: Boolean | any | React.ReactElement | Function, - data: any[], - activeIndex: any[], - activeShape: any | React.ReactElement | Function, - isAnimationActive?: Boolean, - animationBegin?: number, - animationDuration?: number, - animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' | Function, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class Pie extends React.Component { -} - -interface PieChartProps { - width: number, - height: number, - margin?: any, - onClick?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class PieChart extends React.Component { -} - -interface PolarAngleAxisProps { - dataKey: string | number, - cx: number, - cy: number, - radius: Percentage | number, - axisLine?: boolean | any, - axisLineType?: string, - tickLine?: boolean | any, - tick?: boolean | any | React.ReactElement | Function, - ticks: any[], - orient?: string, - tickFormatter: Function, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class PolarAngleAxis extends React.Component { -} - -interface PolarGridProps { - cx: number, - cy: number, - innerRadius: number, - outerRadius: number, - polarAngles: any[], - polarRadius: any[], - gridType?: 'polygon' | 'circle', -} -export class PolarGrid extends React.Component { -} - -interface PolarRadiusAxisProps { - angle?: number, - cx: number, - cy: number, - domain?: any[], - label?: string | number | React.ReactElement | Function, - orientation?: "left" | "right" | "middle", - axisLine?: boolean | any, - tick?: boolean | any | Element | Function, - tickFormatter: Function, - tickCount?: number, - scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | Function, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class PolarRadiusAxis extends React.Component { -} - -interface PolygonProps { - points: any[], - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class Polygon extends React.Component { -} - -interface RadarProps { - dataKey: string | number, - points: any[], - shape: Element | Function, - dot?: boolean | any | Element | Function, - legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', - label?: boolean | any | Element | Function, - isAnimationActive?: Boolean, - animationBegin?: number, - animationDuration?: number, - animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', -} -export class Radar extends React.Component { -} - -interface RadarChartProps { - width: number, - height: number, - cx?: Percentage | number, - cy?: Percentage | number, - startAngle?: number, - innerRadius?: Percentage | number, - outerRadius?: Percentage | number, - margin?: any, - clockWise?: boolean, - onMouseEnter?: Function, - onMouseLeave?: Function, - onClick?: Function, -} -export class RadarChart extends React.Component { -} - -interface RadialBarProps { - cx?: number, - cy?: number, - startAngle?: number, - endAngle?: number, - maxAngle?: number, - minAngle?: number, - legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', - label?: Boolean | any | React.ReactElement | Function, - background?: Boolean | any | React.ReactElement | Function, - data: any[], - isAnimationActive?: Boolean, - animationBegin?: number, - animationDuration?: number, - animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class RadialBar extends React.Component { -} - -interface RadialBarChartProps { - width?: number, - height?: number, - data?: any[], - margin?: any, - barCategoryGap?: Percentage | number, - barGap?: number, - cx?: Percentage | number, - cy?: Percentage | number, - innerRadius?: Percentage | number, - outerRadius?: Percentage | number, - barSize?: number, - onMouseEnter?: Function, - onMouseLeave?: Function, - onClick?: Function, -} -export class RadialBarChart extends React.Component { -} - -interface RectangleProps { - x?: number, - y?: number, - width?: number, - height?: number, - radius?: number, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class Rectangle extends React.Component { -} - -interface ReferenceAreaProps { - xAxisId?: string | number, - yAxisId?: string | number, - x1?: number | string, - x2?: number | string, - y1?: number | string, - y2?: number | string, - alwaysShow?: Boolean, - viewBox: any, - xAxis: any, - yAxis: any, - label?: string | number | React.ReactElement | Function, - isFront?: Boolean, -} -export class ReferenceArea extends React.Component { -} - -interface ReferenceDotProps { - xAxisId?: string | number, - yAxisId?: string | number, - x: number | string, - y: number | string, - alwaysShow?: Boolean, - xAxis: any, - yAxis: any, - label?: string | number | React.ReactElement | Function, - isFront?: Boolean, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseMove?: Function, - onMouseLeave?: Function, -} -export class ReferenceDot extends React.Component { -} - -interface ReferenceLineProps { - xAxisId?: string | number, - yAxisId?: string | number, - x?: number | string, - y?: number | string, - alwaysShow?: Boolean, - viewBox: any, - xAxis: any, - yAxis: any, - label?: string | number | React.ReactElement | Function, - isFront?: Boolean, -} -export class ReferenceLine extends React.Component { -} - -interface ResponsiveContainerProps { - aspect?: number, - width?: Percentage | number, - height?: Percentage | number, - minWidth?: number, - minHeight?: number, - debounce?: number, -} -export class ResponsiveContainer extends React.Component { -} - -interface ScatterProps { - legendType?: 'line' | 'square' | 'rect' | 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | 'none', - xAxisId?: string | number, - yAxisId?: string | number, - zAxisId?: string | number, - line?: Boolean | any | React.ReactElement | Function, - shape?: 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye' | React.ReactElement | Function, - lineType?: 'joint' | 'fitting', - points: any[], - isAnimationActive?: Boolean, - animationBegin?: number, - animationDuration?: number, - animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class Scatter extends React.Component { -} - -interface ScatterChartProps { - width: number, - height: number, - margin?: any, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class ScatterChart extends React.Component { -} - -interface SectorProps { - cx?: number, - cy?: number, - innerRadius?: number, - outerRadius?: number, - startAngle?: number, - endAngle?: number, - cornerRadius?: number, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class Sector extends React.Component { -} - -interface TextProps { - scaleToFit?: Boolean, - angle?: number, - width?: number, - textAnchor?: 'start' | 'middle' | 'end' | 'inherit', - verticalAnchor?: 'start' | 'middle' | 'end', -} -export class Text extends React.Component { -} - -interface TooltipProps { - separator?: string, - offset?: number, - itemStyle?: any, - wrapperStyle?: any, - labelStyle?: any, - cursor?: Boolean | any | React.ReactElement, - viewBox: any, - active?: Boolean, - coordinate?: any, - payload?: any[], - label?: string | number, - content?: React.ReactElement | Function, - formatter?: Function, - labelFormatter?: Function, - itemSorter?: Function, - isAnimationActive?: Boolean, - animationBegin?: number, - animationDuration?: number, - animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', -} -export class Tooltip extends React.Component { -} - -interface TreemapProps { - width: number, - height: number, - dataKey?: string, - aspectRatio: number, - isAnimationActive?: Boolean, - animationBegin?: number, - animationDuration?: number, - animationEasing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear', -} -export class Treemap extends React.Component { -} - -interface XAxisProps { - hide?: Boolean, - dataKey?: string | number, - xAxisId?: string | number, - width?: number, - height?: number, - orientation?: 'bottom' | 'top', - type?: 'number' | 'category', - allowDecimals?: Boolean, - allowDataOverflow?: Boolean, - tickCount?: number, - domain?: any[], - interval?: "preserveStart" | "preserveEnd" | "preserveStartEnd" | number, - padding?: any, - minTickGap?: number, - axisLine?: Boolean | any, - tickLine?: Boolean | any, - tickSize?: number, - tickFormatter?: Function, - ticks?: any[], - tick?: Boolean | any | React.ReactElement, - mirror?: Boolean, - reversed?: Boolean, - label?: string | number | React.ReactElement, - scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | Function, - unit?: string | number, - name?: string | number, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class XAxis extends React.Component { -} - -interface YAxisProps { - hide?: Boolean, - dataKey?: string | number, - yAxisId?: string | number, - width?: number, - height?: number, - orientation?: 'left' | 'right', - type?: 'number' | 'category', - domain?: any[], - interval?: "preserveStart" | "preserveEnd" | "preserveStartEnd" | number, - padding?: any, - minTickGap?: number, - allowDecimals?: Boolean, - allowDataOverflow?: Boolean, - axisLine?: Boolean | any, - tickLine?: Boolean | any, - tickSize?: number, - tickFormatter?: Function, - ticks?: any[], - tick?: Boolean | any | React.ReactElement, - mirror?: Boolean, - reversed?: Boolean, - label?: string | number | React.ReactElement, - scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | Function, - unit?: string | number, - name?: string | number, - onClick?: Function, - onMouseDown?: Function, - onMouseUp?: Function, - onMouseMove?: Function, - onMouseOver?: Function, - onMouseOut?: Function, - onMouseEnter?: Function, - onMouseLeave?: Function, -} -export class YAxis extends React.Component { -} - -interface ZAxisProps { - dataKey: string | number, - zAxisId?: string | number, - range?: any[], - unit?: string | number, - name?: string | number, - scale?: 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utcTime' | 'sequential' | 'threshold' | Function, -} -export class ZAxis extends React.Component { -} - diff --git a/types/recharts/tsconfig.json b/types/recharts/tsconfig.json index 41fddb0ef2..06e783c53b 100644 --- a/types/recharts/tsconfig.json +++ b/types/recharts/tsconfig.json @@ -6,9 +6,10 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, + "noImplicitThis": true, + "strictNullChecks": true, "baseUrl": "../", + "jsx": "react", "typeRoots": [ "../" ], @@ -19,6 +20,5 @@ "files": [ "index.d.ts", "test/index.tsx" - ], - "jsx": "react" + ] } diff --git a/types/recharts/tslint.json b/types/recharts/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/recharts/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From a55ce8b200e430e69967dde36d839dd76a8aacc8 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Mon, 17 Jul 2017 07:46:00 +0200 Subject: [PATCH 4/5] Rename test file --- types/recharts/{test/index.tsx => recharts-tests.tsx} | 0 types/recharts/tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename types/recharts/{test/index.tsx => recharts-tests.tsx} (100%) diff --git a/types/recharts/test/index.tsx b/types/recharts/recharts-tests.tsx similarity index 100% rename from types/recharts/test/index.tsx rename to types/recharts/recharts-tests.tsx diff --git a/types/recharts/tsconfig.json b/types/recharts/tsconfig.json index 06e783c53b..1bd69f0d1e 100644 --- a/types/recharts/tsconfig.json +++ b/types/recharts/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "test/index.tsx" + "recharts-tests.tsx" ] } From 095044055a5f547df00eccf1b330ccbdd6b5785f Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Mon, 17 Jul 2017 21:12:55 +0200 Subject: [PATCH 5/5] Remove types-metadata.json, appears it shouldn't be under VC --- types/recharts/types-metadata.json | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 types/recharts/types-metadata.json diff --git a/types/recharts/types-metadata.json b/types/recharts/types-metadata.json deleted file mode 100644 index 795b5eb678..0000000000 --- a/types/recharts/types-metadata.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "authors": "Maarten Mulders ", - "libraryDependencies": [ - "react" - ], - "moduleDependencies": [], - "libraryMajorVersion": 0, - "libraryMinorVersion": 12, - "typeScriptVersion": "2.0", - "libraryName": "recharts", - "typingsPackageName": "recharts", - "projectName": "http://recharts.org/", - "sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped", - "sourceBranch": "master", - "globals": [ - ], - "declaredModules": [ - "recharts" - ], - "files": [ - "index.d.ts" - ], - "hasPackageJson": false, - "contentHash": "be2be503d947ebda48e7af156e1b24198540234a732125ceb62c14ce759d98d5" -}