2022-10-10 12:50:21 +00:00
|
|
|
import { SysCallMapping } from "../system.ts";
|
|
|
|
import { EventHook } from "../hooks/event.ts";
|
2022-03-29 09:21:32 +00:00
|
|
|
|
|
|
|
export function eventSyscalls(eventHook: EventHook): SysCallMapping {
|
|
|
|
return {
|
2022-10-10 12:50:21 +00:00
|
|
|
"event.dispatch": (_ctx, eventName: string, data: any) => {
|
2022-03-29 09:21:32 +00:00
|
|
|
return eventHook.dispatchEvent(eventName, data);
|
|
|
|
},
|
2022-10-10 12:50:21 +00:00
|
|
|
"event.list": () => {
|
2022-07-04 13:07:27 +00:00
|
|
|
return eventHook.listEvents();
|
|
|
|
},
|
2022-03-29 09:21:32 +00:00
|
|
|
};
|
|
|
|
}
|