import type { InMemoryCacheConfiguration } from './memory/InMemoryCache'; import type { InMemoryGroupCacheConfiguration } from './memory/InMemoryGroupCache'; import type { AbstractNotificationConsumer } from './notifications/AbstractNotificationConsumer'; import type { GroupNotificationPublisher } from './notifications/GroupNotificationPublisher'; import type { NotificationPublisher } from './notifications/NotificationPublisher'; import type { Cache, GroupCache } from './types/DataSources'; import type { SynchronousCache, SynchronousGroupCache } from './types/SyncDataSources'; import type { Logger } from './util/Logger'; export type LoaderErrorHandler = (err: Error, key: string | undefined, loader: Record, logger: Logger) => void; export declare const DEFAULT_LOAD_ERROR_HANDLER: LoaderErrorHandler; export declare const DEFAULT_CACHE_ERROR_HANDLER: LoaderErrorHandler; export type CacheKeyResolver = (sourceData: SourceData) => string; export type IdHolder = { id: string; }; export declare const DEFAULT_FROM_STRING_RESOLVER: CacheKeyResolver; export declare const DEFAULT_FROM_ID_RESOLVER: CacheKeyResolver; export declare const DEFAULT_UNDEFINED_FROM_VALUE_RESOLVER: CacheKeyResolver; export type CommonCacheConfig | GroupCache = Cache, InMemoryCacheConfigType extends InMemoryCacheConfiguration | InMemoryGroupCacheConfiguration = InMemoryCacheConfiguration, InMemoryCacheType extends SynchronousCache | SynchronousGroupCache = SynchronousCache, NotificationPublisherType extends NotificationPublisher | GroupNotificationPublisher = NotificationPublisher, LoadParams = string> = { logger?: Logger; cacheUpdateErrorHandler?: LoaderErrorHandler; loadErrorHandler?: LoaderErrorHandler; inMemoryCache?: InMemoryCacheConfigType | false; asyncCache?: CacheType; notificationConsumer?: AbstractNotificationConsumer; notificationPublisher?: NotificationPublisherType; cacheKeyFromLoadParamsResolver?: CacheKeyResolver; cacheKeyFromValueResolver?: CacheKeyResolver; }; export declare abstract class AbstractCache | undefined, CacheType extends Cache | GroupCache = Cache, InMemoryCacheType extends SynchronousCache | SynchronousGroupCache = SynchronousCache, InMemoryCacheConfigType extends InMemoryCacheConfiguration | InMemoryGroupCacheConfiguration = InMemoryCacheConfiguration, NotificationPublisherType extends NotificationPublisher | GroupNotificationPublisher = NotificationPublisher, LoadParams = string> { protected readonly inMemoryCache: InMemoryCacheType; protected readonly asyncCache?: CacheType; readonly cacheKeyFromLoadParamsResolver: CacheKeyResolver; readonly cacheKeyFromValueResolver: CacheKeyResolver; protected readonly logger: Logger; protected readonly cacheUpdateErrorHandler: LoaderErrorHandler; protected readonly loadErrorHandler: LoaderErrorHandler; protected readonly runningLoads: Map; private readonly notificationConsumer?; protected readonly notificationPublisher?: NotificationPublisherType; abstract isGroupCache(): boolean; private initPromises; constructor(config: CommonCacheConfig); init(): Promise; invalidateCache(): Promise; close(): Promise; }