I need some of the GAPIs, but unfortunately, the best definitions I found are still not complete, and I don't have the time right now to make a tool to regenerate the .d.ts from the discovery files (if someone can suggest a quick way, I am happy to try it). Anyway, my "service" is ready in JavaScript (based on: How to inject custom service to angular component in plain ES5 (Javascript)?), and I am trying to use it in the project:
"use strict";
var ConfigurationService = ng.core.Injectable().Class({
constructor: function() {},
// Other methods here ...
});
export default ConfigurationService;
I have even created a .d.ts for it, but I still can't import:
Of course
"allowJs": true
is there.
Then I have removed the braces, and import was accepted (as long as there is a .d.ts file):
But build fails anyway:
I suppose I am totally wrong here...
Could someone please post a skeleton of an Angular2+ service written in JS, but consumed in TS? Thank you!