[7:14] (extern: com.aussom.aussomscript.AJSObject) extends: object
The 'jsobj' class represents an opaque reference to a native JavaScript object. Instances are returned by js.call() and jsobj.call() when the result is a non-primitive JS value. Use call(), get(), and set() to interact with the underlying JS object.
_init (int HandleId)
jsobj (int HandleId = 0)
Creates a new jsobj wrapping the given handle registry ID. This constructor is called internally by the AJSNI runtime.
HandleId is the integer handle registry ID.A new jsobj.call (string Method, Args = null)
Calls a method on the underlying JavaScript object by name.
Method is the string method name.Args is an optional list of arguments (primitives, maps, lists, or jsobj handles).A jsobj wrapping the return value, or null for void results.get (string Prop)
Gets a property value from the underlying JavaScript object.
Prop is the string property name.A primitive Aussom value or a jsobj for object references.set (string Prop, string ValueJson)
Sets a property on the underlying JavaScript object.
Prop is the string property name.ValueJson is the value to assign, serialized to a JSON string.this objectisNull ()
Returns true if this reference is null or undefined in JavaScript.
boolgetString (string Prop)
Returns a string property from the underlying JavaScript object.
Prop is the string property name.A string value.getNumber (string Prop)
Returns a numeric property from the underlying JavaScript object as a double.
Prop is the string property name.A double value.getBool (string Prop)
Returns a boolean property from the underlying JavaScript object.
Prop is the string property name.A bool value.toJson ()
Serializes the underlying JavaScript object to a JSON string. Works for plain JS objects and arrays. Returns an empty string for objects that are not JSON-serializable (e.g., DOM nodes, closures).
A string with the JSON representation.release ()
Removes this handle from the window.__ajsni.handles registry, allowing the JavaScript engine to garbage-collect the underlying JS object. Call this when a jsobj is no longer needed to prevent handle leaks on pages that create and discard many JS objects. After calling release(), do not use this jsobj again.
this object[98:21] static (extern: com.aussom.aussomscript.AJS) extends: object
The 'js' static class provides access to native JavaScript from Aussom. Use it to call global JS functions, load external scripts, get and set global variables, and convert data between Aussom and JavaScript. All methods are static, so no instance is needed: result = js.call("Plotly.newPlot", ["chart-div", traces, layout]);
call (string FuncPath, Args = null)
Calls a global JavaScript function by dotted path, resolved from the window object. Example: result = js.call("Plotly.newPlot", ["chart-div", traces, layout]);
FuncPath is the dotted path to the function (e.g. "Plotly.newPlot").Args is an optional list of arguments (primitives, maps, lists, jsobj).A jsobj wrapping the return value, or null for void/null results.get (string PropPath)
Gets a global JavaScript variable by dotted path. Example: version = js.get("Plotly.version");
PropPath is the dotted path to the property.A primitive Aussom value or a jsobj for object references.set (string PropPath, string ValueJson)
Sets a global JavaScript variable by dotted path. The value is a JSON string that is parsed by JavaScript before assignment.
PropPath is the dotted path to the property.ValueJson is the value to assign, serialized as a JSON string.this objectexists (string PropPath)
Returns true if a global variable or function exists at the given dotted path.
PropPath is the dotted path to check (e.g. "Plotly", "L.map").booleval (string Code)
Evaluates a JavaScript code string and returns the result as an Aussom value.
Code is the JavaScript code string to execute.The evaluation result as a primitive, map, list, or jsobj.loadScript (string Url, callback OnLoad, callback OnError = null)
Loads an external JavaScript file dynamically by injecting a script tag. The onLoad callback fires with no arguments when the script finishes loading. The onError callback fires with an error string if loading fails.
Url is the URL of the script to load.OnLoad is a callback invoked when the script loads successfully.OnError is an optional callback invoked with an error message on failure.this objecttoJson (Value)
Serializes an Aussom value (primitive, list, map, or jsobj) to a JSON string suitable for passing to JavaScript.
Value is the Aussom value to serialize.A string with the JSON representation.fromJson (string Json)
Parses a JSON string into Aussom values (maps, lists, and primitives).
Json is the JSON string to parse.The parsed value as an Aussom type.promise (string FuncPath, Args, callback OnResolve, callback OnReject = null)
Calls a Promise-returning JavaScript function by dotted path and bridges the result to Aussom callbacks. The resolved value is converted to an Aussom type (string, number, bool, map, list, or jsobj) and passed to OnResolve. If the Promise rejects, OnReject is called with the error message as a string. If the called function does not return a Promise, OnResolve is called immediately with the return value. Example: js.promise("fetch", ["/api/data"], ::onData, ::onError);
FuncPath is the dotted path to the function (e.g. "fetch").Args is a list of arguments, or null for no arguments.OnResolve is a callback(Value) invoked with the resolved Aussom value.OnReject is an optional callback(string Error) invoked on rejection.this object