Static Method (Default implementation)javascriptkit 0.24.0JavaScriptKit
construct(from:)
JSBridgedType.swift:9static func construct(from value: JSValue) -> Self?
static func construct(from value: JSValue) -> Self?
s13JavaScriptKit13JSBridgedTypePAAE9construct4fromxSgAA7JSValueO_tFZ
What are these?96O3J
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.
@dynamicMemberLookup enum JSValue
JSValue
represents a value in JavaScript.
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.
var description: String { get }