Package dev.gmitch215.bytebox.js


package dev.gmitch215.bytebox.js
Reaching any JavaScript value from Java.

TSObject is the floor of the generated npm bindings: a member the generator could not type, a declaration written as any, or a package with no type information at all binds as one, so nothing is ever unreachable. It is also the body type of a Queue message and the row type of a D1 result, both of which are arbitrary JavaScript values.

Nothing is copied. A TSObject is the JavaScript value itself and its accessors read through to it.

One conversion rule is worth knowing before the rest: a Java long crosses the boundary as a BigInt and every other numeric type as a Number, char included, which arrives as its UTF-16 code unit. The readers accept either kind, so this matters mainly when handing a value to a JavaScript API that will only take one of them.

Since:
1.0.0
  • Class
    Description
    Converts between a Java byte[] and the runtime's buffers.
    Builds a JavaScript array from a Java one.
    Any JavaScript value, reachable by name.