ConstructibleFromJSValue
Types conforming to this protocol can be constructed from JSValue
.
protocol ConstructibleFromJSValue
Browse conforming typesTypes conforming to this protocol can be constructed from JSValue
.
protocol ConstructibleFromJSValue
import JavaScriptKit
Swift framework to interact with JavaScript through WebAssembly.
static func construct(from value: JSValue) -> Self?
Construct an instance of Self
, if possible, from the given JSValue
. Return nil
if the value is not compatible with the conforming Swift type.
protocol JSBridgedClass : JSBridgedType
Conform to this protocol when your Swift class wraps a JavaScript class.
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 JSClosureProtocol : ConstructibleFromJSValue, ConvertibleToJSValue
JSClosureProtocol
wraps Swift closure objects for use in JavaScript. Conforming types are responsible for managing the lifetime of the closure they wrap, but can delegate that task to the user by requiring an explicit release()
call.
protocol TypedArrayElement : ConstructibleFromJSValue, ConvertibleToJSValue
A protocol that allows a Swift numeric type to be mapped to the JavaScript TypedArray that holds integers of its type