id
JSObject.swift:23This declaration is gated by at least one @_spi attribute.
var id: JavaScriptObjectRef
This declaration is gated by at least one @_spi attribute.
var id: JavaScriptObjectRef
import JavaScriptKit
Swift framework to interact with JavaScript through WebAssembly.
@dynamicMemberLookup class JSObject
JSObject
represents an object in JavaScript and supports dynamic member lookup. Any member access like object.foo
will dynamically request the JavaScript and Swift runtime bridge library for a member with the specified name in this object.
typealias JavaScriptObjectRef = UInt32
init(id: JavaScriptObjectRef)
static var global: JSObject { get }
A JSObject
of the global scope object. This allows access to the global properties and global names by accessing the JSObject
returned.
static func construct(from value: JSValue) -> Self?
var description: String { get }
var jsValue: JSValue { get }
var throwing: JSThrowingObject { get }
A modifier to call methods as throwing methods capturing this
subscript(name: JSString) -> ((ConvertibleToJSValue...) -> JSValue)? { get }
Returns the name
member method binding this object as this
context.
subscript(name: String) -> ((ConvertibleToJSValue...) -> JSValue)? { get }
Returns the name
member method binding this object as this
context.
subscript(name: JSString) -> JSValue { get set }
Access the name
member dynamically through JavaScript and Swift runtime bridge library.
subscript(name: JSSymbol) -> JSValue { get set }
Access the symbol
member dynamically through JavaScript and Swift runtime bridge library.
subscript(name: String) -> JSValue { get set }
Access the name
member dynamically through JavaScript and Swift runtime bridge library.
subscript(index: Int) -> JSValue { get set }
Access the index
member dynamically through JavaScript and Swift runtime bridge library.
subscript(dynamicMember name: String) -> ((ConvertibleToJSValue...) -> JSValue)? { get }
A convenience method of subscript(_ name: String) -> ((ConvertibleToJSValue...) -> JSValue)?
to access the member through Dynamic Member Lookup.
subscript(dynamicMember name: String) -> JSValue { get set }
A convenience method of subscript(_ name: String) -> JSValue
to access the member through Dynamic Member Lookup.
static func == (lhs: JSObject, rhs: JSObject) -> Bool
Returns a Boolean value indicating whether two values point to same objects.
func hash(into hasher: inout Hasher)
Hashes the essential components of this value by feeding them into the given hasher.
func isInstanceOf(_ constructor: JSFunction) -> Bool
Return true
if this value is an instance of the passed constructor
function.