import { ColDef , GridOptions } from '@ag-grid-community/core' ; declare var PartialMatchFilter ; const columnDefs = [ { field : 'row' } , { field : 'name' , filter : 'partialMatchFilter' , menuTabs : [ 'filterMenuTab' ] , } , ] ; const gridOptions = { defaultColDef : { editable : true , sortable : true , flex : 1 , minWidth : 100 , filter : true , resizable : true , } , columnDefs : columnDefs , rowData : getData ( ) , components : { partialMatchFilter : PartialMatchFilter , } , } ; function onClicked ( ) { gridOptions . api ! . getFilterInstance ( 'name' , function ( instance ) { ; ( instance as any ) . componentMethod ( 'Hello World!' ) ; } ) ; } document . addEventListener ( 'DOMContentLoaded' , function ( ) { var gridDiv = document . querySelector ( '#myGrid' ) ; new agGrid . Grid ( gridDiv , gridOptions ) ; gridOptions . api ! . sizeColumnsToFit ( ) ; } ) ;