diff --git a/slickgrid/SlickGrid.d.ts b/slickgrid/SlickGrid.d.ts index b7810f467..9e66b9647 100644 --- a/slickgrid/SlickGrid.d.ts +++ b/slickgrid/SlickGrid.d.ts @@ -689,8 +689,8 @@ declare module Slick { topPanelHeight?: number; } - export interface DataProvider { - getItem(index: number): SlickData; + export interface DataProvider { + getItem(index: number): T; getLength(): number; } @@ -705,7 +705,7 @@ declare module Slick { * The grid also provides two helper methods to simplify development - getSelectedRows() and setSelectedRows(rowsArray), as well as an onSelectedRowsChanged event. * SlickGrid includes two pre-made selection models - Slick.CellSelectionModel and Slick.RowSelectionModel, but you can easily write a custom one. **/ - export class SelectionModel { + export class SelectionModel { /** * An initializer function that will be called with an instance of the grid whenever a selection model is registered with setSelectionModel. The selection model can use this to initialize its state and subscribe to grid events. **/ @@ -740,12 +740,12 @@ declare module Slick { options: GridOptions); constructor( container: string, - data: DataProvider, + data: DataProvider, columns: Column[], options: GridOptions); constructor( container: HTMLElement, - data: DataProvider, + data: DataProvider, columns: Column[], options: GridOptions); @@ -779,11 +779,18 @@ declare module Slick { /** * Sets a new source for databinding and removes all rendered rows. Note that this doesn't render the new rows - you can follow it with a call to render() to do that. - * @param newData New databinding source. This can either be a regular JavaScript array or a custom object exposing getItem(index) and getLength() functions. + * @param newData New databinding source using a regular JavaScript array.. * @param scrollToTop If true, the grid will reset the vertical scroll position to the top of the grid. **/ public setData(newData: T[], scrollToTop: boolean): void; + /** + * Sets a new source for databinding and removes all rendered rows. Note that this doesn't render the new rows - you can follow it with a call to render() to do that. + * @param newData New databinding source using a custom object exposing getItem(index) and getLength() functions. + * @param scrollToTop If true, the grid will reset the vertical scroll position to the top of the grid. + **/ + public setData(newData: DataProvider, scrollToTop: boolean): void; + /** * Returns the size of the databinding source. * @return @@ -1478,7 +1485,7 @@ declare module Slick { * Item -> Data by index * Row -> Data by row **/ - export class DataView implements DataProvider { + export class DataView implements DataProvider { constructor(options?: DataViewOptions); @@ -1548,7 +1555,7 @@ declare module Slick { public syncGridCellCssStyles(grid: Grid, key: string): void; public getLength(): number; - public getItem(index: number): SlickData; + public getItem(index: number): T; public getItemMetadata(): void; public onRowCountChanged: Slick.Event;