@rbxts/insitux
Version:
Extensible s-expression scripting language enabling players to safely mod Roblox games themselves.
41 lines (40 loc) • 2.02 kB
TypeScript
export declare const insituxVersion = 230723;
import { Env, InvokeResult } from "./types";
import { Ctx, ErrCtx, Val } from "./types";
export declare function removeExternalOperations(functionNames: string[]): void;
/**
* Parses and executes the given code.
* @param ctx An environment context you retain.
* @param code The code to parse and execute.
* @param invokeId A unique ID referenced in invocation errors.
* @param printResult Automatically print the final value of this invocation?
* @returns Invocation errors caused during execution of the code,
* or the final value of the invocation.
*/
export declare function invoke(ctx: Ctx, code: string, invokeId: string, printResult?: boolean, params?: Val[]): InvokeResult;
/**
* Executes a user-defined Insitux function by name.
* @param ctx An environment context you retain.
* @param funcName The function to execute.
* @param params The parameters to pass to the function.
* @param printResult Automatically print the final value of this invocation?
* @returns Invocation errors caused during execution of the function,
* or the final value of the invocation,
* or undefined if the function was not found.
*/
export declare function invokeFunction(ctx: Ctx, funcName: string, params: Val[], printResult?: boolean): InvokeResult | undefined;
/**
* Executes a value
* @param ctx An environment context you retain.
* @param value The value to execute.
* @returns Invocation errors caused during the execution of the function,
* or the final value of the invocation.
*/
export declare function invokeVal(ctx: Ctx, errCtx: ErrCtx, val: Val, params: Val[]): InvokeResult;
/**
* @param env An environment context you retain.
* @param alsoSyntax To optionally include syntax symbols.
* @returns List of symbols defined in Insitux, including built-in operations,
* (optionally) syntax, constants, and user-defined functions.
*/
export declare function symbols(env: Env, alsoSyntax?: boolean): string[];