From a7b029e1c225ac74cad334ffbb411b7c27675021 Mon Sep 17 00:00:00 2001 From: Joe Skeen Date: Mon, 28 Sep 2015 16:14:13 -0600 Subject: [PATCH] Minor adjustments based on code review --- ui-grid/ui-grid-tests.ts | 4 ++-- ui-grid/ui-grid.d.ts | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ui-grid/ui-grid-tests.ts b/ui-grid/ui-grid-tests.ts index 7f53e9514..95c81298a 100644 --- a/ui-grid/ui-grid-tests.ts +++ b/ui-grid/ui-grid-tests.ts @@ -95,7 +95,7 @@ columnDef.width = 100; columnDef.width = '*'; -var gridApi: uiGrid.IGridApi; +var gridApi: uiGrid.IGridApiOf; var gridInstance: uiGrid.IGridInstanceOf; var menuItem: uiGrid.IMenuItem; var colProcessor: uiGrid.IColumnProcessor; @@ -128,5 +128,5 @@ anotherGridInstance.scrollTo(); anotherGridInstance.scrollTo(rowEntityToScrollTo); anotherGridInstance.scrollTo(rowEntityToScrollTo, columnDefToScrollTo); -var selectedRowEntities: Array = gridApi.selection.getSelectedRows(); +var selectedRowEntities: Array = gridApi.selection.getSelectedRows(); var selectedGridRows: Array = gridApi.selection.getSelectedGridRows(); diff --git a/ui-grid/ui-grid.d.ts b/ui-grid/ui-grid.d.ts index 97c3cb2d8..481326b13 100644 --- a/ui-grid/ui-grid.d.ts +++ b/ui-grid/ui-grid.d.ts @@ -287,7 +287,7 @@ declare module uiGrid { * * Rows are identified using the hashKey if configured. If not configured, then rows * are identified using the gridOptions.rowEquality function - * @param {Array} newRawData The new grid data + * @param {Array} newRawData The new grid data * @return {ng.IPromise} Promise which resolves when the rows have been created or removed */ modifyRows(newRawData: Array): ng.IPromise; @@ -742,7 +742,7 @@ declare module uiGrid { * if needed * @param {IGridApi} gridApi */ - onRegisterApi?: (gridApi: IGridApi) => void; + onRegisterApi?: (gridApi: IGridApiOf) => void; /** * The height of the row in pixels, defaults to 30 * @default 30 @@ -1038,7 +1038,7 @@ declare module uiGrid { * Filter changed event callback * @param {IGridApi} gridApi grid api */ - (gridApi: IGridApi): void; + (gridApi: IGridApiOf): void; } export interface rowsRenderedHandler { @@ -1046,7 +1046,7 @@ declare module uiGrid { * Rows rendered event callback * @param {IGridApi} gridApi Grid api object */ - (gridApi: IGridApi): void; + (gridApi: IGridApiOf): void; } export interface rowsVisibleChangedHandler { @@ -1054,7 +1054,7 @@ declare module uiGrid { * Rows visible changed event callback * @param {IGridApi} gridApi grid api object */ - (gridApi: IGridApi): void; + (gridApi: IGridApiOf): void; } export interface scrollBeginHandler { @@ -1533,7 +1533,7 @@ declare module uiGrid { * This promise is needed when exporting all rows, and the data need to be provided by server side. * Default is null * @default null - * @returns {ng.IPromise>} A promise to load all data from server + * @returns {ng.IPromise>} A promise to load all data from server */ exporterAllDataFn?: () => ng.IPromise>; /** @@ -1541,7 +1541,7 @@ declare module uiGrid { * DEPRECATED - exporterAllDataFn used to be called this, but it wasn't a promise, * it was a function that returned a promise. Deprecated, but supported for backward compatibility, * use exporterAllDataFn instead. - * @returns {ng.IPromise>} A promise to load all data from server + * @returns {ng.IPromise>} A promise to load all data from server */ exporterAllDataPromise?: () => ng.IPromise>; /** @@ -1981,7 +1981,7 @@ declare module uiGrid { * The grid generally doesn't add rows to the source data array, * it is tidier to handle this through a user callback. * @param {IGridInstance} grid The grid we're importing into, may be useful in some way - * @param {Array} newObjects An array of new objects that you should add to your data + * @param {Array} newObjects An array of new objects that you should add to your data */ importerDataAddCallback?: (grid: IGridInstanceOf, newObjects: Array) => void; /** @@ -2497,7 +2497,7 @@ declare module uiGrid { * Sets each of the rows passed in dataRows to be clean, * removing them from the dirty cache and the error cache, * and clearing the error flag and the dirty flag - * @param {Array} dataRows the data entities for which the gridRows should be set clean + * @param {Array} dataRows the data entities for which the gridRows should be set clean */ setRowsClean(dataRows: Array): void; /** @@ -2505,7 +2505,7 @@ declare module uiGrid { * Note that if you have only just inserted the rows into your data, * you will need to wait for a $digest cycle before the gridRows are present. As a result, this is often * wrapped with $interval or $timeout. - * @param {Array} dataRows the data entities for which the gridRows should be set dirty + * @param {Array} dataRows the data entities for which the gridRows should be set dirty */ setRowsDirty(dataRows: Array): void; /** @@ -2841,7 +2841,7 @@ declare module uiGrid { getSelectedGridRows(): Array>; /** * Gets selected rows as entities - * @returns {Array} Selected row entities + * @returns {Array} Selected row entities */ getSelectedRows(): Array; /** @@ -3218,9 +3218,10 @@ declare module uiGrid { // Tree View export interface IGridApiConstructor { - new (grid: IGridInstanceOf): IGridApi; + new (grid: IGridInstanceOf): IGridApiOf; } - export interface IGridApi { + export type IGridApi = IGridApiOf; + export interface IGridApiOf { /** * Registers a new event for the given feature. The event will get a .raise and .on prepended to it *