Can someone assist me in determining the type of an imported module in TypeScript? Here is my query: I have a module called module.ts
export class RSL1 {};
Next, I import it into my index.ts
using the following code:
const script = await import('module.js');
The module loads successfully, and when inspected in a browser debug console, it displays as
Module {Symbol(Symbol.toStringTag): "Module"}
However, what is the TypeScript type of the script
variable? The compiler is not aware of the Module
class.
I simply require the generic abstract type of the module, disregarding the "runtime" instance. It seems that the members of the module are dependent on its exports. Yet, I do not need that information.