@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
29 lines (28 loc) • 1.15 kB
text/typescript
import { Cache } from "./Cache.mjs";
import { AgentContext } from "../../agent/context/AgentContext.mjs";
import "../../agent/context/index.mjs";
//#region src/modules/cache/InMemoryLruCache.d.ts
interface InMemoryLruCacheOptions {
/** The maximum number of entries allowed in the cache */
limit: number;
}
/**
* In memory LRU cache.
*
* This cache can be used with multiple agent context instances, however all instances will share the same cache.
* If you need the cache to be isolated per agent context instance, make sure to use a different cache implementation.
*/
declare class InMemoryLruCache implements Cache {
private readonly cache;
constructor({
limit
}: InMemoryLruCacheOptions);
get<CacheValue>(_agentContext: AgentContext, key: string): Promise<CacheValue | null>;
set<CacheValue>(_agentContext: AgentContext, key: string, value: CacheValue, expiresInSeconds?: number): Promise<void>;
clear(): void;
remove(_agentContext: AgentContext, key: string): Promise<void>;
private removeExpiredItems;
}
//#endregion
export { InMemoryLruCache, InMemoryLruCacheOptions };
//# sourceMappingURL=InMemoryLruCache.d.mts.map