Skip to content

Commit

Permalink
Ensure TypeScript generics are propagated to options (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiospampinato authored Jun 1, 2020
1 parent c205876 commit 0e67d68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare namespace QuickLRU {
interface Options {
interface Options<KeyType, ValueType> {
/**
The maximum number of items before evicting the least recently used items.
*/
Expand All @@ -10,7 +10,7 @@ declare namespace QuickLRU {
Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`).
*/
onEviction?: <KeyType, ValueType>(key: KeyType, value: ValueType) => void;
onEviction?: (key: KeyType, value: ValueType) => void;
}
}

Expand Down Expand Up @@ -41,7 +41,7 @@ declare class QuickLRU<KeyType, ValueType>
//=> '🌈'
```
*/
constructor(options: QuickLRU.Options);
constructor(options: QuickLRU.Options<KeyType, ValueType>);

[Symbol.iterator](): IterableIterator<[KeyType, ValueType]>;

Expand Down

0 comments on commit 0e67d68

Please sign in to comment.