@@ -5285,6 +5285,7 @@ public class EventInit: BridgedDictionary {
52855285 public var composed: Bool
52865286}
52875287
5288+ public typealias EventListener = (Event) -> Void
52885289public class EventListenerOptions: BridgedDictionary {
52895290 public convenience init(capture: Bool) {
52905291 let object = JSObject.global[Strings.Object].function!.new()
@@ -5458,9 +5459,15 @@ open class EventTarget: JSBridgedClass {
54585459 self.init(unsafelyWrapping: Self.constructor!.new(arguments: []))
54595460 }
54605461
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+ }
54625466
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+ }
54645471
54655472 @inlinable public func dispatchEvent(event: Event) -> Bool {
54665473 let this = jsObject
@@ -10662,9 +10669,15 @@ public class MediaQueryList: EventTarget {
1066210669 @ReadonlyAttribute
1066310670 public var matches: Bool
1066410671
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+ }
1066610676
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+ }
1066810681
1066910682 @ClosureAttribute1Optional
1067010683 public var onchange: EventHandler
@@ -18173,6 +18186,8 @@ public class XSLTProcessor: JSBridgedClass {
1817318186 @usableFromInline static let addAll: JSString = "addAll"
1817418187 @usableFromInline static let addColorStop: JSString = "addColorStop"
1817518188 @usableFromInline static let addCue: JSString = "addCue"
18189+ @usableFromInline static let addEventListener: JSString = "addEventListener"
18190+ @usableFromInline static let addListener: JSString = "addListener"
1817618191 @usableFromInline static let addModule: JSString = "addModule"
1817718192 @usableFromInline static let addPath: JSString = "addPath"
1817818193 @usableFromInline static let addSourceBuffer: JSString = "addSourceBuffer"
@@ -19180,6 +19195,8 @@ public class XSLTProcessor: JSBridgedClass {
1918019195 @usableFromInline static let removeAttributeNode: JSString = "removeAttributeNode"
1918119196 @usableFromInline static let removeChild: JSString = "removeChild"
1918219197 @usableFromInline static let removeCue: JSString = "removeCue"
19198+ @usableFromInline static let removeEventListener: JSString = "removeEventListener"
19199+ @usableFromInline static let removeListener: JSString = "removeListener"
1918319200 @usableFromInline static let removeNamedItem: JSString = "removeNamedItem"
1918419201 @usableFromInline static let removeNamedItemNS: JSString = "removeNamedItemNS"
1918519202 @usableFromInline static let removeParameter: JSString = "removeParameter"
@@ -19515,6 +19532,48 @@ public class XSLTProcessor: JSBridgedClass {
1951519532 @usableFromInline static let z: JSString = "z"
1951619533}
1951719534
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+
1951819577public protocol Any_ArrayBuffer_or_String: ConvertibleToJSValue {}
1951919578extension ArrayBuffer: Any_ArrayBuffer_or_String {}
1952019579extension String: Any_ArrayBuffer_or_String {}
@@ -19669,6 +19728,48 @@ public enum BlobPart: JSValueCompatible, Any_BlobPart {
1966919728 }
1967019729}
1967119730
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+
1967219773public protocol Any_Bool_or_MediaTrackConstraints: ConvertibleToJSValue {}
1967319774extension Bool: Any_Bool_or_MediaTrackConstraints {}
1967419775extension MediaTrackConstraints: Any_Bool_or_MediaTrackConstraints {}
0 commit comments