mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
updated to 1.0.5 version added jsdocs. es6 import
added module lscache for es6 import
This commit is contained in:
Vendored
+38
-3
@@ -1,13 +1,48 @@
|
||||
// Type definitions for lscache v1.0.2
|
||||
// Type definitions for lscache v1.0.5
|
||||
// Project: https://github.com/pamelafox/lscache
|
||||
// Definitions by: Chris Martinez <https://github.com/Chris-Martinezz>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface LSCache {
|
||||
|
||||
/**
|
||||
* Stores the value in localStorage. Expires after specified number of minutes.
|
||||
* @param {string} key
|
||||
* @param {Object|string} value
|
||||
* @param {number} time
|
||||
*/
|
||||
set(key: string, value: any, time?: number): void;
|
||||
/**
|
||||
* Retrieves specified value from localStorage, if not expired.
|
||||
* @param {string} key
|
||||
* @return {string|Object}
|
||||
*/
|
||||
get(key: string): any;
|
||||
/**
|
||||
* Removes a value from localStorage.
|
||||
* Equivalent to 'delete' in memcache, but that's a keyword in JS.
|
||||
* @param {string} key
|
||||
*/
|
||||
remove(key: string): void;
|
||||
/**
|
||||
* Flushes all lscache items and expiry markers without affecting rest of localStorage
|
||||
*/
|
||||
flush(): void;
|
||||
/**
|
||||
* Flushes expired lscache items and expiry markers without affecting rest of localStorage
|
||||
*/
|
||||
flushExpired(): void;
|
||||
/**
|
||||
* Appends CACHE_PREFIX so lscache will partition data in to different buckets.
|
||||
* @param {string} bucket
|
||||
*/
|
||||
setBucket(bucket: string);
|
||||
/**
|
||||
* Resets the string being appended to CACHE_PREFIX so lscache will use the default storage behavior.
|
||||
*/
|
||||
resetBucket(): void;
|
||||
}
|
||||
declare module 'lscache' {
|
||||
var lscache: LSCache;
|
||||
export = lscache;
|
||||
}
|
||||
|
||||
declare var lscache: LSCache;
|
||||
Reference in New Issue
Block a user