/** * thumbnailCache * * In-memory, client-side cache for rendered component-preview HTML: a * module-level Map that survives editor/document remounts within a single * page load (Puck is force-remounted via `key` on every document switch, * which would otherwise re-render every preview from scratch). * * Deliberately NOT persisted to localStorage: the cached value is later * injected via `dangerouslySetInnerHTML` (see LiveThumbnail), and localStorage * is writable by any same-origin script. Persisting it would let a same-origin * write to a `p1-thumb:*` key plant markup that gets trusted and replayed on a * future load. Keeping the cache in-memory only means an attacker would need * live script execution in this exact session to influence it — at which * point they already have full DOM control and this cache buys them nothing. * * A preview depends only on component name + defaultProps, NOT on the document * being edited, so entries are reused across every page. The key embeds a hash * of the defaultProps plus a caller-supplied version so stale entries * invalidate when a component's inputs change. */ /** * Build a cache key for a component preview. Changing `defaultProps` or * `version` yields a different key, so cached previews invalidate. */ export declare function makeThumbnailKey(name: string, defaultProps: unknown, version?: string): string; /** Cache key for a component preview, shared by LiveThumbnail and ThumbnailCard. */ export declare function getThumbnailCacheKey(config: { components?: Record; } | undefined, name: string, version?: string): string; /** Read a cached preview (in-memory only — see file header for why). */ export declare function getCachedThumbnail(key: string): string | undefined; /** Write a preview to the in-memory cache. */ export declare function setCachedThumbnail(key: string, html: string): void; /** Clear the in-memory cache, plus any stray entries left by an older, localStorage-backed version of this cache. */ export declare function clearThumbnailCache(): void;