public interface JS
This interface defines provides the main API for executing JavaScript code on a client.
-
Method Summary
Modifier and TypeMethodDescriptionExecutes the given JavaScript code synchronously on the client.Executes the given code in the javascript client.evalFuture(String code) Executes the given code in the javascript client.
-
Method Details
-
eval
Executes the given JavaScript code synchronously on the client. The method returns aJSVariablethat represents the result of the executed code.- Parameters:
code- the JavaScript code to be executed- Returns:
- a
JSVariablerepresenting the result of the code execution
-
evalAsync
Executes the given code in the javascript client. The code must be asynchronous and end with a return statement.- Parameters:
code- the asynchronous JavaScript code to be executed- Returns:
- a
PromiseJSVariablerepresenting the result of the asynchronous code execution
-
evalFuture
Executes the given code in the javascript client. The code must be asynchronous and end with a return statement.- Parameters:
code- the JavaScript code to be executed- Returns:
- a
CompletableFuture<JSVariable>that will be completed with the result of the code execution
-