@river-build/web3
Version:
Dapps for our Space and Registry contracts
20 lines • 628 B
TypeScript
export interface Keyable {
toKey(): string;
}
export interface CacheResult<V> {
value: V;
cacheHit: boolean;
isPositive: boolean;
}
export declare class EntitlementCache<K extends Keyable, V> {
private readonly negativeCache;
private readonly positiveCache;
constructor(options?: {
positiveCacheTTLSeconds: number;
negativeCacheTTLSeconds: number;
positiveCacheSize?: number;
negativeCacheSize?: number;
});
executeUsingCache(keyable: K, onCacheMiss: (k: K) => Promise<CacheResult<V>>): Promise<CacheResult<V>>;
}
//# sourceMappingURL=EntitlementCache.d.ts.map