ag grid - Typescript augmentation -




i've been trying unsuccessfully augment type in aggrid few new properties.

import * aggrid 'ag-grid/main';  declare module "ag-grid/main" {    export interface coldef {        format: string;        unittype: string;    } } 

everything have tried results in original coldef being overwritten , build error of: export declaration conflicts exported declaration of 'coldef'

so figured out how this. problem cannot augment re-exported module. have directly import it.

import coldef 'ag-grid/dist/lib/entities/coldef'; // patch coldef interface allows add new properties it. declare module "ag-grid/dist/lib/entities/coldef" {     interface coldef {         format?: string;         unittype?: string;     } } 

this apply library re-exports it's modules. in case of aggrid there main.d.ts exports modules other definition files export modules directly.

more info here. https://github.com/microsoft/typescript/issues/8427





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -