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