cache.ts
3 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
Reference
fncomputeCacheKey(templateSource: string, props: Record<string, unknown>, width: number, height: number): stringComputes a cache key from template + props + options.
Computes a cache key from template + props + options.
Parameters
-
templateSourcestring -
propsRecord -
widthnumber -
heightnumber
Returns
string
fngetCached(cacheDir: string, key: string): Promise<Buffer | null>Checks if a cached PNG exists for the given key. Returns the cached file path i…
Checks if a cached PNG exists for the given key. Returns the cached file path if found, null otherwise.
Parameters
-
cacheDirstring -
keystring
Returns
Promise
fnwriteCache(cacheDir: string, key: string, png: Buffer): Promise<void>Writes a PNG buffer to the cache.
Writes a PNG buffer to the cache.
Parameters
-
cacheDirstring -
keystring -
pngBuffer
Returns
Promise