import type { AssetManager } from '@/lib/assets/assetManager' export type AssetsIndex = { images: string[] fonts: string[] other: string[] } export function buildAssetsIndex(am: AssetManager): Uint8Array { const images: string[] = [] const fonts: string[] = [] const other: string[] = [] for (const ref of am.list()) { if (ref.mimeType.startsWith('image/')) images.push(ref.path) else if (ref.mimeType.startsWith('font/')) fonts.push(ref.path) else other.push(ref.path) } const obj: AssetsIndex = { images, fonts, other } const json = JSON.stringify(obj, null, 2) return new TextEncoder().encode(json) }