mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Values in localStorage are not only strings
The user of the lib can put all types of values into localStorage. So the ILocalStorageService should be a generic.
This commit is contained in:
+3
-3
@@ -75,7 +75,7 @@ declare module ng.local.storage {
|
||||
|
||||
}
|
||||
|
||||
interface ILocalStorageService {
|
||||
interface ILocalStorageService<T> {
|
||||
/**
|
||||
* Checks if the browser support the current storage type(e.g: localStorage, sessionStorage).
|
||||
* Returns: Boolean
|
||||
@@ -99,7 +99,7 @@ declare module ng.local.storage {
|
||||
* Returns: value from local storage
|
||||
* @param key
|
||||
*/
|
||||
get(key: string): string;
|
||||
get(key: string): T;
|
||||
/**
|
||||
* Return array of keys for local storage, ignore keys that not owned.
|
||||
* Returns: value from local storage
|
||||
@@ -146,4 +146,4 @@ declare module ng.local.storage {
|
||||
*/
|
||||
cookie:ICookie;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user