From 9cd13294ae6c8b16ea7595e2ca0ce12e04ece6bd Mon Sep 17 00:00:00 2001 From: Chris Martinez Date: Tue, 11 Nov 2014 12:24:13 -0500 Subject: [PATCH] Added lscache definition Added lscache definition --- CONTRIBUTORS.md | 3 ++- lscache/lscache-tests.ts | 13 +++++++++++++ lscache/lscache.d.ts | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 lscache/lscache-tests.ts create mode 100644 lscache/lscache.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a628bd4814..e10ca14d4c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -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)) diff --git a/lscache/lscache-tests.ts b/lscache/lscache-tests.ts new file mode 100644 index 0000000000..103cb6c8c9 --- /dev/null +++ b/lscache/lscache-tests.ts @@ -0,0 +1,13 @@ +/// + +// 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); \ No newline at end of file diff --git a/lscache/lscache.d.ts b/lscache/lscache.d.ts new file mode 100644 index 0000000000..777c89421c --- /dev/null +++ b/lscache/lscache.d.ts @@ -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; \ No newline at end of file