I have an Angular2 project where i need to import a javascript file for use in my typescript.
I have a javascript file in app/js/d3gantt.js which contains a single function of gantt = function().
gantt = function() {
//Does lots of stuff
return gantt;
};
I then have a definition file called d3gannt.d.ts in the same folder which looks like this:
declare module 'd3Gantt' {
export module d3Gantt {
export function gantt(): any;
}
}
And then i reference it in my component as
import * as d3Gantt from '../app/js/d3gantt';
However, i get the error message stating File 'c:/Projects/RepackLog/RepackLog/RepackLog/app/js/d3gantt.d.ts' is not a module
Am i missing something that is needed for this to pick up my files properly?
Thanks,
export gantt;on your **app/js/d3gantt.js **