mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Added new definitions for asciichart (#36273)
This commit is contained in:
committed by
Daniel Rosenwasser
parent
24b24fa197
commit
845d001fe5
@@ -0,0 +1,16 @@
|
||||
import * as asciichart from 'asciichart';
|
||||
|
||||
asciichart.plot([1, 2, 3]);
|
||||
asciichart.plot([1, 2, 3], {});
|
||||
asciichart.plot([1, 2, 3], { offset: 4 });
|
||||
asciichart.plot([1, 2, 3], { padding: ' > ' });
|
||||
asciichart.plot([1, 2, 3], { height: 10 });
|
||||
asciichart.plot([1, 2, 3], { format: x => x.toFixed(1) });
|
||||
asciichart.plot([1, 2, 3], { format: (x, i) => (i === 2 ? ' * ' : x.toFixed(2)) });
|
||||
|
||||
asciichart.plot([1, 2, 3], {
|
||||
offset: 4,
|
||||
padding: ' >',
|
||||
height: 10,
|
||||
format: (x, i) => (i === 2 ? ' * ' : x.toFixed(2)),
|
||||
});
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// Type definitions for asciichart 1.5
|
||||
// Project: https://github.com/kroitor/asciichart
|
||||
// Definitions by: pokutuna <https://github.com/DefinitelyTyped>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface PlotConfig {
|
||||
offset?: number;
|
||||
padding?: string;
|
||||
height?: number;
|
||||
format?: (x: number, i: number) => string;
|
||||
}
|
||||
|
||||
export function plot(series: ReadonlyArray<number>, cfg?: PlotConfig): string;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"asciichart-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user