-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add TypeScript typings * Apply suggestions from code review Co-authored-by: Luke Edwards <[email protected]>
- Loading branch information
1 parent
9cd75ab
commit 2e5c7f8
Showing
3 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
declare interface Options { | ||
max?: number; | ||
maxAge?: number; | ||
stale?: boolean; | ||
} | ||
|
||
declare class Cache<K, V> extends Map<K, V> { | ||
constructor(options?: Options | number); | ||
get(key: K, refresh?: boolean): V | undefined; | ||
peek(key: K): V | undefined; | ||
set(key: K, value: V, maxAge?: number): this; | ||
} | ||
|
||
export = Cache; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters