/** * The main entrypoint when using Deno as the runtime */ import { IRuntime, RunTimeType } from '../common/mod.ts'; import DenoTerminalIO from './terminal_io.ts'; import DenoFileIO from './file_io.ts'; const DenoRuntime: IRuntime = { name: RunTimeType.Deno, file: DenoFileIO, term: DenoTerminalIO, onEvent: (eventName: string, handler) => globalThis.addEventListener(eventName, handler), onExit: (cb: () => void): void => { globalThis.addEventListener('onbeforeunload', cb); }, exit: (code?: number) => Deno.exit(code), }; export default DenoRuntime;