From 1ca3d432ca3e5f990db9d3dc1aee6123e2158875 Mon Sep 17 00:00:00 2001 From: simusr2 <23080613+simusr2@users.noreply.github.com> Date: Fri, 19 Apr 2019 01:00:54 +0200 Subject: [PATCH] [FIX] Updated some type declaration for tabulator-tables (#34781) * Update index.d.ts Added missing some enum values to predefined types (according to tabulator documentation/examples) * Update index.d.ts Replaced Function with specific function type * Update index.d.ts Updated onRendered type for Formatter type definition * Updated Formatter definition. Updated tabulator-tables-tests according Formatter definition * Update tabulator-tables-tests.ts Fixed Tabulator.EmptyCallback reference in tabulator-tables-tests * Updated ColumnDefinition.align and Tabulator.element ColumnDefinition.align: cannot by "left" | "center" | "right" (not types). Use intead a type as type ColumnDefinitionAlign = "left" | "center" | "right"; Tabulator class implicity has element property. In tabulator source code there are some this.element references --- types/tabulator-tables/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/tabulator-tables/index.d.ts b/types/tabulator-tables/index.d.ts index 749ce30f32..5462c63234 100644 --- a/types/tabulator-tables/index.d.ts +++ b/types/tabulator-tables/index.d.ts @@ -764,7 +764,7 @@ declare namespace Tabulator { interface ColumnDefinition extends ColumnLayout, CellCallbacks { // Layout /** sets the text alignment for this column */ - align?: "left" | "center" | "right"; // Align? + align?: ColumnDefinitionAlign; // Align? /** sets the minimum width of this column, this should be set in pixels (this takes priority over the global option of columnMinWidth) */ minWidth?: number; @@ -1012,6 +1012,7 @@ You can pass an optional additional property with sorter, sorterParams that shou type ScrollToRowPostition = "top" | "center" | "bottom" | "nearest"; type ScrollToColumnPosition = "left" | "center" | "middle" | "right"; + type ColumnDefinitionAlign = "left" | "center" | "right"; interface MoneyParams { // Money @@ -1376,6 +1377,7 @@ declare class Tabulator { browserSlow: boolean; modules: any; options: Tabulator.Options; + element: HTMLElement; /** You have a choice of four file types to choose from: csv - Comma separated value file