@luolapeikko/cache-types
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -166,2 +166,17 @@ /** | ||
export type { IAsyncCache, ICache }; | ||
/** | ||
* Cache events map. | ||
* @version 0.0.3 | ||
* @example | ||
* class MyCache extends EventEmitter<CacheEventsMap<string>> {} | ||
*/ | ||
type CacheEventsMap<Payload, Key = string> = { | ||
get: [key: Key]; | ||
set: [key: Key, payload: Payload, expires: Date | undefined]; | ||
delete: [key: Key]; | ||
has: [key: Key]; | ||
expire: [key: Key, payload: Payload]; | ||
clear: []; | ||
}; | ||
export type { CacheEventsMap, IAsyncCache, ICache }; |
{ | ||
"name": "@luolapeikko/cache-types", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Typescript cache interfaces", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
15977
195