let sm = new Slick.SlickRowSelectionModel();
grid.setSelectionModel(sm);
the typescript compiler complain about incompatibility between Slick.SlickRowSelectionModel and the declared prototype of
setSelectionModel found in slick.grid.ts
setSelectionModel(model: SelectionModel) {
if (this.selectionModel) {
this.selectionModel.onSelectedRangesChanged.unsubscribe(this.handleSelectedRangesChanged.bind(this));
if (this.selectionModel.destroy) {
this.selectionModel.destroy();
}
}
Compiler output:
TS2345: Argument of type 'SlickRowSelectionModel' is not assignable to parameter of type 'SelectionModel'.
Type 'SlickRowSelectionModel' is not assignable to type '{ refreshSelections: () => void; onSelectedRangesChanged: SlickEvent<SlickRange[]>; getSelectedRanges: () => SlickRange[]; setSelectedRanges: (ranges: SlickRange[], caller?: string) => void; }'.
Types of property 'onSelectedRangesChanged' are incompatible.
Type 'SlickEvent<CellRange[]>' is not assignable to type 'SlickEvent<SlickRange[]>'.
Type 'CellRange[]' is not assignable to type 'SlickRange[]'.
Type 'CellRange' is missing the following properties from type 'SlickRange': isSingleRow, isSingleCell, contains
this typescript code fails:
the typescript compiler complain about incompatibility between Slick.SlickRowSelectionModel and the declared prototype of setSelectionModel found in slick.grid.ts
setSelectionModel(model: SelectionModel) { if (this.selectionModel) { this.selectionModel.onSelectedRangesChanged.unsubscribe(this.handleSelectedRangesChanged.bind(this)); if (this.selectionModel.destroy) { this.selectionModel.destroy(); } }
Compiler output:
TS2345: Argument of type 'SlickRowSelectionModel' is not assignable to parameter of type 'SelectionModel'. Type 'SlickRowSelectionModel' is not assignable to type '{ refreshSelections: () => void; onSelectedRangesChanged: SlickEvent<SlickRange[]>; getSelectedRanges: () => SlickRange[]; setSelectedRanges: (ranges: SlickRange[], caller?: string) => void; }'. Types of property 'onSelectedRangesChanged' are incompatible. Type 'SlickEvent<CellRange[]>' is not assignable to type 'SlickEvent<SlickRange[]>'. Type 'CellRange[]' is not assignable to type 'SlickRange[]'. Type 'CellRange' is missing the following properties from type 'SlickRange': isSingleRow, isSingleCell, contains