I've been trying unsuccessfully to augment a type in agGrid with a few new properties.
import * as agGrid from 'ag-grid/main';
declare module "ag-grid/main" {
export interface ColDef {
format: string;
unitType: string;
}
}
Everything I have tried results in the original ColDef being overwritten and a build error of: Export declaration conflicts with exported declaration of 'ColDef'
So I figured out how to do this. The problem is you cannot augment a re-exported module. You have to directly import it.
This will apply to any library that re-exports it's modules. In the case of agGrid there is a main.d.ts which exports its modules from other definition files which export their modules directly.
More info here. https://github.com/Microsoft/TypeScript/issues/8427