import type { ExecutableExpression } from "../ast/executableExpression.js"; import type { BaseObject } from "../objects/baseObject.js"; import type { FullObject } from "../objects/fullObject.js"; import type { RuntimeError } from "../runtimeError.js"; import { InterpreterModule } from "./interpreterModule.js"; /** * The result of an interpreter run */ export interface InterpretationResult { /** * The result of the execution */ result?: BaseObject; /** * The global scope, can be used to process results * Only provided if no error was thrown */ globalScope?: FullObject; /** * If existing, the error which caused the abortion of the execution */ error?: RuntimeError; } /** * Interpreter able to execute scripts * Must be reset after each execution */ export declare class Interpreter { private readonly maxExecutionSteps; /** * Sorted consistent modules loaded before each execution */ private readonly modules; /** * Creates a new Interpreter. * Provided modules are checked for consistency and oredered. * An error is thrown if a module has unsatisfied dependencies, * * @param modules loaded modules * @param optionalModules modules which are only loaded if required by any required module * @param maxExecutionSteps the maximum number of steps the interpreter is allowed to execute */ constructor(modules: InterpreterModule[], optionalModules: InterpreterModule[], maxExecutionSteps: number); /** * Evaluates a list of expressions with all modules loaded * * @param expressions the expressions to evaluate * @returns the result of the interpretation, consting of a scope or an error */ run(expressions: ExecutableExpression[]): InterpretationResult; } //# sourceMappingURL=interpreter.d.ts.map