Declaring a single type - “using” equivalent for single type

前端 未结 2 1904
别跟我提以往
别跟我提以往 2021-01-12 00:36

In C# I can do this:

using IAnyType = App.Namespace.Types.IAnyType ;
class BaseClass : IAnyType { }

Is there a Typescript equivalent?

2条回答
  •  广开言路
    2021-01-12 01:01

    I too am annoyed that you can't alias things the way you might expect. What I've done is ended up using abbreviated 'namespaces' to keep things short.

    import RSV = module("views/researchSectionView")
    var r = new RSV.ResearchSectionView();
    

提交回复
热议问题