I am currently using TypeScript 2.1.5 in conjunction with Visual Studio 2015. The project has been set up to utilize the "ES 2015" module system and ECMAScript 6.
My current challenge involves implementing the Angular Local Storage module, as outlined by DefinitelyTyped:
declare module 'angular' {
export namespace local.storage {
interface ILocalStorageService {
}
}
}
Therefore, in one of my services, I aim to import this interface for practical use:
module Foooooo.Services {
export class FooService {
constructor(private localStorageService: local.storage.ILocalStorageService) {
}
}
}
Despite extensive research and studying the documentation thoroughly, I have tried multiple methods without success:
import local from "angular"; // unsuccessful attempt
import * as ang from "angular"; // causing resolution issues with other interfaces
import { local } from "angular"; // compilation failure
import { ILocalStorageService } from "angular"; // unresolved interfaces
import { local.ILocalStorageService } from "angular"; // not working
import ILocalStorageService = require("angular"); // unsurmountable error message regarding compatibility with ECMAScript 6 or newer
How can I achieve a successful import in this scenario?