UNPKG

js-slang

Version:

Javascript-based implementations of Source, written in Typescript

22 lines (21 loc) 947 B
import { type IOptions, type Result } from '..'; import { type Context, type RecursivePartial } from '../types'; import type { FileGetter } from '../modules/moduleTypes'; /** * Returns both the Result of the evaluated program, as well as * `verboseErrors`. */ export declare function sourceFilesRunner(filesInput: FileGetter, entrypointFilePath: string, context: Context, options?: RecursivePartial<IOptions>): Promise<{ result: Result; verboseErrors: boolean; }>; /** * Useful for just running a single line of code with the given context * However, if this single line of code is an import statement, * then the FileGetter is necessary, otherwise all local imports will * fail with ModuleNotFoundError */ export declare function runCodeInSource(code: string, context: Context, options?: RecursivePartial<IOptions>, defaultFilePath?: string, fileGetter?: FileGetter): Promise<{ result: Result; verboseErrors: boolean; }>;