import type { CacheControlMetadata, CacheEntry } from '@conduit-client/service-cache/v1'; export type CacheUpdate = { type: CacheOperation; }; export type CacheOperation = 'invalidate' | 'evict'; /** * Processes a cache update operation and determines the appropriate modification. * * This function analyzes the provided `update` and the `existing` cache entry * to determine the necessary update type. It returns one of three possible outcomes: * * - `{ type: 'entry', entry }`: A full cache entry update, including both value and metadata. * - `{ type: 'metadata', metadata }`: A metadata-only update, leaving the value unchanged. * - `{ type: 'no-op' }`: No changes are needed, and the cache should remain as is. * * @param update - The cache update operation to apply. * @param existing - The existing cache entry being modified. * @returns An object indicating the type of update: * - A full cache entry update (`type: 'entry'`) * - A metadata-only update (`type: 'metadata'`) * - A delete update if eviction is called for (`type: 'delete'`) * - A no-op (`type: 'no-op'`) if no changes are required. */ export declare function buildUpdate(update: CacheUpdate, existing: CacheEntry): { type: 'entry'; entry: CacheEntry; } | { type: 'metadata'; metadata: CacheControlMetadata; } | { type: 'delete'; } | { type: 'no-op'; };