2022-04-03 16:42:12 +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);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|