Sunday 21 May 2017

TypeScript importing from external module breaks my declaration file

I want to create declaration file for global API interfaces in my main app but some of the interfaces are located in the external core module that I created for sharing same interfaces between platforms.

node_modules/@myproject/core/build/index.d.ts:

...
export interface ISession {
  id: string;
  output: string[];
}
...

types/store.d.ts:

import { ISession } from '@bothosting/api';

declare interface ISessionState {
  list: ISession[];
}

Whenever I import ISession it breaks the whole file and other interfaces in store.d.ts becomes unusable too. I've tried adding reference in declaration and source files but didn't work.



via İbrahim Duran

No comments:

Post a Comment