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:
Bart van der Schoor
2014-04-22 22:09:35 +02:00
parent 033d3ae33e
commit 09f3d7a8dc
51 changed files with 3420 additions and 0 deletions

View 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
View 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;
}