From 4f619edd20e9b5b7d018a35a433831701ef03e6c Mon Sep 17 00:00:00 2001 From: Eugenio Arosteguy Date: Tue, 19 Sep 2017 12:23:15 -0300 Subject: [PATCH 1/3] types for tabulator --- types/tabulator/index.d.ts | 13 +++++++++++++ types/tabulator/tabulator-tests.ts | 1 + types/tabulator/tsconfig.json | 22 ++++++++++++++++++++++ types/tabulator/tslint.json | 1 + 4 files changed, 37 insertions(+) create mode 100644 types/tabulator/index.d.ts create mode 100644 types/tabulator/tabulator-tests.ts create mode 100644 types/tabulator/tsconfig.json create mode 100644 types/tabulator/tslint.json diff --git a/types/tabulator/index.d.ts b/types/tabulator/index.d.ts new file mode 100644 index 0000000000..146a5ad9e0 --- /dev/null +++ b/types/tabulator/index.d.ts @@ -0,0 +1,13 @@ +export as namespace tabulatorLib; +// TypeScript Version: 2.2 + +export = Tabulator; + +/*~ Write your module's methods and properties in this class */ +declare class Tabulator { + constructor(); + // myMethod(opts: Tabulator.chartType): number; + defaultShowAttribute: string; + toMatrix(datum: object): object; + toHtmlTable(matrix: object): any; +} diff --git a/types/tabulator/tabulator-tests.ts b/types/tabulator/tabulator-tests.ts new file mode 100644 index 0000000000..9c2a22cacb --- /dev/null +++ b/types/tabulator/tabulator-tests.ts @@ -0,0 +1 @@ +let tab = new tabulatorLib(); diff --git a/types/tabulator/tsconfig.json b/types/tabulator/tsconfig.json new file mode 100644 index 0000000000..32db9cfaad --- /dev/null +++ b/types/tabulator/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "tabulator-tests.ts" + ] +} diff --git a/types/tabulator/tslint.json b/types/tabulator/tslint.json new file mode 100644 index 0000000000..c17ac4dd6d --- /dev/null +++ b/types/tabulator/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dtslint.json" } From b4a4549fa20b93204ec58e2708685c20b21d4efe Mon Sep 17 00:00:00 2001 From: Eugenio Arosteguy Date: Tue, 19 Sep 2017 13:50:56 -0300 Subject: [PATCH 2/3] fixing tests --- types/tabulator/index.d.ts | 5 +++++ types/tabulator/tslint.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/tabulator/index.d.ts b/types/tabulator/index.d.ts index 146a5ad9e0..a773396f2c 100644 --- a/types/tabulator/index.d.ts +++ b/types/tabulator/index.d.ts @@ -1,3 +1,8 @@ +// Type definitions for tabulator 0.1 +// Project: https://github.com/codenautas/tabulator +// Definitions by: Eugenio Arosteguy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + export as namespace tabulatorLib; // TypeScript Version: 2.2 diff --git a/types/tabulator/tslint.json b/types/tabulator/tslint.json index c17ac4dd6d..3db14f85ea 100644 --- a/types/tabulator/tslint.json +++ b/types/tabulator/tslint.json @@ -1 +1 @@ -{ "extends": "dtslint/dtslint.json" } +{ "extends": "dtslint/dt.json" } From 17c24c4695c9532b6c645598e53b4d71667c099a Mon Sep 17 00:00:00 2001 From: Eugenio Arosteguy Date: Tue, 19 Sep 2017 13:56:48 -0300 Subject: [PATCH 3/3] adding more test --- types/tabulator/tabulator-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/tabulator/tabulator-tests.ts b/types/tabulator/tabulator-tests.ts index 9c2a22cacb..2cd6f9e245 100644 --- a/types/tabulator/tabulator-tests.ts +++ b/types/tabulator/tabulator-tests.ts @@ -1 +1,5 @@ let tab = new tabulatorLib(); +tab.defaultShowAttribute = 'valor'; +let datum = { a: 'aaa' }; +let matrix = tab.toMatrix(datum); +tab.toHtmlTable(matrix);