File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 11import _CJavaScriptKit
22
3- public protocol JSBridgedType : JSValueCodable , CustomStringConvertible {
4- static var classRef : JSFunctionRef { get }
5-
3+ // Use this protocol when your type has no single JavaScript class.
4+ // For example, a union type of multiple classes.
5+ public protocol JSAbstractBridgedType : JSValueCodable , CustomStringConvertible {
66 var objectRef : JSObjectRef { get }
77 init ( objectRef: JSObjectRef )
88}
99
10- extension JSBridgedType {
10+ extension JSAbstractBridgedType {
1111 public var description : String {
1212 return objectRef. toString!( ) . fromJSValue ( )
1313 }
1414}
1515
16+ public protocol JSBridgedType : JSAbstractBridgedType {
17+ static var classRef : JSFunctionRef { get }
18+ }
19+
1620public protocol JSValueEncodable {
1721 func jsValue( ) -> JSValue
1822}
You can’t perform that action at this time.
0 commit comments