From 8306a72db37043e35afddec3dde2af0fb38899ea Mon Sep 17 00:00:00 2001 From: Jim Hartford Date: Wed, 22 Mar 2017 09:58:50 -0400 Subject: [PATCH 1/2] Added title attribute to avoid the following error: ERROR in /Users/jimhartford/Sites/test-app/src/app/components/app.component.ts (28,36): Argument of type '{ dom: string; "lengthMenu": (string | number)[][]; buttons: ({ extend: string; className: string...' is not assignable to parameter of type 'Settings'. Types of property 'buttons' are incompatible. Type '({ extend: string; className: string; } | { extend: string; title: string; className: string; })[]' is not assignable to type 'boolean | string[] | ButtonSettings[]'. Type '({ extend: string; className: string; } | { extend: string; title: string; className: string; })[]' is not assignable to type 'ButtonSettings[]'. Type '{ extend: string; className: string; } | { extend: string; title: string; className: string; }' is not assignable to type 'ButtonSettings'. Type '{ extend: string; title: string; className: string; }' is not assignable to type 'ButtonSettings'. Object literal may only specify known properties, and 'title' does not exist in type 'ButtonSettings'.) --- datatables.net-buttons/datatables.net-buttons-tests.ts | 1 + datatables.net-buttons/index.d.ts | 7 ++++++- datatables.net-buttons/tsconfig.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/datatables.net-buttons/datatables.net-buttons-tests.ts b/datatables.net-buttons/datatables.net-buttons-tests.ts index 6acbbeaf8a..015917c456 100644 --- a/datatables.net-buttons/datatables.net-buttons-tests.ts +++ b/datatables.net-buttons/datatables.net-buttons-tests.ts @@ -22,6 +22,7 @@ $(document).ready(function () { name: 'name', namespace: 'namespace', titleAttr: 'title', + title: 'title' } ], } diff --git a/datatables.net-buttons/index.d.ts b/datatables.net-buttons/index.d.ts index b4ed4b0eb5..5be5b7b93a 100644 --- a/datatables.net-buttons/index.d.ts +++ b/datatables.net-buttons/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for JQuery DataTables Buttons extension 1.1.0 // Project: http://datatables.net/extensions/buttons/ -// Definitions by: Sam Germano +// Definitions by: Sam Germano , Jim Hartford // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -80,6 +80,11 @@ declare namespace DataTables { */ titleAttr?: string; + /** + * Button 'title' text + */ + title?: string; + exportOptions?: ButtonExportOptions; autoPrint?: boolean; customize?: FunctionButtonCustomize; diff --git a/datatables.net-buttons/tsconfig.json b/datatables.net-buttons/tsconfig.json index 5e407ab2d8..bf477f34b0 100644 --- a/datatables.net-buttons/tsconfig.json +++ b/datatables.net-buttons/tsconfig.json @@ -12,7 +12,7 @@ "typeRoots": [ "../" ], - "types": [], + "types": ["jquery","datatables.net"], "noEmit": true, "forceConsistentCasingInFileNames": true }, From b048216318c4c083c3dfdfef414f5ab550a92943 Mon Sep 17 00:00:00 2001 From: Jim Hartford Date: Wed, 22 Mar 2017 10:04:40 -0400 Subject: [PATCH 2/2] removed added types in tsconfig.json --- datatables.net-buttons/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datatables.net-buttons/tsconfig.json b/datatables.net-buttons/tsconfig.json index bf477f34b0..5e407ab2d8 100644 --- a/datatables.net-buttons/tsconfig.json +++ b/datatables.net-buttons/tsconfig.json @@ -12,7 +12,7 @@ "typeRoots": [ "../" ], - "types": ["jquery","datatables.net"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true },