-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.d.ts
42 lines (34 loc) · 821 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
interface Options {
/**
Minimum range.
*/
readonly minimum?: number;
/**
Maximum range.
*/
readonly maximum?: number;
/**
Style for the sparklines.
*/
readonly style?: 'fire';
}
/**
Generate sparklines `▁▂▃▅▂▇`.
@param numbers - The numbers to create the sparkline from.
@example
```
import sparkly from 'sparkly';
sparkly([0, 3, 5, 8, 4, 3, 4, 10]);
//=> '▁▃▄▇▄▃▄█'
// Specifying anything other than finite numbers will cause holes
sparkly([0, 3, 5, '', 4, 3, 4, 10]);
//=> '▁▃▄ ▄▃▄█'
// Specifying an object with minimum and maximum options will change the sparkline range
sparkly([1, 2, 3, 4, 5], {minimum: 0, maximum: 10});
//=> '▁▂▃▄▄'
```
*/
export default function sparkly(
numbers: ReadonlyArray<number | ''>,
options?: Options
): string;