Skip to content

Commit

Permalink
Merge pull request #55 from aarne/feat_better_types
Browse files Browse the repository at this point in the history
fix: Manual typings with generics
  • Loading branch information
avoidwork committed Sep 23, 2022
2 parents be34bbe + 517ef2d commit ac60da1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lru.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export function lru(max?: number, ttl?: number): LRU;
declare class LRU {
constructor(max?: number, ttl?: number);
first: any;
items: any;
last: any;
export function lru<T = any>(max?: number, ttl?: number): LRU<T>;
export interface LRU<T> {
first: T | null;
last: T | null;
max: number;
size: number;
ttl: number;

has(key: any): boolean;
clear(): LRU;
delete(key: any): LRU;
evict(bypass?: boolean): LRU;
get(key: any): any;
clear(): this;
delete(key: any): this;
evict(bypass?: boolean): this;
get(key: any): T | undefined;
keys(): string[];
set(key: any, value: any, bypass?: boolean): LRU;
set(key: any, value: T, bypass?: boolean): this;
}
export {};
export { };

0 comments on commit ac60da1

Please sign in to comment.