typescripttsdswagger-codegen

typescript export imporatble from tsd


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?


Solution

  • 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.