This repository has been archived on 2026-05-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
novarix-networks-homepage/node_modules/next/dist/server/resume-data-cache/cache-store.d.ts
T
Kismet Hasanaj 34dc9aec52 .
2026-05-02 20:07:02 +02:00

54 lines
2.1 KiB
TypeScript

import type { CachedFetchValue } from '../response-cache/types';
import type { CollectedCacheResult } from '../use-cache/use-cache-wrapper';
/**
* A generic cache store type that provides a subset of Map functionality
*/
type CacheStore<T> = Pick<Map<string, T>, 'entries' | 'keys' | 'size' | 'get' | 'set' | typeof Symbol.iterator>;
/**
* A cache store specifically for fetch cache values
*/
export type FetchCacheStore = CacheStore<CachedFetchValue>;
/**
* A cache store for encrypted bound args of inline server functions.
*/
export type EncryptedBoundArgsCacheStore = CacheStore<string>;
/**
* An in-memory-only cache store for decrypted bound args of inline server
* functions.
*/
export type DecryptedBoundArgsCacheStore = CacheStore<string>;
/**
* Serialized format for "use cache" entries
*/
export interface UseCacheCacheStoreSerialized {
entry: {
value: string;
tags: string[];
stale: number;
timestamp: number;
expire: number;
revalidate: number;
};
hasExplicitRevalidate: boolean | undefined;
hasExplicitExpire: boolean | undefined;
readRootParamNames: string[] | undefined;
}
/**
* A cache store specifically for "use cache" values that stores promises of
* collected cache results (entry + metadata).
*/
export type UseCacheCacheStore = CacheStore<Promise<CollectedCacheResult>>;
/**
* Parses serialized cache entries into a UseCacheCacheStore
* @param entries - The serialized entries to parse
* @returns A new UseCacheCacheStore containing the parsed entries
*/
export declare function parseUseCacheCacheStore(entries: Iterable<[string, UseCacheCacheStoreSerialized]>): UseCacheCacheStore;
/**
* Serializes UseCacheCacheStore entries into an array of key-value pairs
* @param entries - The store entries to stringify
* @returns A promise that resolves to an array of key-value pairs with serialized values
*/
export declare function serializeUseCacheCacheStore(entries: IterableIterator<[string, Promise<CollectedCacheResult>]>, isCacheComponentsEnabled: boolean): Promise<Array<[string, UseCacheCacheStoreSerialized] | null>>;
export {};