import { CacheInclusionPolicyService } from './cache-inclusion-policy'; import type { CacheUpdate } from './cache-update'; import type { CacheQuery } from './cache-query'; import type { CacheEntry, Key, NamedCacheService, Cache } from '@conduit-client/service-cache/v1'; import type { CacheInclusionPolicyServiceDescriptor } from './cache-inclusion-policy'; import type { DeepReadonly, Result, SyncOrAsync } from '@conduit-client/utils'; /** * Implementation of CacheInclusionPolicy that uses a single level, in memory, * synchronous L1 cache. */ export declare class InMemoryCacheInclusionPolicy extends CacheInclusionPolicyService { protected services: NamedCacheService; constructor(services: NamedCacheService); /** * Reads data out of a single level in memory store. */ read>(options: { l1: Cache; readFromL1: (l1: Cache) => SyncOrAsync; }): SyncOrAsync; /** * Writes data to a single level in memory store. */ write>(options: { l1: Cache; writeToL1: (l1: Cache) => SyncOrAsync; }): SyncOrAsync; /** * Finds cache entries that match the given query. * Returns an async generator that yields `[key, entry]`. */ find(query: CacheQuery): AsyncGenerator<[key: Key, value: DeepReadonly>], void, unknown>; /** * Finds and modifies cache entries that match the given query. * Extends `find(query)` and returns an async generator of modified keys. */ findAndModify(query: CacheQuery, cacheUpdate: CacheUpdate): AsyncGenerator; } /** * Constructs an in-memory-only CacheInclusionPolicy. * * @returns in-memory-only CacheInclusionPolicy */ export declare function buildInMemoryCacheInclusionPolicyService(cache: Cache): CacheInclusionPolicyServiceDescriptor;