Hacker News new | ask | show | jobs
by sibit 1362 days ago
TypeScript let's you import a libraries types using:

import type X from "package"

So assuming you are pulling in PixiJS with a <script> tag you could npm install the PixiJS package just for the types. It could look like this:

import type * as IPixi from "pixi.js"

declare const PIXI: IPixi

Then when you compile all the "import type" statements will be removed.