Ag-Grid: Compilation Error [ts] Property 'rowsToDisplay' does not exist on type 'IRowModel'

I am using Ag-grid in my Angular project.

Below is the code:

var displayModel = this.gridOptions.api.getModel();
var rowNode = displayModel.rowsToDisplay[params.rowIndex];

Error is thrown at rowsToDisplay

TS2339: Property 'rowsToDisplay' does not exist on type 'IRowModel'.

I am able to run it successfully, but just not able to compile.

Did I miss importing anything? I am using v17 of ag-grid community version.

To share some background

I use rowsToDisplay, because I want to get the row data by Index, AFTER sorting. the original gridOptions.api.getRowNode will not work for me because it does not consider sorting which will reshuffle the index numbers...correct me if i'm wrong.