UNPKG

@waku/sdk

Version:

A unified SDK for easy creation and management of js-waku nodes.

17 lines (16 loc) 574 B
export declare class TTLSet<T> { private readonly ttlMs; private cleanupIntervalId; private readonly entryTimestamps; /** * Creates a new CustomSet with TTL functionality. * @param ttlMs - The time-to-live in milliseconds for each entry. * @param cleanupIntervalMs - Optional interval between cleanup operations (default: 5000ms). */ constructor(ttlMs: number, cleanupIntervalMs?: number); dispose(): void; add(entry: T): this; has(entry: T): boolean; private startCleanupInterval; private removeExpiredEntries; }