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..b858309147 --- /dev/null +++ b/types/recharts/index.d.ts @@ -0,0 +1,747 @@ +// 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'; + +export namespace Recharts { + type Percentage = string; + type RechartsFunction = () => void; + + 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 { + } +} diff --git a/types/recharts/recharts-tests.tsx b/types/recharts/recharts-tests.tsx new file mode 100644 index 0000000000..62d3b6f830 --- /dev/null +++ b/types/recharts/recharts-tests.tsx @@ -0,0 +1,20 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; + +import { Recharts } from 'recharts'; + +const data: any[] = []; + +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..1bd69f0d1e --- /dev/null +++ b/types/recharts/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "recharts-tests.tsx" + ] +} 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" +}