mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Added lscache definition
Added lscache definition
This commit is contained in:
@@ -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);
|
||||
Vendored
+13
@@ -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;
|
||||
Reference in New Issue
Block a user