Answer the question
In order to leave comments, you need to log in
Is it possible to type imports assigned to variables?
In normal JS, you can do things like this:
// У двух классов общий родитель
import MyClassOne from "./folder";
import MyClassTwo from "./folder";
const obj = {
one: MyClassOne,
two: MyClassTwo
};
// Где-то в другом файле который не знает какие классы установлены
const myClassInstance = new obj.one();
const myClassStaticProperty = obj.two.staticProperty;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question