I'm using TypeScript and a moment.js plugin called 'moment-transform'.
moment-transform dynamically adds a transform function to the moment object. Usage is something like this:
import moment = require('moment');
require('moment-transform'); // simply adds transform function
moment().transform('YYYY-MM-+07 00:00:00.000').toDate();
However, when building this with TypeScript, I get this error:
error TS2339: Property 'transform' does not exist on type 'Moment'.
How would I handle dynamically added functions properly?
[edit] (moment() as any).transform('YYYY-MM-+07 00:00:00.000').toDate(); seems to work. Is this really the way to go? Is there any possibility to specify this globally??