I've already included a global value in my global JavaScript context:
const fs = require('fs')
For a specific reason, I need to include it in the global scope.
Now, I want to create a .d.ts file to declare the global variable with a strong type.
But how can I achieve this when 'fs' is a module, not a type?
If I try defining the type like this (in my types.d.ts file)
import * as fsi from 'fs';
declare const fs: fsi;
I encounter an error TS2709: Cannot use namespace 'fsi' as a type.
So, how can I declare a global variable for a module in TypeScript?