1
0
silverbullet/packages/plugos/syscalls/event.ts

14 lines
384 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);
},
"event.list": async () => {
return eventHook.listEvents();
},
};
}