Merge pull request #4136 from cwoolum/master

Update Local Storage Definition
This commit is contained in:
Masahiro Wakame
2015-04-18 23:28:49 +09:00
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam
* [:link:](angular-bootstrap-lightbox/angular-bootstrap-lightbox.d.ts) [angular-bootstrap-lightbox](https://github.com/compact/angular-bootstrap-lightbox) by [Roland Zwaga](https://github.com/rolandzwaga)
* [:link:](angular-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27), [Stefan Steinhart](https://github.com/reppners)
* [:link:](angular-http-auth/angular-http-auth.d.ts) [angular-http-auth](https://github.com/witoldsz/angular-http-auth) by [vvakame](https://github.com/vvakame)
* [:link:](angular-local-storage/angular-local-storage.d.ts) [angular-local-storage](https://github.com/grevory/angular-local-storage) by [Ken Fukuyama](https://github.com/kenfdev)
* [:link:](angular-local-storage/angular-local-storage.d.ts) [angular-local-storage](https://github.com/grevory/angular-local-storage) by [Ken Fukuyama](https://github.com/kenfdev),[Chris Woolum](https://github.com/cwoolum)
* [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped)
* [:link:](angular-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann)
* [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal)
@@ -13,7 +13,7 @@ interface TestScope extends ng.IScope {
}
export class TestController {
constructor($scope: TestScope, localStorageService: ng.local.storage.ILocalStorageService<string>) {
constructor($scope: TestScope, localStorageService: ng.local.storage.ILocalStorageService) {
// isSupported
if (localStorageService.isSupported) {
// do something
@@ -29,7 +29,7 @@ export class TestController {
// get
$scope.getItem = (key) => {
return localStorageService.get(key);
return localStorageService.get<string>(key);
};
// remove
+3 -3
View File
@@ -75,7 +75,7 @@ declare module angular.local.storage {
}
interface ILocalStorageService<T> {
interface ILocalStorageService {
/**
* Checks if the browser support the current storage type(e.g: localStorage, sessionStorage).
* Returns: Boolean
@@ -92,14 +92,14 @@ declare module angular.local.storage {
* @param key
* @param value
*/
set(key: string, value: T): boolean;
set<T>(key: string, value: T): boolean;
/**
* Directly get a value from local storage.
* If local storage is not supported, use cookies instead.
* Returns: value from local storage
* @param key
*/
get(key: string): T;
get<T>(key: string): T;
/**
* Return array of keys for local storage, ignore keys that not owned.
* Returns: value from local storage