scroll/src/deno/mod.ts

20 lines
496 B
JavaScript

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