API / CLASS REFERENCE
UltralightJSValue
Inherits: RefCounted
Document-scoped handle for checked JavaScript access.
Use handles only on the Godot main thread and in the document which created them. Access methods return UltralightResult. Nested arrays and objects stay live; snapshot creates independent Godot containers. close releases the handle and affects aliases sharing it. Navigation or binding revocation invalidates the handle. Snapshot traversal rejects cycles and nesting deeper than 64 levels.
Methods
get_value(key: Variant) → UltralightResultset_value(key: Variant, value: Variant) → UltralightResultutf8_bytes() → UltralightResultsnapshot() → UltralightResultkeys() → UltralightResultsize() → intappend(value: Variant) → UltralightResultremove(key: Variant) → UltralightResultinvoke_method(name: String, arguments: Array) → UltralightResultinvoke(arguments: Array) → UltralightResultclose() → voidis_closed() → bool const
get_value
get_value(key: Variant) → UltralightResultRead an indexed or named property using shared conversion.
set_value
set_value(key: Variant, value: Variant) → UltralightResultWrite an indexed or named property. Enforce the source container and read-only constraints.
utf8_bytes
utf8_bytes() → UltralightResultConvert the retained value to UTF-8 bytes in a successful PackedByteArray result. Preserves embedded NUL bytes which Godot String cannot represent.
snapshot
snapshot() → UltralightResultCreate an independent recursive copy of supported data. Reject cycles and depth over 64.
keys
keys() → UltralightResultReturn own enumerable keys in the successful result.
size
size() → intReturn array length or own enumerable key count. Return -1 when closed or access fails; zero is a valid empty collection.
append
append(value: Variant) → UltralightResultAppend a value to an Array using shared conversion.
remove
remove(key: Variant) → UltralightResultDelete a property using JavaScript delete semantics. Array indices are not shifted. Return a failed result when the property is not configurable.
invoke_method
invoke_method(name: String, arguments: Array) → UltralightResultCall the named function with this object as its receiver.
invoke
invoke(arguments: Array) → UltralightResultCall a retained function with the supplied argument Array.
close
close() → voidRelease this retained value and invalidate aliases of the same handle.
is_closed
is_closed() → bool constReturn whether explicitly closed or its document or binding has expired.