1- import { OnEventArgs , CellArgs , SlickEventHandler } from './../models/index' ;
1+ import { CellArgs , Column , GridOption , OnEventArgs , SlickEventHandler } from './../models/index' ;
22
33// using external non-typed js libraries
44declare var Slick : any ;
@@ -17,11 +17,11 @@ export class GridEventService {
1717 /* OnCellChange Event */
1818 bindOnCellChange ( grid : any , dataView : any ) {
1919 // subscribe to this Slickgrid event of onCellChange
20- this . _eventHandler . subscribe ( grid . onCellChange , ( e : Event , args : CellArgs ) => {
20+ this . _eventHandler . subscribe ( grid . onCellChange , ( e : KeyboardEvent | MouseEvent , args : CellArgs ) => {
2121 if ( ! e || ! args || ! grid || args . cell === undefined || ! grid . getColumns || ! grid . getDataItem ) {
2222 return ;
2323 }
24- const column = grid . getColumns ( ) [ args . cell ] ;
24+ const column : Column = grid . getColumns ( ) [ args . cell ] ;
2525
2626 // if the column definition has a onCellChange property (a callback function), then run it
2727 if ( typeof column . onCellChange === 'function' ) {
@@ -43,12 +43,12 @@ export class GridEventService {
4343
4444 /* OnClick Event */
4545 bindOnClick ( grid : any , dataView : any ) {
46- this . _eventHandler . subscribe ( grid . onClick , ( e : Event , args : CellArgs ) => {
46+ this . _eventHandler . subscribe ( grid . onClick , ( e : KeyboardEvent | MouseEvent , args : CellArgs ) => {
4747 if ( ! e || ! args || ! grid || args . cell === undefined || ! grid . getColumns || ! grid . getDataItem ) {
4848 return ;
4949 }
50- const column = grid && grid . getColumns && grid . getColumns ( ) [ args . cell ] ;
51- const gridOptions = grid && grid . getOptions && grid . getOptions ( ) || { } ;
50+ const column : Column = grid && grid . getColumns && grid . getColumns ( ) [ args . cell ] ;
51+ const gridOptions : GridOption = grid && grid . getOptions && grid . getOptions ( ) || { } ;
5252
5353 // only when using autoCommitEdit, we will make the cell active (in focus) when clicked
5454 // setting the cell as active as a side effect and if autoCommitEdit is set to false then the Editors won't save correctly
0 commit comments