import { InProcessMathJSLabRuntime, RuntimeWorkerServer, type RuntimeWorkerServerScope } from 'mathjslab/runtime'; import { commonExternalFunctionTable } from './commonExternalFunctionTable'; import { withActiveInterpreter } from './InterpreterRuntime'; import { workerAliasNameTable } from './languageAlias'; new RuntimeWorkerServer( globalThis as unknown as RuntimeWorkerServerScope, (host) => new InProcessMathJSLabRuntime({ host, sessionDefaults: { interpreter: { externalFunctionTable: commonExternalFunctionTable, aliasNameTable: workerAliasNameTable }, parfor: 'fallback' }, evaluate: (interpreter, operation) => ({ value: withActiveInterpreter(interpreter, operation) }), }), );