1
0
silverbullet/plugos/syscalls/asset.ts
2022-10-12 11:47:13 +02:00

15 lines
410 B
TypeScript

import { SysCallMapping, System } from "../system.ts";
import { AssetBundle } from "../asset_bundle/bundle.ts";
export default function assetSyscalls(system: System<any>): SysCallMapping {
return {
"asset.readAsset": (
ctx,
name: string,
): string => {
return (system.loadedPlugs.get(ctx.plug.name)!.manifest!
.assets as AssetBundle).readFileAsDataUrl(name);
},
};
}