2022-04-05 15:02:17 +00:00
|
|
|
import { SysCallMapping } from "../system";
|
|
|
|
import { EventHook } from "../hooks/event";
|
2022-03-29 09:21:32 +00:00
|
|
|
|
|
|
|
export function eventSyscalls(eventHook: EventHook): SysCallMapping {
|
|
|
|
return {
|
2022-04-04 09:51:41 +00:00
|
|
|
"event.dispatch": async (ctx, eventName: string, data: any) => {
|
2022-03-29 09:21:32 +00:00
|
|
|
return eventHook.dispatchEvent(eventName, data);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|