@@ -5285,6 +5285,7 @@ public class EventInit: BridgedDictionary {
5285
5285
public var composed: Bool
5286
5286
}
5287
5287
5288
+ public typealias EventListener = (Event) -> Void
5288
5289
public class EventListenerOptions: BridgedDictionary {
5289
5290
public convenience init(capture: Bool) {
5290
5291
let object = JSObject.global[Strings.Object].function!.new()
@@ -5458,9 +5459,15 @@ open class EventTarget: JSBridgedClass {
5458
5459
self.init(unsafelyWrapping: Self.constructor!.new(arguments: []))
5459
5460
}
5460
5461
5461
- // XXX: member 'addEventListener' is ignored
5462
+ @inlinable public func addEventListener(type: String, callback: EventListener?, options: AddEventListenerOptions_or_Bool? = nil) {
5463
+ let this = jsObject
5464
+ _ = this[Strings.addEventListener].function!(this: this, arguments: [_toJSValue(type), _toJSValue(callback), _toJSValue(options)])
5465
+ }
5462
5466
5463
- // XXX: member 'removeEventListener' is ignored
5467
+ @inlinable public func removeEventListener(type: String, callback: EventListener?, options: Bool_or_EventListenerOptions? = nil) {
5468
+ let this = jsObject
5469
+ _ = this[Strings.removeEventListener].function!(this: this, arguments: [_toJSValue(type), _toJSValue(callback), _toJSValue(options)])
5470
+ }
5464
5471
5465
5472
@inlinable public func dispatchEvent(event: Event) -> Bool {
5466
5473
let this = jsObject
@@ -10662,9 +10669,15 @@ public class MediaQueryList: EventTarget {
10662
10669
@ReadonlyAttribute
10663
10670
public var matches: Bool
10664
10671
10665
- // XXX: member 'addListener' is ignored
10672
+ @inlinable public func addListener(callback: EventListener?) {
10673
+ let this = jsObject
10674
+ _ = this[Strings.addListener].function!(this: this, arguments: [_toJSValue(callback)])
10675
+ }
10666
10676
10667
- // XXX: member 'removeListener' is ignored
10677
+ @inlinable public func removeListener(callback: EventListener?) {
10678
+ let this = jsObject
10679
+ _ = this[Strings.removeListener].function!(this: this, arguments: [_toJSValue(callback)])
10680
+ }
10668
10681
10669
10682
@ClosureAttribute1Optional
10670
10683
public var onchange: EventHandler
@@ -18173,6 +18186,8 @@ public class XSLTProcessor: JSBridgedClass {
18173
18186
@usableFromInline static let addAll: JSString = "addAll"
18174
18187
@usableFromInline static let addColorStop: JSString = "addColorStop"
18175
18188
@usableFromInline static let addCue: JSString = "addCue"
18189
+ @usableFromInline static let addEventListener: JSString = "addEventListener"
18190
+ @usableFromInline static let addListener: JSString = "addListener"
18176
18191
@usableFromInline static let addModule: JSString = "addModule"
18177
18192
@usableFromInline static let addPath: JSString = "addPath"
18178
18193
@usableFromInline static let addSourceBuffer: JSString = "addSourceBuffer"
@@ -19180,6 +19195,8 @@ public class XSLTProcessor: JSBridgedClass {
19180
19195
@usableFromInline static let removeAttributeNode: JSString = "removeAttributeNode"
19181
19196
@usableFromInline static let removeChild: JSString = "removeChild"
19182
19197
@usableFromInline static let removeCue: JSString = "removeCue"
19198
+ @usableFromInline static let removeEventListener: JSString = "removeEventListener"
19199
+ @usableFromInline static let removeListener: JSString = "removeListener"
19183
19200
@usableFromInline static let removeNamedItem: JSString = "removeNamedItem"
19184
19201
@usableFromInline static let removeNamedItemNS: JSString = "removeNamedItemNS"
19185
19202
@usableFromInline static let removeParameter: JSString = "removeParameter"
@@ -19515,6 +19532,48 @@ public class XSLTProcessor: JSBridgedClass {
19515
19532
@usableFromInline static let z: JSString = "z"
19516
19533
}
19517
19534
19535
+ public protocol Any_AddEventListenerOptions_or_Bool: ConvertibleToJSValue {}
19536
+ extension AddEventListenerOptions: Any_AddEventListenerOptions_or_Bool {}
19537
+ extension Bool: Any_AddEventListenerOptions_or_Bool {}
19538
+
19539
+ public enum AddEventListenerOptions_or_Bool: JSValueCompatible, Any_AddEventListenerOptions_or_Bool {
19540
+ case addEventListenerOptions(AddEventListenerOptions)
19541
+ case bool(Bool)
19542
+
19543
+ public var addEventListenerOptions: AddEventListenerOptions? {
19544
+ switch self {
19545
+ case let .addEventListenerOptions(addEventListenerOptions): return addEventListenerOptions
19546
+ default: return nil
19547
+ }
19548
+ }
19549
+
19550
+ public var bool: Bool? {
19551
+ switch self {
19552
+ case let .bool(bool): return bool
19553
+ default: return nil
19554
+ }
19555
+ }
19556
+
19557
+ public static func construct(from value: JSValue) -> Self? {
19558
+ if let addEventListenerOptions: AddEventListenerOptions = value.fromJSValue() {
19559
+ return .addEventListenerOptions(addEventListenerOptions)
19560
+ }
19561
+ if let bool: Bool = value.fromJSValue() {
19562
+ return .bool(bool)
19563
+ }
19564
+ return nil
19565
+ }
19566
+
19567
+ public var jsValue: JSValue {
19568
+ switch self {
19569
+ case let .addEventListenerOptions(addEventListenerOptions):
19570
+ return addEventListenerOptions.jsValue
19571
+ case let .bool(bool):
19572
+ return bool.jsValue
19573
+ }
19574
+ }
19575
+ }
19576
+
19518
19577
public protocol Any_ArrayBuffer_or_String: ConvertibleToJSValue {}
19519
19578
extension ArrayBuffer: Any_ArrayBuffer_or_String {}
19520
19579
extension String: Any_ArrayBuffer_or_String {}
@@ -19669,6 +19728,48 @@ public enum BlobPart: JSValueCompatible, Any_BlobPart {
19669
19728
}
19670
19729
}
19671
19730
19731
+ public protocol Any_Bool_or_EventListenerOptions: ConvertibleToJSValue {}
19732
+ extension Bool: Any_Bool_or_EventListenerOptions {}
19733
+ extension EventListenerOptions: Any_Bool_or_EventListenerOptions {}
19734
+
19735
+ public enum Bool_or_EventListenerOptions: JSValueCompatible, Any_Bool_or_EventListenerOptions {
19736
+ case bool(Bool)
19737
+ case eventListenerOptions(EventListenerOptions)
19738
+
19739
+ public var bool: Bool? {
19740
+ switch self {
19741
+ case let .bool(bool): return bool
19742
+ default: return nil
19743
+ }
19744
+ }
19745
+
19746
+ public var eventListenerOptions: EventListenerOptions? {
19747
+ switch self {
19748
+ case let .eventListenerOptions(eventListenerOptions): return eventListenerOptions
19749
+ default: return nil
19750
+ }
19751
+ }
19752
+
19753
+ public static func construct(from value: JSValue) -> Self? {
19754
+ if let bool: Bool = value.fromJSValue() {
19755
+ return .bool(bool)
19756
+ }
19757
+ if let eventListenerOptions: EventListenerOptions = value.fromJSValue() {
19758
+ return .eventListenerOptions(eventListenerOptions)
19759
+ }
19760
+ return nil
19761
+ }
19762
+
19763
+ public var jsValue: JSValue {
19764
+ switch self {
19765
+ case let .bool(bool):
19766
+ return bool.jsValue
19767
+ case let .eventListenerOptions(eventListenerOptions):
19768
+ return eventListenerOptions.jsValue
19769
+ }
19770
+ }
19771
+ }
19772
+
19672
19773
public protocol Any_Bool_or_MediaTrackConstraints: ConvertibleToJSValue {}
19673
19774
extension Bool: Any_Bool_or_MediaTrackConstraints {}
19674
19775
extension MediaTrackConstraints: Any_Bool_or_MediaTrackConstraints {}
0 commit comments