I am using ag-Grid with TypeScript and trying to create an async value setter in my column definition.
const columnDefs: ColDef[] = [
{
headerName: 'Name',
field: 'name',
editable: true,
valueSetter: async (params: ValueSetterParams): Promise<boolean> => {
return await doSomething(params); // Will return the change boolean
}
},
//...other columns
But TypeScript complains that this signature is not supported because the colDef.d.ts
definition file has
valueSetter?: ((params: ValueSetterParams) => boolean) | string;
However, if I just use // @ts-ignore
to ignore the TypeScript error it seems to be respecting the await
and my code executes in the right order.
Is it just an issue with the TypeScript definition file? Or does ag-Grid not support async value setters?
Some environment info:
- ag-Grid 22.1.0
- TypeScript 3.7.2
- Aurelia (which uses WebPack, npm, etc.)
- WebStorm 2019.3.1