mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-28 12:30:21 +08:00
Added lscache definition
Added lscache definition
This commit is contained in:
1 parent
39531c32fe
commit
9cd13294ae
3 files changed
+28
-1
No files matched your search
@@ -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