Is there a way to use a node module in TypeScript without explicitly importing it after compilation?
For example:
I have a global variable declared in a file named intellisense.ts where I have:
import * as fs from 'fs';
Then in another file, I refer to it like this:
/// <reference path="./intellisense.ts" />
fs.existsSync('...');
However, VSCode intellisense gives an error saying it cannot find the name 'fs'.
Is there a workaround for this issue without importing fs again in the second file?
Please keep in mind:
- I want fs to be imported only once
- I prefer not to export fs from intellisense.ts
- I do not want to import intellisense.ts in any manner
- I do want to have fs in the global scope as a reference