es-vm
Version:
A visual machine run in ES env like Node/Browser
41 lines (32 loc) • 978 B
TypeScript
export class Kernel extends Event {
$runtime: any;
$operationStack: any[];
position: Object;
pushOperation(operation: any): this;
popOperation(operation: any): any;
fetch(invoking: Object, limit?: number): this;
setOnFetch(handler: Function);
$clearOperationStack(): this;
$loadProgram(statement: Statement): void;
$launch(): void;
$run(outerError: any, ret: any): this;
$halt(): this;
$complete(exception: Error, ret: any): void;
$clearAllTimeout(): void;
$setTimeout(fn: Function, time: number)
}
type maybeError = null | Error;
export class Scope {
constructor(presets: Object);
$new(presets: Object): Scope;
extend(Object: Object): this;
}
declare function linkNode(syntaxNode: any): Statement;
export class Statement {
position: Position;
linkNode(syntaxNode: any): Statement;
doExecution(vm: any, scope: Scope): void;
static register($Sumbol: any): Statement;
static map: Object;
static linkNode;
}