Skip to content

Commit 282b9b7

Browse files
committed
types
1 parent 314352a commit 282b9b7

File tree

2 files changed

+79
-1
lines changed

2 files changed

+79
-1
lines changed

build/index.d.ts

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Type definitions for @jrwats/react-sparklines 1.7
2+
// Project: https://github.com/jrwats/react-sparklines#readme
3+
// TypeScript Version: 2.8
4+
5+
import * as React from 'react';
6+
7+
export interface Point {
8+
x: number;
9+
y: number;
10+
}
11+
12+
export interface SparklinesProps {
13+
children?: React.ReactNode;
14+
data?: number[] | undefined;
15+
limit?: number | undefined;
16+
width?: number | undefined;
17+
height?: number | undefined;
18+
svgWidth?: React.SVGAttributes<React.ReactSVGElement>['width'] | undefined;
19+
svgHeight?: React.SVGAttributes<React.ReactSVGElement>['height'] | undefined;
20+
preserveAspectRatio?: React.SVGAttributes<React.ReactSVGElement>['preserveAspectRatio'] | undefined;
21+
margin?: number | undefined;
22+
min?: number | undefined;
23+
max?: number | undefined;
24+
style?: React.SVGAttributes<React.ReactSVGElement>['style'] | undefined;
25+
}
26+
export class Sparklines extends React.PureComponent<SparklinesProps> {}
27+
28+
export interface SparklinesBarsProps {
29+
points?: Point[] | undefined;
30+
height?: number | undefined;
31+
style?: React.SVGAttributes<React.ReactSVGElement>['style'] | undefined;
32+
barWidth?: number | undefined;
33+
margin?: number | undefined;
34+
onMouseMove?: ((p: Point, event: React.MouseEvent<React.ReactSVGElement>) => void) | undefined;
35+
}
36+
export class SparklinesBars extends React.Component<SparklinesBarsProps> {}
37+
38+
export interface SparklinesCurveProps {
39+
color?: React.SVGAttributes<React.ReactSVGElement>['color'] | undefined;
40+
style?: React.SVGAttributes<React.ReactSVGElement>['style'] | undefined;
41+
}
42+
export class SparklinesCurve extends React.Component<SparklinesCurveProps> {}
43+
44+
export interface SparklinesLineProps {
45+
color?: React.SVGAttributes<React.ReactSVGElement>['color'] | undefined;
46+
style?: React.SVGAttributes<React.ReactSVGElement>['style'] | undefined;
47+
onMouseMove?: ((event: 'enter' | 'click', value: number, point: Point) => void) | undefined;
48+
}
49+
export class SparklinesLine extends React.Component<SparklinesLineProps> {}
50+
51+
export interface SparklinesNormalBandProps {
52+
style?: React.SVGAttributes<React.ReactSVGElement>['style'] | undefined;
53+
}
54+
export class SparklinesNormalBand extends React.Component<SparklinesNormalBandProps> {}
55+
56+
export interface SparklinesReferenceLineProps {
57+
type?: 'max' | 'min' | 'mean' | 'avg' | 'median' | 'custom' | undefined;
58+
value?: number | undefined;
59+
style?: React.SVGAttributes<React.ReactSVGElement>['style'] | undefined;
60+
}
61+
export class SparklinesReferenceLine extends React.Component<SparklinesReferenceLineProps> {}
62+
63+
export interface SparklinesSpotsProps {
64+
size?: number | undefined;
65+
style?: React.SVGAttributes<React.ReactSVGElement>['style'] | undefined;
66+
spotColors?: { [change: string]: string } | undefined;
67+
}
68+
export class SparklinesSpots extends React.Component<SparklinesSpotsProps> {}
69+
70+
export interface SparklinesTextProps {
71+
text?: string | undefined;
72+
point?: Point | undefined;
73+
fontSize?: number | undefined;
74+
fontFamily?: string | undefined;
75+
}
76+
export class SparklinesText extends React.Component<SparklinesTextProps> {}
77+

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "@jrwats/react-sparklines",
3-
"version": "1.7.1",
3+
"version": "1.7.3",
44
"description": "Hacked up / forked Sparklines",
55
"main": "build/index.js",
6+
"types": "build/index.d.ts",
67
"directories": {
78
"src": "src/"
89
},

0 commit comments

Comments
 (0)