2023-10-27 16:02:54 -04:00
|
|
|
/**
|
|
|
|
* The main entrypoint when using Deno as the runtime
|
|
|
|
*/
|
2023-11-10 18:22:09 -05:00
|
|
|
import { IRuntime, RunTimeType } from '../common/mod.ts';
|
|
|
|
import DenoFFI from './ffi.ts';
|
|
|
|
import DenoTerminalIO from './terminal_io.ts';
|
2023-10-27 16:02:54 -04:00
|
|
|
|
2023-11-08 15:53:14 -05:00
|
|
|
const DenoRuntime: IRuntime = {
|
2023-11-10 18:22:09 -05:00
|
|
|
name: RunTimeType.Deno,
|
|
|
|
ffi: DenoFFI,
|
|
|
|
io: DenoTerminalIO,
|
|
|
|
onExit: (cb: () => void): void => {
|
|
|
|
globalThis.addEventListener('onbeforeunload', cb);
|
|
|
|
globalThis.onbeforeunload = cb;
|
|
|
|
},
|
|
|
|
exit: (code?: number) => Deno.exit(code),
|
2023-11-08 15:53:14 -05:00
|
|
|
};
|
2023-11-06 18:49:29 -05:00
|
|
|
|
2023-11-08 15:53:14 -05:00
|
|
|
export default DenoRuntime;
|