Get Free Trial

Incorrect typing in flexmonster.d.ts

Answered
Michael Einsohn asked on November 19, 2021

The docs say that Flexmonster.Options.grid.showTotals takes a string value, with these recognized values: ‘on’ ‘off’, ‘rows’, or ‘columns’.
 
When trying to add the value ‘rows’, the TS compiler throws because the typing, defined in node_modules/flexmonster/types/flexmonster.d.ts declares the property as a boolean on line 353:

showTotals?: boolean; // this should be string

changing the type to string works, when tested locally, but the solution can’t be shared with the team. 
For now I’ve resorted to this in my calling component:

...
// @ts-ignore
showTotals: 'rows',
...

Please update the npm package when you can.
Thanks!

1 answer

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster 7 days ago

Hi Michael,
 
Thank you for noticing this, the showTotals type should indeed be a string.
 
We are going to fix this in our upcoming release on ETA Nov 29th
 
Please let us know if there is anything else we can help you with in the meantime.
 
Best regards,
Mykhailo

Please login or Register to Submit Answer