Looking to streamline my JavaScript project by utilizing custom global variables and harnessing the power of VSCode intellisense for auto completion. Here's what I'm aiming for:
See example of auto completion for 'lol'
After some searching, I discovered a technique involving using a lib.d.ts
file in the same directory as my script. As long as lib.d.ts
is standalone like this:
// Contents of "lib.d.ts" file
class Lol {
f() : string;
}
declare const lol : Lol;
everything runs smoothly.
However, when attempting to separate the Lol
class into its own file, intellisense fails to display the lol
variable in my script:
// Contents of "lol.d.ts" file
export default class Lol {
f() : string;
}
// Contents of "lib.d.ts" file
import Lol from "./lol";
declare const lol : Lol;
Is there a solution to this problem?