1
0
silverbullet/plugos/syscalls/event.ts
Zef Hemel 561aa6891f
Migrate to Deno (#86)
Big bang migration to Deno 🤯
2022-10-10 14:50:21 +02:00

14 lines
379 B
TypeScript

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