Answer the question
In order to leave comments, you need to log in
How to make a class available for type designation in any project file?
There is a Dom.ts file which contains the DomElement class and there are many other class files in which the constructor accepts an instance of the DomElement class or methods accept/return it. And I have to import it in all these files, just to specify the type. Is there any other option?
I don't understand how .d.ts files work.
I declared in such a file and this type became available throughout the project. How to do the same with a class? type EventType = 'click' | 'input' | 'mousedown'
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