@@ -10,24 +10,22 @@ public struct CustomEventInit: ExpressibleByDictionaryLiteral, JSBridgedType {
1010 case bubbles, cancelable, composed, detail
1111 }
1212
13- public typealias Value = AnyJSValueCodable
13+ private let dictionary : [ String : JSValue ]
1414
15- private let dictionary : [ String : AnyJSValueCodable ]
16-
17- public init ( uniqueKeysWithValues elements: [ ( Key , Value ) ] ) {
18- dictionary = Dictionary ( uniqueKeysWithValues: elements. map { ( $0. 0 . rawValue, $0. 1 ) } )
15+ public init ( uniqueKeysWithValues elements: [ ( Key , JSValueConvertible ) ] ) {
16+ dictionary = Dictionary ( uniqueKeysWithValues: elements. map { ( $0. 0 . rawValue, $0. 1 . jsValue ( ) ) } )
1917 }
2018
21- public init ( dictionaryLiteral elements: ( Key , AnyJSValueCodable ) ... ) {
22- dictionary = Dictionary ( uniqueKeysWithValues: elements. map { ( $0. 0 . rawValue, $0. 1 ) } )
19+ public init ( dictionaryLiteral elements: ( Key , JSValueConvertible ) ... ) {
20+ dictionary = Dictionary ( uniqueKeysWithValues: elements. map { ( $0. 0 . rawValue, $0. 1 . jsValue ( ) ) } )
2321 }
2422
25- subscript( _ key: Key ) -> AnyJSValueCodable ? {
23+ subscript( _ key: Key ) -> JSValue ? {
2624 dictionary [ key. rawValue]
2725 }
2826
2927 public init ? ( from value: JSValue ) {
30- if let dictionary: [ String : AnyJSValueCodable ] = value. fromJSValue ( ) {
28+ if let dictionary: [ String : JSValue ] = value. fromJSValue ( ) {
3129 self . dictionary = dictionary
3230 }
3331 return nil
0 commit comments