The type definition for the ngstorage library is as follows:
import * as angular from 'angular';
declare module 'angular' {
export namespace storage {
export interface IStorageService {
//interface definition
}
export interface IStorageProvider extends angular.IServiceProvider {
//interface definition
}
}
}
Three questions:
- What exactly happens when the already-existing module 'angular' is declared again, as happens on line 3 of this example?
- What does it mean to export a namespace inside a module definition
export namespace storage? How do I import
IStorageServiceinto my.tsfiles? Nothing I've tried so far works.import { IStorageService } from 'ngstorage'import { IStorageService } from 'angular.storage'or just directly refer to IStorageService like so:
angular.storage.IStorageService