2024-07-30 23:33:33 +08:00
|
|
|
import type { SysCallMapping, System } from "../system.ts";
|
2022-10-10 20:50:21 +08:00
|
|
|
|
|
|
|
export default function assetSyscalls(system: System<any>): SysCallMapping {
|
|
|
|
return {
|
2024-01-15 23:43:12 +08:00
|
|
|
"asset.readAsset": (_ctx, plugName: string, name: string): string => {
|
|
|
|
return system.loadedPlugs.get(plugName)!.assets!.readFileAsDataUrl(
|
2022-10-13 21:16:18 +08:00
|
|
|
name,
|
|
|
|
);
|
2022-10-10 20:50:21 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|