How to declare and import typescript interfaces in a separate file

前端 未结 4 1428
长发绾君心
长发绾君心 2020-12-12 20:14

I want to define several interfaces in their own file in my typescript-based project, from which I\'ll implement classes for production as well as mocks for testing. However

4条回答
  •  情深已故
    2020-12-12 20:37

    Use definition (d.ts) files and namespaces, no need to import/export modules this way. DefinitelyTyped project has guidance and huge number of examples how to do it.

提交回复
热议问题