Produce a ``window.fastledAssetManifest = {...}`` JS snippet. Used by the WASM HTML template to inject the manifest before the FastLED runtime boots. Callers splice the returned string into a `` `` tag.
(scan: AssetScanResult)
| 208 | |
| 209 | |
| 210 | def manifest_to_js_bootstrap(scan: AssetScanResult) -> str: |
| 211 | """Produce a ``window.fastledAssetManifest = {...}`` JS snippet. |
| 212 | |
| 213 | Used by the WASM HTML template to inject the manifest before the FastLED |
| 214 | runtime boots. Callers splice the returned string into a ``<script>`` tag. |
| 215 | """ |
| 216 | payload = json.dumps(scan.to_json_dict(), sort_keys=True) |
| 217 | return f"window.fastledAssetManifest = {payload};\n" |
| 218 | |
| 219 | |
| 220 | def manifest_to_cpp_header(scan: AssetScanResult) -> str: |