From b316f99df4612d7f11b1fb8f4e3ab4024f8a604a Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Wed, 19 Aug 2015 19:42:30 +0300 Subject: [PATCH] updated to 1.0.5 version added jsdocs. es6 import added module lscache for es6 import --- lscache/lscache.d.ts | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/lscache/lscache.d.ts b/lscache/lscache.d.ts index 24c34bd8da..340d54b768 100644 --- a/lscache/lscache.d.ts +++ b/lscache/lscache.d.ts @@ -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 // 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; \ No newline at end of file