@thorium-dev-group/x402-mcp-extension
Version:
X402-MCP Protocol Extension
24 lines (23 loc) • 798 B
TypeScript
import type { IStorageInterface } from '../interfaces';
interface InMemoryStorageConfig {
ttl?: number;
maxSize?: number;
}
export declare class InMemoryStorage implements IStorageInterface {
private static instance;
private storage;
private readonly defaultTtl;
private readonly maxSize;
private constructor();
static getInstance(config?: InMemoryStorageConfig): InMemoryStorage;
static create(config?: InMemoryStorageConfig): InMemoryStorage;
get(key: string): Promise<string | null>;
set(key: string, value: string, ttl?: number): Promise<void>;
has(key: string): Promise<boolean>;
delete(key: string): Promise<boolean>;
clear(): Promise<void>;
private cleanupExpired;
private evictOldest;
static destroy(): void;
}
export {};