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 that contains a single function gantt = function().
gantt = function() {
return gantt;
};
Then I have a d3gannt.d.ts definition file in the same folder that looks like this:
declare module 'd3Gantt' {
export module d3Gantt {
export function gantt(): any;
}
}
And then I refer to it in my component as
import * as d3Gantt from '../app/js/d3gantt';
However, I get an error File 'c:/Projects/RepackLog/RepackLog/RepackLog/app/js/d3gantt.d.ts' is not a module
Am I missing something that is necessary for this to select my files correctly?
Thank,
source
share