diff --git a/types/tabulator-tables/index.d.ts b/types/tabulator-tables/index.d.ts index 1161efb0acbe51..be15ae819d1aa1 100755 --- a/types/tabulator-tables/index.d.ts +++ b/types/tabulator-tables/index.d.ts @@ -1556,7 +1556,9 @@ export type GroupValuesArg = any[][]; export type TextDirection = "auto" | "ltr" | "rtl"; -export type GlobalTooltipOption = boolean | ((event: MouseEvent, cell: CellComponent, onRender: () => void) => string); +export type GlobalTooltipOption = + | boolean + | ((event: MouseEvent, cell: CellComponent, onRender: () => void) => string | HTMLElement); export type CustomMutator = ( value: any, diff --git a/types/tabulator-tables/package.json b/types/tabulator-tables/package.json index 9a6243749f1625..949271c8c55f0c 100644 --- a/types/tabulator-tables/package.json +++ b/types/tabulator-tables/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/tabulator-tables", - "version": "6.2.9999", + "version": "6.3.9999", "projects": [ "http://tabulator.info" ], diff --git a/types/tabulator-tables/tabulator-tables-tests.ts b/types/tabulator-tables/tabulator-tables-tests.ts index 33b8d6abfba946..7bca1800fb5239 100644 --- a/types/tabulator-tables/tabulator-tables-tests.ts +++ b/types/tabulator-tables/tabulator-tables-tests.ts @@ -440,6 +440,23 @@ colDef.tooltip = (event: MouseEvent, cell: CellComponent, onRendered: (callback: return cell.getValue(); }; +// Additional tests for tooltip signature / return values +// boolean values +colDef.tooltip = false; +colDef.tooltip = true; + +// function returning a string +colDef.tooltip = (e: MouseEvent, cell: CellComponent) => { + return "Tooltip"; +}; + +// function returning an HTMLElement +colDef.tooltip = (e: MouseEvent, cell: CellComponent) => { + const el = document.createElement("div"); + el.innerText = "Tooltip"; + return el; +}; + // Cell Component let cell = {};