typescript export imporatble from tsd

136 views Asked by At

File index.ts (generated with swagger-codegen)

export * from './api/api';
export * from './model/models';

File tsd.d.ts

...
/// <reference path="path/to/index.ts" />

typescript 2.2.1.

Why do I still need to use import statements (import myDTO from 'path/to/file/myDTO') in my ts files? Am I missing a concept, should a module be declared?

1

There are 1 answers

2
Amid On BEST ANSWER

If in index.ts you have export statements - this make it an external module. In order to consume external module - you must import it.

Some more info on this matter.