mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
imported 25 definitions from typescript-node-definitions
first batch: the easy pickings - as per https://github.com/borisyankov/DefinitelyTyped/issues/115 - added DT headers (scraped creators from git history) - added tests - some modifications - added CONTRIBUTORS.md for the substantial defs (>50 LOC)
This commit is contained in:
24
memory-cache/memory-cache-tests.ts
Normal file
24
memory-cache/memory-cache-tests.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
/// <reference path="memory-cache.d.ts" />
|
||||
|
||||
import memoryCache = require('memory-cache');
|
||||
|
||||
var key: any;
|
||||
var value: any;
|
||||
var bool: boolean;
|
||||
var num: number;
|
||||
|
||||
memoryCache.put(key, value);
|
||||
memoryCache.put(key, value, num);
|
||||
memoryCache.put(key, value, num, (key) => {
|
||||
|
||||
});
|
||||
value = memoryCache.get(key);
|
||||
memoryCache.del(key);
|
||||
memoryCache.clear();
|
||||
|
||||
num = memoryCache.size();
|
||||
num = memoryCache.memsize();
|
||||
|
||||
memoryCache.debug(bool);
|
||||
num = memoryCache.hits();
|
||||
num = memoryCache.misses();
|
||||
20
memory-cache/memory-cache.d.ts
vendored
Normal file
20
memory-cache/memory-cache.d.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// Type definitions for memory-cache
|
||||
// Project: http://github.com/ptarjan/node-cache
|
||||
// Definitions by: Jeff Goddard <https://github.com/jedigo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// Imported from: https://github.com/soywiz/typescript-node-definitions/memory-cache.d.ts
|
||||
|
||||
declare module "memory-cache" {
|
||||
export function put(key: any, value: any, time?: number, timeoutCallback?: (key: any) => void): void;
|
||||
export function get(key: any): any;
|
||||
export function del(key: any): void;
|
||||
export function clear(): void;
|
||||
|
||||
export function size(): number;
|
||||
export function memsize(): number;
|
||||
|
||||
export function debug(bool: boolean): void;
|
||||
export function hits(): number;
|
||||
export function misses(): number;
|
||||
}
|
||||
Reference in New Issue
Block a user