I'm making a website app using TypeScript, and I want to use the svg.js library.
I'm coding in TypeScript, and automatically compiling into JavaScript which runs in the browser.
Is this possible? And if so, how?
svg.js provides a .d.ts file so you can use it in typescript out of box.
I am using vscode and it needs no further configuration to provide intellisense.
CommonJS style

ES 6 style
or

vscode integrates js and ts service tightly, so it may provide some kind of auto detection. I never used Atom but I think you can explicitly declare your reference using Triple-Slash Directives
/// <reference path="path/to/yourTypeDeclaration.d.ts" />
// your code follows
If importing this still not helps, you may lack some kind of language service plugins.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With