Skip to content

Commit

Permalink
Simplified index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ktaeyln committed Mar 21, 2018
1 parent f9a1aeb commit b60447f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 5 additions & 13 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
/// <reference types="node" />

module lru_weak_cache {
declare interface LRUWeakCacheGenerator {
(key: string, callback: (err: Error, value?: V) => void): void;
}
declare interface LRUWeakCache<V extends object> extends Map<string, V> {
generate(key: string, generator: LRUWeakCacheGenerator, callback: (err: Error, value?: V) => void): void;
}
declare interface LRUWeakCacheConstructor {
new (options: {timeout?: number,capacity?: number,retimeOnAccess?:boolean}): LRUWeakCache;
}
declare var LRUWeakCache: LRUWeakCacheConstructor;
}
module "lru-weak-cache" {
export = lru_weak_cache.LRUWeakCacheConstructor;
declare class LRUWeakCache<V extends object> extends Map<string, V> {
constructor(options: {timeout?:number,capacity?:number,retimeOnAccess?:boolean});
generate(key: string, generator: (key: string, callback: (err: Error, value?: V) => void) => void, callback: (err: Error, value?: V) => void): void;
}
export = LRUWeakCache;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lru-weak-cache",
"version": "0.1.2",
"version": "0.1.3",
"description": "A caching Map<string, ?> that deletes the least-recently-accessed items with weak references.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit b60447f

Please sign in to comment.