JSBridgedClass
Conform to this protocol when your Swift class wraps a JavaScript class.
protocol JSBridgedClass : JSBridgedType
Browse conforming typesConform to this protocol when your Swift class wraps a JavaScript class.
protocol JSBridgedClass : JSBridgedType
import JavaScriptKit
Swift framework to interact with JavaScript through WebAssembly.
protocol JSBridgedType : ConstructibleFromJSValue, ConvertibleToJSValue, CustomStringConvertible
Use this protocol when your type has no single JavaScript class. For example, a union type of multiple classes or primitive values.
protocol ConstructibleFromJSValue
Types conforming to this protocol can be constructed from JSValue
.
protocol ConvertibleToJSValue
Objects that can be converted to a JavaScript value, preferably in a lossless manner.
protocol CustomStringConvertible
A type with a customized textual representation.
init(unsafelyWrapping jsObject: JSObject)
Create an instance wrapping the given JavaScript object. You may assume that jsObject instanceof Self.constructor
static var constructor: JSFunction? { get }
The constructor function for the JavaScript class
var jsObject: JSObject { get }
The JavaScript object wrapped by this instance. You may assume that jsObject instanceof Self.constructor == true
init?(from value: JSValue)
init?(from object: JSObject)
var jsValue: JSValue { get }