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
+13
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
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;