@a2alite/sdk
Version:
A Modular SDK (Server & Client) for Agent to Agent (A2A) protocol, with easy task lifecycle management
29 lines (28 loc) • 933 B
TypeScript
import { IStore } from "./index.ts";
/**
* In-memory implementation of IStore<T>
*
* InMemoryStore provides a simple, non-persistent storage implementation
* suitable for development and testing. It supports TTL (time-to-live)
* with automatic cleanup of expired entries.
*
* @template T - The type of values stored in this store
*/
declare class InMemoryStore<T = any> implements IStore<T> {
private store;
set(key: string, value: T, ttl?: number): Promise<void>;
get(key: string): Promise<T | undefined>;
delete(key: string): Promise<boolean>;
has(key: string): Promise<boolean>;
clear(): Promise<void>;
keys(): Promise<string[]>;
values(): Promise<T[]>;
entries(): Promise<[string, T][]>;
/**
* Remove expired entries from the store
* Called automatically by methods that enumerate the store
* @private
*/
private cleanupExpired;
}
export { InMemoryStore };