This function creates an anchor element, sets its href attribute to the provided image URL,
and triggers a click event to initiate a download with the specified filename.
What does it unlock?
Main exported function to save images from the configurator. Converts base64 image data to actual image
files and saves them to the local filesystem.
Practical Application
Exported utility function that converts base64 screenshot data (from screenshotReady event) to a downloadable
image file. Handles the base64 → blob → browser download flow. Import directly from the API package.
AI Coding Best Practices
Pattern: api.addEventListener('screenshotReady', (data) => { if(data) saveImage(data, 'config-screenshot.png'); }).
Filename extension should match the MimeType passed to GetScreenshot.
Import: import { saveImage } from '@3dsource/metabox-front-api'.
Saves an image by triggering a download.
This function creates an anchor element, sets its
hrefattribute to the provided image URL, and triggers a click event to initiate a download with the specified filename.What does it unlock?
Main exported function to save images from the configurator. Converts base64 image data to actual image files and saves them to the local filesystem.
Practical Application
Exported utility function that converts base64 screenshot data (from screenshotReady event) to a downloadable image file. Handles the base64 → blob → browser download flow. Import directly from the API package.
AI Coding Best Practices
Pattern:
api.addEventListener('screenshotReady', (data) => { if(data) saveImage(data, 'config-screenshot.png'); }). Filename extension should match the MimeType passed to GetScreenshot. Import:import { saveImage } from '@3dsource/metabox-front-api'.