@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
31 lines • 1.07 kB
TypeScript
import { MastraServerCache } from './base.js';
/**
* Options for InMemoryServerCache
*/
export interface InMemoryServerCacheOptions {
/**
* Maximum number of items to store in cache.
* Defaults to 1000.
*/
maxSize?: number;
/**
* Default TTL in milliseconds for cached items.
* Defaults to 300000 (5 minutes).
* Set to 0 to disable TTL (items persist until explicitly deleted or evicted).
*/
ttlMs?: number;
}
export declare class InMemoryServerCache extends MastraServerCache {
private cache;
private ttlMs;
constructor(options?: InMemoryServerCacheOptions);
get(key: string): Promise<unknown>;
set(key: string, value: unknown, ttlMs?: number): Promise<void>;
listLength(key: string): Promise<number>;
listPush(key: string, value: unknown): Promise<void>;
listFromTo(key: string, from: number, to?: number): Promise<unknown[]>;
delete(key: string): Promise<void>;
clear(): Promise<void>;
increment(key: string): Promise<number>;
}
//# sourceMappingURL=inmemory.d.ts.map