mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-07 16:30:12 +08:00
Move 0.2.0 to own definition files
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
/// <reference path="easy-table.d.ts" />
|
||||
|
||||
import EasyTable = require('easy-table');
|
||||
|
||||
var table = new EasyTable();
|
||||
|
||||
table.cell('aa', 1);
|
||||
table.cell('bb',1);
|
||||
table.newRow();
|
||||
|
||||
table.cell('aa', 1);
|
||||
table.cell('bb',1);
|
||||
|
||||
table.print();
|
||||
|
||||
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
// Type definitions for easy-table 0.2.0
|
||||
// Project: https://github.com/eldargab/easy-table
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "easy-table" {
|
||||
class EasyTable {
|
||||
constructor();
|
||||
|
||||
cell(label: string, value: any, printer?: EasyTable.CellPrinter, width?: number):void;
|
||||
newRow(): void;
|
||||
toString(): string;
|
||||
printTransposed(): string;
|
||||
print(): string;
|
||||
sort(fields: string): void;
|
||||
sort(comparer: (a: any, b: any) => number): void;
|
||||
total(label: string, accumulator: EasyTable.Accumulator, totalPrinter: EasyTable.CellPrinter): void;
|
||||
}
|
||||
|
||||
module EasyTable {
|
||||
function printArray(array: any[], cellPrinter?: CellPrinter, tablePrinter?: Printer): string;
|
||||
function printObject(object: any, cellPrinter?: CellPrinter, tablePrinter?: Printer): string;
|
||||
|
||||
//printer helpers
|
||||
function Number(length: number): CellPrinter;
|
||||
function RightPadder(char: string): CellPrinter;
|
||||
function LeftPadder(char: string): CellPrinter;
|
||||
|
||||
interface CellPrinter extends Function {
|
||||
(obj: any, cell: (label: string, value: any, width?: number) => void):string;
|
||||
}
|
||||
interface Printer extends Function {
|
||||
(table: EasyTable):string;
|
||||
}
|
||||
interface Accumulator extends Function {
|
||||
(sum: number, val: number, index: number, length: number):number;
|
||||
}
|
||||
}
|
||||
|
||||
export = EasyTable;
|
||||
}
|
||||
Reference in New Issue
Block a user