Protocol
ConstructibleFromJSValue
public protocol ConstructibleFromJSValue
Types conforming to this protocol can be constructed from JSValue
.
Relationships
Types Conforming to ConstructibleFromJSValue
TypedArrayElement
A protocol that allows a Swift numeric type to be mapped to the JavaScript TypedArray that holds integers of its type
JSString
JSString
represents a string in JavaScript and supports bridging string between JavaScript and Swift.
Requirements
construct(from:)
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.
Parameters
Name | Type | Description |
---|---|---|
value | JSValue |
The |
Returns
An instance of Self
, if one was successfully constructed from the value.