ReefVM/src/index.ts

14 lines
544 B
TypeScript

import type { Bytecode } from "./bytecode"
import { type Value } from "./value"
import { VM } from "./vm"
export async function run(bytecode: Bytecode, functions?: Record<string, Function>): Promise<Value> {
const vm = new VM(bytecode, functions)
return await vm.run()
}
export { type Bytecode, toBytecode, type ProgramItem } from "./bytecode"
export { wrapNative } from "./function"
export { type Value, toValue, toString, toNumber, fromValue, toNull } from "./value"
export { VM } from "./vm"
export { bytecodeToString } from "./format"