@expofp/floorplan
Version:
Interactive floor plan library for expos and events
16 lines • 942 B
TypeScript
/**
* Fetches an image as a `Blob`, the form the renderer packs from.
*
* This function returns a `Blob`, not an `HTMLImageElement`, because decoding an image element
* blocks the main thread. At a thousand booth logos, the `HTMLImageElement` route stalls the
* thread for two seconds, and the `Blob` route does not stall it at all. A `Blob` is also a handle
* to bytes that do not change. A worker that receives one gets the handle, not a copy of the bytes.
*
* This function never throws. `normalize-legacy-data.ts` mints the `__small` and `__tiny` logo
* variants by adding a suffix to the full URL. It never confirms that the variant file exists. A
* 404 here is routine. When it happens, the caller retries with its fallback URL.
* @param src - The image URL.
* @returns The bytes, or `null` when the fetch fails.
*/
export declare function loadBlob(src: string): Promise<Blob | null>;
//# sourceMappingURL=loadBlob.d.ts.map