I\'m trying to create typescript definitions for a Angular 2 project I\'m working on so that it can be an exportable library.
I have several services setup that ret
As of today, the compiler won't automatically import types for you in a declaration file.
The best workaround for now is to manually disable your lint rules for the import, or to import the type and use an explicit type annotation so that the linter marks it as a usage.
In other words
// Explicit import of 'Observable' so that '.d.ts' files
// can be generated correctly.
import { Observable } from "node_modules/rxjs/Observable";
// Explicit use of 'Observable' to satisfy your linter.
public create(user: User): Observable {
return this.http.post(this._apiUrls.create,
JSON.stringify(user), {
headers: this.apiConfig.getApiHeaders()
});
}