mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added lscache definition
Added lscache definition
This commit is contained in:
parent
39531c32fe
commit
9cd13294ae
@ -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
13
lscache/lscache-tests.ts
Normal 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
13
lscache/lscache.d.ts
vendored
Normal 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;
|
||||
Loading…
Reference in New Issue
Block a user