1
0
silverbullet/plugos/syscalls/asset.ts
2022-10-13 15:16:18 +02:00

15 lines
335 B
TypeScript

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