diff --git a/types/ui-grid/index.d.ts b/types/ui-grid/index.d.ts index 7bf551c59f..748dda3bf9 100644 --- a/types/ui-grid/index.d.ts +++ b/types/ui-grid/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for ui-grid // Project: http://www.ui-grid.info/ -// Definitions by: Ben Tesser , Joe Skeen +// Definitions by: Ben Tesser +// Joe Skeen +// Peter Bojanczyk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -3545,6 +3547,8 @@ declare namespace uiGrid { export interface IGridColumnOf { /** Column definition */ colDef: uiGrid.IColumnDefOf; + /** Default sort on this column */ + defaultSort?: ISortInfo; /** * Column name that will be shown in the header. * If displayName is not provided then one is generated using the name. @@ -3683,6 +3687,8 @@ declare namespace uiGrid { * @default false */ cellTooltip?: boolean | string | ICellTooltipGetter; + /** Default object of sort information */ + defaultSort?: ISortInfo; /** * Column name that will be shown in the header. * If displayName is not provided then one is generated using the name. diff --git a/types/ui-grid/ui-grid-tests.ts b/types/ui-grid/ui-grid-tests.ts index 06f18384a5..e1d49a481d 100644 --- a/types/ui-grid/ui-grid-tests.ts +++ b/types/ui-grid/ui-grid-tests.ts @@ -22,6 +22,11 @@ columnDef.cellTooltip = 'blah'; columnDef.cellTooltip = function (gridRow: uiGrid.IGridRow, gridCol: uiGrid.IGridColumn) { return `${gridRow.entity.unknownProperty}-${gridCol.displayName}`; }; +columnDef.defaultSort = { + direction: 'ASC', + ignoreSort: false, + priority: 1 +}; columnDef.displayName = 'Jumper'; columnDef.enableColumnMenu = false; columnDef.enableColumnMenus = false;