1
0
silverbullet/plugos/syscalls/event.ts
2022-04-05 17:02:17 +02:00

11 lines
308 B
TypeScript

import { SysCallMapping } from "../system";
import { EventHook } from "../hooks/event";
export function eventSyscalls(eventHook: EventHook): SysCallMapping {
return {
"event.dispatch": async (ctx, eventName: string, data: any) => {
return eventHook.dispatchEvent(eventName, data);
},
};
}