Added lscache definition

Added lscache definition
This commit is contained in:
Chris Martinez 2014-11-11 12:24:13 -05:00
parent 39531c32fe
commit 9cd13294ae
3 changed files with 28 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# Contributors
# Contributors
This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url.
@ -270,6 +270,7 @@ All definitions files include a header with the author and editors, so at some p
* [Lodash](http://lodash.com/) (by [Brian Zengel](https://github.com/bczengel))
* [Logg](https://github.com/dpup/node-logg) (by [Bret Little](https://github.com/blittle))
* [Long.js](https://github.com/dcodeIO/Long.js) (by [Toshihide Hara](https://github.com/kerug))
* [lscache](https://github.com/pamelafox/lscache) (by [Chris Martinez](https://github.com/Chris-Martinezz))
* [lz-string](https://github.com/pieroxy/lz-string) (by [Roman Nikitin](https://github.com/M0ns1gn0r))
* [Mapbox](https://github.com/mapbox/mapbox.js/) (by [Maxime Fabre](https://github.com/anahkiasen))
* [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr))

13
lscache/lscache-tests.ts Normal file
View File

@ -0,0 +1,13 @@
/// <reference path="lscache.d.ts" />
// Copied examples directly from lscache github site with slight modifications
lscache.set('greeting', 'Hello World!', 2);
alert(lscache.get('greeting'));
lscache.remove('greeting');
lscache.set('data', { 'name': 'Pamela', 'age': 26 }, 2);
alert(lscache.get('data').name);

13
lscache/lscache.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// Type definitions for lscache v1.0.2
// Project: https://github.com/pamelafox/lscache
// Definitions by: Chris Martinez https://github.com/Chris-Martinezz
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface LSCache {
set(key: string, value: any, time?: number): void;
get(key: string): any;
remove(key: string): void;
}
declare var lscache: LSCache;