From 03bd5466aebfd55511704086ca66ec27236acff9 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 3 May 2022 10:59:36 +0100 Subject: [PATCH 1/8] Add `mediacapture-streams` IDL spec and generated code --- Sources/DOMKit/Generated.swift | 1298 ++++++++++++++++++++++++++++++-- parse-idl/parse-all.js | 3 +- 2 files changed, 1238 insertions(+), 63 deletions(-) diff --git a/Sources/DOMKit/Generated.swift b/Sources/DOMKit/Generated.swift index f2a075f0..907d355b 100644 --- a/Sources/DOMKit/Generated.swift +++ b/Sources/DOMKit/Generated.swift @@ -1155,6 +1155,22 @@ public class CacheStorage: JSBridgedClass { } } +public class CameraDevicePermissionDescriptor: BridgedDictionary { + public convenience init(panTiltZoom: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.panTiltZoom] = panTiltZoom.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _panTiltZoom = ReadWriteAttribute(jsObject: object, name: Strings.panTiltZoom) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var panTiltZoom: Bool +} + public enum CanPlayTypeResult: JSString, JSValueCompatible { case _empty = "" case maybe = "maybe" @@ -2222,6 +2238,90 @@ public class ComputedEffectTiming: BridgedDictionary { public var currentIteration: Double? } +public class ConstrainBooleanParameters: BridgedDictionary { + public convenience init(exact: Bool, ideal: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) + _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var exact: Bool + + @ReadWriteAttribute + public var ideal: Bool +} + +public class ConstrainDOMStringParameters: BridgedDictionary { + public convenience init(exact: String_or_seq_of_String, ideal: String_or_seq_of_String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) + _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var exact: String_or_seq_of_String + + @ReadWriteAttribute + public var ideal: String_or_seq_of_String +} + +public class ConstrainDoubleRange: BridgedDictionary { + public convenience init(exact: Double, ideal: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) + _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var exact: Double + + @ReadWriteAttribute + public var ideal: Double +} + +public class ConstrainULongRange: BridgedDictionary { + public convenience init(exact: UInt32, ideal: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) + _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var exact: UInt32 + + @ReadWriteAttribute + public var ideal: UInt32 +} + public class CountQueuingStrategy: JSBridgedClass { @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CountQueuingStrategy].function! } @@ -3625,6 +3725,22 @@ public class DataTransferItemList: JSBridgedClass { } } +public class DevicePermissionDescriptor: BridgedDictionary { + public convenience init(deviceId: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.deviceId] = deviceId.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var deviceId: String +} + public class Document: Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Document].function! } @@ -4098,6 +4214,27 @@ public enum DocumentVisibilityState: JSString, JSValueCompatible { @inlinable public var jsValue: JSValue { rawValue.jsValue } } +public class DoubleRange: BridgedDictionary { + public convenience init(max: Double, min: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.max] = max.jsValue + object[Strings.min] = min.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _max = ReadWriteAttribute(jsObject: object, name: Strings.max) + _min = ReadWriteAttribute(jsObject: object, name: Strings.min) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var max: Double + + @ReadWriteAttribute + public var min: Double +} + public class DragEvent: MouseEvent { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.DragEvent].function! } @@ -9326,6 +9463,19 @@ public enum ImageSmoothingQuality: JSString, JSValueCompatible { @inlinable public var jsValue: JSValue { rawValue.jsValue } } +public class InputDeviceInfo: MediaDeviceInfo { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.InputDeviceInfo].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public func getCapabilities() -> MediaTrackCapabilities { + let this = jsObject + return this[Strings.getCapabilities].function!(this: this, arguments: []).fromJSValue()! + } +} + public class InputEvent: UIEvent { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.InputEvent].function! } @@ -9651,6 +9801,97 @@ public class Location: JSBridgedClass { public var ancestorOrigins: DOMStringList } +public class MediaDeviceInfo: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaDeviceInfo].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _deviceId = ReadonlyAttribute(jsObject: jsObject, name: Strings.deviceId) + _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) + _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) + _groupId = ReadonlyAttribute(jsObject: jsObject, name: Strings.groupId) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var deviceId: String + + @ReadonlyAttribute + public var kind: MediaDeviceKind + + @ReadonlyAttribute + public var label: String + + @ReadonlyAttribute + public var groupId: String + + @inlinable public func toJSON() -> JSObject { + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! + } +} + +public enum MediaDeviceKind: JSString, JSValueCompatible { + case audioinput = "audioinput" + case audiooutput = "audiooutput" + case videoinput = "videoinput" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class MediaDevices: EventTarget { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaDevices].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _ondevicechange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondevicechange) + super.init(unsafelyWrapping: jsObject) + } + + @ClosureAttribute1Optional + public var ondevicechange: EventHandler + + @inlinable public func enumerateDevices() -> JSPromise { + let this = jsObject + return this[Strings.enumerateDevices].function!(this: this, arguments: []).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func enumerateDevices() async throws -> [MediaDeviceInfo] { + let this = jsObject + let _promise: JSPromise = this[Strings.enumerateDevices].function!(this: this, arguments: []).fromJSValue()! + return try await _promise.value.fromJSValue()! + } + + @inlinable public func getSupportedConstraints() -> MediaTrackSupportedConstraints { + let this = jsObject + return this[Strings.getSupportedConstraints].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable public func getUserMedia(constraints: MediaStreamConstraints? = nil) -> JSPromise { + let this = jsObject + return this[Strings.getUserMedia].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func getUserMedia(constraints: MediaStreamConstraints? = nil) async throws -> MediaStream { + let this = jsObject + let _promise: JSPromise = this[Strings.getUserMedia].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } +} + public class MediaError: JSBridgedClass { @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MediaError].function! } @@ -9677,104 +9918,687 @@ public class MediaError: JSBridgedClass { public var message: String } -public class MessageChannel: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MessageChannel].function! } - - public let jsObject: JSObject +public class MediaStream: EventTarget { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStream].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _port1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.port1) - _port2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.port2) - self.jsObject = jsObject + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _active = ReadonlyAttribute(jsObject: jsObject, name: Strings.active) + _onaddtrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaddtrack) + _onremovetrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremovetrack) + super.init(unsafelyWrapping: jsObject) } @inlinable public convenience init() { self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) } - @ReadonlyAttribute - public var port1: MessagePort + @inlinable public convenience init(stream: MediaStream) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue])) + } + + @inlinable public convenience init(tracks: [MediaStreamTrack]) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [tracks.jsValue])) + } @ReadonlyAttribute - public var port2: MessagePort -} + public var id: String -public class MessageEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MessageEvent].function! } + @inlinable public func getAudioTracks() -> [MediaStreamTrack] { + let this = jsObject + return this[Strings.getAudioTracks].function!(this: this, arguments: []).fromJSValue()! + } - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - _origin = ReadonlyAttribute(jsObject: jsObject, name: Strings.origin) - _lastEventId = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastEventId) - _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) - _ports = ReadonlyAttribute(jsObject: jsObject, name: Strings.ports) - super.init(unsafelyWrapping: jsObject) + @inlinable public func getVideoTracks() -> [MediaStreamTrack] { + let this = jsObject + return this[Strings.getVideoTracks].function!(this: this, arguments: []).fromJSValue()! } - @inlinable public convenience init(type: String, eventInitDict: MessageEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) + @inlinable public func getTracks() -> [MediaStreamTrack] { + let this = jsObject + return this[Strings.getTracks].function!(this: this, arguments: []).fromJSValue()! } - @ReadonlyAttribute - public var data: JSValue + @inlinable public func getTrackById(trackId: String) -> MediaStreamTrack? { + let this = jsObject + return this[Strings.getTrackById].function!(this: this, arguments: [trackId.jsValue]).fromJSValue()! + } - @ReadonlyAttribute - public var origin: String + @inlinable public func addTrack(track: MediaStreamTrack) { + let this = jsObject + _ = this[Strings.addTrack].function!(this: this, arguments: [track.jsValue]) + } - @ReadonlyAttribute - public var lastEventId: String + @inlinable public func removeTrack(track: MediaStreamTrack) { + let this = jsObject + _ = this[Strings.removeTrack].function!(this: this, arguments: [track.jsValue]) + } - @ReadonlyAttribute - public var source: MessageEventSource? + @inlinable public func clone() -> Self { + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! + } @ReadonlyAttribute - public var ports: [MessagePort] + public var active: Bool - @inlinable public func initMessageEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, data: JSValue? = nil, origin: String? = nil, lastEventId: String? = nil, source: MessageEventSource? = nil, ports: [MessagePort]? = nil) { - let _arg0 = type.jsValue - let _arg1 = bubbles?.jsValue ?? .undefined - let _arg2 = cancelable?.jsValue ?? .undefined - let _arg3 = data?.jsValue ?? .undefined - let _arg4 = origin?.jsValue ?? .undefined - let _arg5 = lastEventId?.jsValue ?? .undefined - let _arg6 = source?.jsValue ?? .undefined - let _arg7 = ports?.jsValue ?? .undefined - let this = jsObject - _ = this[Strings.initMessageEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) - } + @ClosureAttribute1Optional + public var onaddtrack: EventHandler + + @ClosureAttribute1Optional + public var onremovetrack: EventHandler } -public class MessageEventInit: BridgedDictionary { - public convenience init(data: JSValue, origin: String, lastEventId: String, source: MessageEventSource?, ports: [MessagePort]) { +public class MediaStreamConstraints: BridgedDictionary { + public convenience init(video: Bool_or_MediaTrackConstraints, audio: Bool_or_MediaTrackConstraints) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.data] = data.jsValue - object[Strings.origin] = origin.jsValue - object[Strings.lastEventId] = lastEventId.jsValue - object[Strings.source] = source.jsValue - object[Strings.ports] = ports.jsValue + object[Strings.video] = video.jsValue + object[Strings.audio] = audio.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) - _lastEventId = ReadWriteAttribute(jsObject: object, name: Strings.lastEventId) - _source = ReadWriteAttribute(jsObject: object, name: Strings.source) - _ports = ReadWriteAttribute(jsObject: object, name: Strings.ports) + _video = ReadWriteAttribute(jsObject: object, name: Strings.video) + _audio = ReadWriteAttribute(jsObject: object, name: Strings.audio) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var data: JSValue - - @ReadWriteAttribute - public var origin: String + public var video: Bool_or_MediaTrackConstraints @ReadWriteAttribute - public var lastEventId: String + public var audio: Bool_or_MediaTrackConstraints +} - @ReadWriteAttribute - public var source: MessageEventSource? +public class MediaStreamTrack: EventTarget { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrack].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) + _enabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.enabled) + _muted = ReadonlyAttribute(jsObject: jsObject, name: Strings.muted) + _onmute = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmute) + _onunmute = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onunmute) + _readyState = ReadonlyAttribute(jsObject: jsObject, name: Strings.readyState) + _onended = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onended) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var kind: String + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var label: String + + @ReadWriteAttribute + public var enabled: Bool + + @ReadonlyAttribute + public var muted: Bool + + @ClosureAttribute1Optional + public var onmute: EventHandler + + @ClosureAttribute1Optional + public var onunmute: EventHandler + + @ReadonlyAttribute + public var readyState: MediaStreamTrackState + + @ClosureAttribute1Optional + public var onended: EventHandler + + @inlinable public func clone() -> Self { + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable public func stop() { + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: []) + } + + @inlinable public func getCapabilities() -> MediaTrackCapabilities { + let this = jsObject + return this[Strings.getCapabilities].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable public func getConstraints() -> MediaTrackConstraints { + let this = jsObject + return this[Strings.getConstraints].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable public func getSettings() -> MediaTrackSettings { + let this = jsObject + return this[Strings.getSettings].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable public func applyConstraints(constraints: MediaTrackConstraints? = nil) -> JSPromise { + let this = jsObject + return this[Strings.applyConstraints].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func applyConstraints(constraints: MediaTrackConstraints? = nil) async throws { + let this = jsObject + let _promise: JSPromise = this[Strings.applyConstraints].function!(this: this, arguments: [constraints?.jsValue ?? .undefined]).fromJSValue()! + _ = try await _promise.value + } +} + +public class MediaStreamTrackEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStreamTrackEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(type: String, eventInitDict: MediaStreamTrackEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) + } + + @ReadonlyAttribute + public var track: MediaStreamTrack +} + +public class MediaStreamTrackEventInit: BridgedDictionary { + public convenience init(track: MediaStreamTrack) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.track] = track.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _track = ReadWriteAttribute(jsObject: object, name: Strings.track) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var track: MediaStreamTrack +} + +public enum MediaStreamTrackState: JSString, JSValueCompatible { + case live = "live" + case ended = "ended" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class MediaTrackCapabilities: BridgedDictionary { + public convenience init(width: ULongRange, height: ULongRange, aspectRatio: DoubleRange, frameRate: DoubleRange, facingMode: [String], resizeMode: [String], sampleRate: ULongRange, sampleSize: ULongRange, echoCancellation: [Bool], autoGainControl: [Bool], noiseSuppression: [Bool], latency: DoubleRange, channelCount: ULongRange, deviceId: String, groupId: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.aspectRatio] = aspectRatio.jsValue + object[Strings.frameRate] = frameRate.jsValue + object[Strings.facingMode] = facingMode.jsValue + object[Strings.resizeMode] = resizeMode.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.sampleSize] = sampleSize.jsValue + object[Strings.echoCancellation] = echoCancellation.jsValue + object[Strings.autoGainControl] = autoGainControl.jsValue + object[Strings.noiseSuppression] = noiseSuppression.jsValue + object[Strings.latency] = latency.jsValue + object[Strings.channelCount] = channelCount.jsValue + object[Strings.deviceId] = deviceId.jsValue + object[Strings.groupId] = groupId.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) + _frameRate = ReadWriteAttribute(jsObject: object, name: Strings.frameRate) + _facingMode = ReadWriteAttribute(jsObject: object, name: Strings.facingMode) + _resizeMode = ReadWriteAttribute(jsObject: object, name: Strings.resizeMode) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + _sampleSize = ReadWriteAttribute(jsObject: object, name: Strings.sampleSize) + _echoCancellation = ReadWriteAttribute(jsObject: object, name: Strings.echoCancellation) + _autoGainControl = ReadWriteAttribute(jsObject: object, name: Strings.autoGainControl) + _noiseSuppression = ReadWriteAttribute(jsObject: object, name: Strings.noiseSuppression) + _latency = ReadWriteAttribute(jsObject: object, name: Strings.latency) + _channelCount = ReadWriteAttribute(jsObject: object, name: Strings.channelCount) + _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) + _groupId = ReadWriteAttribute(jsObject: object, name: Strings.groupId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var width: ULongRange + + @ReadWriteAttribute + public var height: ULongRange + + @ReadWriteAttribute + public var aspectRatio: DoubleRange + + @ReadWriteAttribute + public var frameRate: DoubleRange + + @ReadWriteAttribute + public var facingMode: [String] + + @ReadWriteAttribute + public var resizeMode: [String] + + @ReadWriteAttribute + public var sampleRate: ULongRange + + @ReadWriteAttribute + public var sampleSize: ULongRange + + @ReadWriteAttribute + public var echoCancellation: [Bool] + + @ReadWriteAttribute + public var autoGainControl: [Bool] + + @ReadWriteAttribute + public var noiseSuppression: [Bool] + + @ReadWriteAttribute + public var latency: DoubleRange + + @ReadWriteAttribute + public var channelCount: ULongRange + + @ReadWriteAttribute + public var deviceId: String + + @ReadWriteAttribute + public var groupId: String +} + +public class MediaTrackConstraintSet: BridgedDictionary { + public convenience init(width: ConstrainULong, height: ConstrainULong, aspectRatio: ConstrainDouble, frameRate: ConstrainDouble, facingMode: ConstrainDOMString, resizeMode: ConstrainDOMString, sampleRate: ConstrainULong, sampleSize: ConstrainULong, echoCancellation: ConstrainBoolean, autoGainControl: ConstrainBoolean, noiseSuppression: ConstrainBoolean, latency: ConstrainDouble, channelCount: ConstrainULong, deviceId: ConstrainDOMString, groupId: ConstrainDOMString) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.aspectRatio] = aspectRatio.jsValue + object[Strings.frameRate] = frameRate.jsValue + object[Strings.facingMode] = facingMode.jsValue + object[Strings.resizeMode] = resizeMode.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.sampleSize] = sampleSize.jsValue + object[Strings.echoCancellation] = echoCancellation.jsValue + object[Strings.autoGainControl] = autoGainControl.jsValue + object[Strings.noiseSuppression] = noiseSuppression.jsValue + object[Strings.latency] = latency.jsValue + object[Strings.channelCount] = channelCount.jsValue + object[Strings.deviceId] = deviceId.jsValue + object[Strings.groupId] = groupId.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) + _frameRate = ReadWriteAttribute(jsObject: object, name: Strings.frameRate) + _facingMode = ReadWriteAttribute(jsObject: object, name: Strings.facingMode) + _resizeMode = ReadWriteAttribute(jsObject: object, name: Strings.resizeMode) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + _sampleSize = ReadWriteAttribute(jsObject: object, name: Strings.sampleSize) + _echoCancellation = ReadWriteAttribute(jsObject: object, name: Strings.echoCancellation) + _autoGainControl = ReadWriteAttribute(jsObject: object, name: Strings.autoGainControl) + _noiseSuppression = ReadWriteAttribute(jsObject: object, name: Strings.noiseSuppression) + _latency = ReadWriteAttribute(jsObject: object, name: Strings.latency) + _channelCount = ReadWriteAttribute(jsObject: object, name: Strings.channelCount) + _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) + _groupId = ReadWriteAttribute(jsObject: object, name: Strings.groupId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var width: ConstrainULong + + @ReadWriteAttribute + public var height: ConstrainULong + + @ReadWriteAttribute + public var aspectRatio: ConstrainDouble + + @ReadWriteAttribute + public var frameRate: ConstrainDouble + + @ReadWriteAttribute + public var facingMode: ConstrainDOMString + + @ReadWriteAttribute + public var resizeMode: ConstrainDOMString + + @ReadWriteAttribute + public var sampleRate: ConstrainULong + + @ReadWriteAttribute + public var sampleSize: ConstrainULong + + @ReadWriteAttribute + public var echoCancellation: ConstrainBoolean + + @ReadWriteAttribute + public var autoGainControl: ConstrainBoolean + + @ReadWriteAttribute + public var noiseSuppression: ConstrainBoolean + + @ReadWriteAttribute + public var latency: ConstrainDouble + + @ReadWriteAttribute + public var channelCount: ConstrainULong + + @ReadWriteAttribute + public var deviceId: ConstrainDOMString + + @ReadWriteAttribute + public var groupId: ConstrainDOMString +} + +public class MediaTrackConstraints: BridgedDictionary { + public convenience init(advanced: [MediaTrackConstraintSet]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.advanced] = advanced.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _advanced = ReadWriteAttribute(jsObject: object, name: Strings.advanced) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var advanced: [MediaTrackConstraintSet] +} + +public class MediaTrackSettings: BridgedDictionary { + public convenience init(width: Int32, height: Int32, aspectRatio: Double, frameRate: Double, facingMode: String, resizeMode: String, sampleRate: Int32, sampleSize: Int32, echoCancellation: Bool, autoGainControl: Bool, noiseSuppression: Bool, latency: Double, channelCount: Int32, deviceId: String, groupId: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.aspectRatio] = aspectRatio.jsValue + object[Strings.frameRate] = frameRate.jsValue + object[Strings.facingMode] = facingMode.jsValue + object[Strings.resizeMode] = resizeMode.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.sampleSize] = sampleSize.jsValue + object[Strings.echoCancellation] = echoCancellation.jsValue + object[Strings.autoGainControl] = autoGainControl.jsValue + object[Strings.noiseSuppression] = noiseSuppression.jsValue + object[Strings.latency] = latency.jsValue + object[Strings.channelCount] = channelCount.jsValue + object[Strings.deviceId] = deviceId.jsValue + object[Strings.groupId] = groupId.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) + _frameRate = ReadWriteAttribute(jsObject: object, name: Strings.frameRate) + _facingMode = ReadWriteAttribute(jsObject: object, name: Strings.facingMode) + _resizeMode = ReadWriteAttribute(jsObject: object, name: Strings.resizeMode) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + _sampleSize = ReadWriteAttribute(jsObject: object, name: Strings.sampleSize) + _echoCancellation = ReadWriteAttribute(jsObject: object, name: Strings.echoCancellation) + _autoGainControl = ReadWriteAttribute(jsObject: object, name: Strings.autoGainControl) + _noiseSuppression = ReadWriteAttribute(jsObject: object, name: Strings.noiseSuppression) + _latency = ReadWriteAttribute(jsObject: object, name: Strings.latency) + _channelCount = ReadWriteAttribute(jsObject: object, name: Strings.channelCount) + _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) + _groupId = ReadWriteAttribute(jsObject: object, name: Strings.groupId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var width: Int32 + + @ReadWriteAttribute + public var height: Int32 + + @ReadWriteAttribute + public var aspectRatio: Double + + @ReadWriteAttribute + public var frameRate: Double + + @ReadWriteAttribute + public var facingMode: String + + @ReadWriteAttribute + public var resizeMode: String + + @ReadWriteAttribute + public var sampleRate: Int32 + + @ReadWriteAttribute + public var sampleSize: Int32 + + @ReadWriteAttribute + public var echoCancellation: Bool + + @ReadWriteAttribute + public var autoGainControl: Bool + + @ReadWriteAttribute + public var noiseSuppression: Bool + + @ReadWriteAttribute + public var latency: Double + + @ReadWriteAttribute + public var channelCount: Int32 + + @ReadWriteAttribute + public var deviceId: String + + @ReadWriteAttribute + public var groupId: String +} + +public class MediaTrackSupportedConstraints: BridgedDictionary { + public convenience init(width: Bool, height: Bool, aspectRatio: Bool, frameRate: Bool, facingMode: Bool, resizeMode: Bool, sampleRate: Bool, sampleSize: Bool, echoCancellation: Bool, autoGainControl: Bool, noiseSuppression: Bool, latency: Bool, channelCount: Bool, deviceId: Bool, groupId: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.aspectRatio] = aspectRatio.jsValue + object[Strings.frameRate] = frameRate.jsValue + object[Strings.facingMode] = facingMode.jsValue + object[Strings.resizeMode] = resizeMode.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.sampleSize] = sampleSize.jsValue + object[Strings.echoCancellation] = echoCancellation.jsValue + object[Strings.autoGainControl] = autoGainControl.jsValue + object[Strings.noiseSuppression] = noiseSuppression.jsValue + object[Strings.latency] = latency.jsValue + object[Strings.channelCount] = channelCount.jsValue + object[Strings.deviceId] = deviceId.jsValue + object[Strings.groupId] = groupId.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + _aspectRatio = ReadWriteAttribute(jsObject: object, name: Strings.aspectRatio) + _frameRate = ReadWriteAttribute(jsObject: object, name: Strings.frameRate) + _facingMode = ReadWriteAttribute(jsObject: object, name: Strings.facingMode) + _resizeMode = ReadWriteAttribute(jsObject: object, name: Strings.resizeMode) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + _sampleSize = ReadWriteAttribute(jsObject: object, name: Strings.sampleSize) + _echoCancellation = ReadWriteAttribute(jsObject: object, name: Strings.echoCancellation) + _autoGainControl = ReadWriteAttribute(jsObject: object, name: Strings.autoGainControl) + _noiseSuppression = ReadWriteAttribute(jsObject: object, name: Strings.noiseSuppression) + _latency = ReadWriteAttribute(jsObject: object, name: Strings.latency) + _channelCount = ReadWriteAttribute(jsObject: object, name: Strings.channelCount) + _deviceId = ReadWriteAttribute(jsObject: object, name: Strings.deviceId) + _groupId = ReadWriteAttribute(jsObject: object, name: Strings.groupId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var width: Bool + + @ReadWriteAttribute + public var height: Bool + + @ReadWriteAttribute + public var aspectRatio: Bool + + @ReadWriteAttribute + public var frameRate: Bool + + @ReadWriteAttribute + public var facingMode: Bool + + @ReadWriteAttribute + public var resizeMode: Bool + + @ReadWriteAttribute + public var sampleRate: Bool + + @ReadWriteAttribute + public var sampleSize: Bool + + @ReadWriteAttribute + public var echoCancellation: Bool + + @ReadWriteAttribute + public var autoGainControl: Bool + + @ReadWriteAttribute + public var noiseSuppression: Bool + + @ReadWriteAttribute + public var latency: Bool + + @ReadWriteAttribute + public var channelCount: Bool + + @ReadWriteAttribute + public var deviceId: Bool + + @ReadWriteAttribute + public var groupId: Bool +} + +public class MessageChannel: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.MessageChannel].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _port1 = ReadonlyAttribute(jsObject: jsObject, name: Strings.port1) + _port2 = ReadonlyAttribute(jsObject: jsObject, name: Strings.port2) + self.jsObject = jsObject + } + + @inlinable public convenience init() { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [])) + } + + @ReadonlyAttribute + public var port1: MessagePort + + @ReadonlyAttribute + public var port2: MessagePort +} + +public class MessageEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MessageEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _origin = ReadonlyAttribute(jsObject: jsObject, name: Strings.origin) + _lastEventId = ReadonlyAttribute(jsObject: jsObject, name: Strings.lastEventId) + _source = ReadonlyAttribute(jsObject: jsObject, name: Strings.source) + _ports = ReadonlyAttribute(jsObject: jsObject, name: Strings.ports) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(type: String, eventInitDict: MessageEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) + } + + @ReadonlyAttribute + public var data: JSValue + + @ReadonlyAttribute + public var origin: String + + @ReadonlyAttribute + public var lastEventId: String + + @ReadonlyAttribute + public var source: MessageEventSource? + + @ReadonlyAttribute + public var ports: [MessagePort] + + @inlinable public func initMessageEvent(type: String, bubbles: Bool? = nil, cancelable: Bool? = nil, data: JSValue? = nil, origin: String? = nil, lastEventId: String? = nil, source: MessageEventSource? = nil, ports: [MessagePort]? = nil) { + let _arg0 = type.jsValue + let _arg1 = bubbles?.jsValue ?? .undefined + let _arg2 = cancelable?.jsValue ?? .undefined + let _arg3 = data?.jsValue ?? .undefined + let _arg4 = origin?.jsValue ?? .undefined + let _arg5 = lastEventId?.jsValue ?? .undefined + let _arg6 = source?.jsValue ?? .undefined + let _arg7 = ports?.jsValue ?? .undefined + let this = jsObject + _ = this[Strings.initMessageEvent].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) + } +} + +public class MessageEventInit: BridgedDictionary { + public convenience init(data: JSValue, origin: String, lastEventId: String, source: MessageEventSource?, ports: [MessagePort]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.data] = data.jsValue + object[Strings.origin] = origin.jsValue + object[Strings.lastEventId] = lastEventId.jsValue + object[Strings.source] = source.jsValue + object[Strings.ports] = ports.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + _origin = ReadWriteAttribute(jsObject: object, name: Strings.origin) + _lastEventId = ReadWriteAttribute(jsObject: object, name: Strings.lastEventId) + _source = ReadWriteAttribute(jsObject: object, name: Strings.source) + _ports = ReadWriteAttribute(jsObject: object, name: Strings.ports) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var data: JSValue + + @ReadWriteAttribute + public var origin: String + + @ReadWriteAttribute + public var lastEventId: String + + @ReadWriteAttribute + public var source: MessageEventSource? @ReadWriteAttribute public var ports: [MessagePort] @@ -10306,11 +11130,17 @@ public class Navigator: JSBridgedClass, NavigatorID, NavigatorLanguage, Navigato public required init(unsafelyWrapping jsObject: JSObject) { _serviceWorker = ReadonlyAttribute(jsObject: jsObject, name: Strings.serviceWorker) + _mediaDevices = ReadonlyAttribute(jsObject: jsObject, name: Strings.mediaDevices) self.jsObject = jsObject } @ReadonlyAttribute public var serviceWorker: ServiceWorkerContainer + + @ReadonlyAttribute + public var mediaDevices: MediaDevices + + // XXX: member 'getUserMedia' is ignored } public protocol NavigatorConcurrentHardware: JSBridgedClass {} @@ -10787,6 +11617,22 @@ public class OptionalEffectTiming: BridgedDictionary { public var easing: String } +public class OverconstrainedError: DOMException { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.OverconstrainedError].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _constraint = ReadonlyAttribute(jsObject: jsObject, name: Strings.constraint) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(constraint: String, message: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [constraint.jsValue, message?.jsValue ?? .undefined])) + } + + @ReadonlyAttribute + public var constraint: String +} + public class PageTransitionEvent: Event { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.PageTransitionEvent].function! } @@ -13231,6 +14077,8 @@ public typealias TransformerStartCallback = (TransformStreamDefaultController) - public typealias TransformerFlushCallback = (TransformStreamDefaultController) -> JSPromise public typealias TransformerTransformCallback = (JSValue, TransformStreamDefaultController) -> JSPromise public typealias QueuingStrategySize = (JSValue) -> Double +public typealias NavigatorUserMediaSuccessCallback = (MediaStream) -> Void +public typealias NavigatorUserMediaErrorCallback = (DOMException) -> Void public class UIEvent: Event { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.UIEvent].function! } @@ -13286,6 +14134,27 @@ public class UIEventInit: BridgedDictionary { public var which: UInt32 } +public class ULongRange: BridgedDictionary { + public convenience init(max: UInt32, min: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.max] = max.jsValue + object[Strings.min] = min.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _max = ReadWriteAttribute(jsObject: object, name: Strings.max) + _min = ReadWriteAttribute(jsObject: object, name: Strings.min) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var max: UInt32 + + @ReadWriteAttribute + public var min: UInt32 +} + public class URL: JSBridgedClass { @inlinable public class var constructor: JSFunction { JSObject.global[Strings.URL].function! } @@ -13608,6 +14477,44 @@ public class ValidityStateFlags: BridgedDictionary { public var customError: Bool } +public enum VideoFacingModeEnum: JSString, JSValueCompatible { + case user = "user" + case environment = "environment" + case left = "left" + case right = "right" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public enum VideoResizeModeEnum: JSString, JSValueCompatible { + case none = "none" + case cropAndScale = "crop-and-scale" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + public class VideoTrack: JSBridgedClass { @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoTrack].function! } @@ -15430,12 +16337,18 @@ public enum console { @usableFromInline static let ImageBitmap: JSString = "ImageBitmap" @usableFromInline static let ImageBitmapRenderingContext: JSString = "ImageBitmapRenderingContext" @usableFromInline static let ImageData: JSString = "ImageData" + @usableFromInline static let InputDeviceInfo: JSString = "InputDeviceInfo" @usableFromInline static let InputEvent: JSString = "InputEvent" @usableFromInline static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" @usableFromInline static let KeyboardEvent: JSString = "KeyboardEvent" @usableFromInline static let KeyframeEffect: JSString = "KeyframeEffect" @usableFromInline static let Location: JSString = "Location" + @usableFromInline static let MediaDeviceInfo: JSString = "MediaDeviceInfo" + @usableFromInline static let MediaDevices: JSString = "MediaDevices" @usableFromInline static let MediaError: JSString = "MediaError" + @usableFromInline static let MediaStream: JSString = "MediaStream" + @usableFromInline static let MediaStreamTrack: JSString = "MediaStreamTrack" + @usableFromInline static let MediaStreamTrackEvent: JSString = "MediaStreamTrackEvent" @usableFromInline static let MessageChannel: JSString = "MessageChannel" @usableFromInline static let MessageEvent: JSString = "MessageEvent" @usableFromInline static let MessagePort: JSString = "MessagePort" @@ -15454,6 +16367,7 @@ public enum console { @usableFromInline static let Object: JSString = "Object" @usableFromInline static let OffscreenCanvas: JSString = "OffscreenCanvas" @usableFromInline static let OffscreenCanvasRenderingContext2D: JSString = "OffscreenCanvasRenderingContext2D" + @usableFromInline static let OverconstrainedError: JSString = "OverconstrainedError" @usableFromInline static let PageTransitionEvent: JSString = "PageTransitionEvent" @usableFromInline static let Path2D: JSString = "Path2D" @usableFromInline static let Performance: JSString = "Performance" @@ -15538,8 +16452,10 @@ public enum console { @usableFromInline static let addModule: JSString = "addModule" @usableFromInline static let addPath: JSString = "addPath" @usableFromInline static let addTextTrack: JSString = "addTextTrack" + @usableFromInline static let addTrack: JSString = "addTrack" @usableFromInline static let addedNodes: JSString = "addedNodes" @usableFromInline static let adoptNode: JSString = "adoptNode" + @usableFromInline static let advanced: JSString = "advanced" @usableFromInline static let after: JSString = "after" @usableFromInline static let alert: JSString = "alert" @usableFromInline static let align: JSString = "align" @@ -15561,6 +16477,7 @@ public enum console { @usableFromInline static let appendChild: JSString = "appendChild" @usableFromInline static let appendData: JSString = "appendData" @usableFromInline static let applets: JSString = "applets" + @usableFromInline static let applyConstraints: JSString = "applyConstraints" @usableFromInline static let arc: JSString = "arc" @usableFromInline static let arcTo: JSString = "arcTo" @usableFromInline static let archive: JSString = "archive" @@ -15607,6 +16524,7 @@ public enum console { @usableFromInline static let ariaValueText: JSString = "ariaValueText" @usableFromInline static let arrayBuffer: JSString = "arrayBuffer" @usableFromInline static let `as`: JSString = "as" + @usableFromInline static let aspectRatio: JSString = "aspectRatio" @usableFromInline static let assert: JSString = "assert" @usableFromInline static let assign: JSString = "assign" @usableFromInline static let assignedElements: JSString = "assignedElements" @@ -15623,8 +16541,10 @@ public enum console { @usableFromInline static let attributeNamespace: JSString = "attributeNamespace" @usableFromInline static let attributeOldValue: JSString = "attributeOldValue" @usableFromInline static let attributes: JSString = "attributes" + @usableFromInline static let audio: JSString = "audio" @usableFromInline static let audioTracks: JSString = "audioTracks" @usableFromInline static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" + @usableFromInline static let autoGainControl: JSString = "autoGainControl" @usableFromInline static let autocapitalize: JSString = "autocapitalize" @usableFromInline static let autocomplete: JSString = "autocomplete" @usableFromInline static let autofocus: JSString = "autofocus" @@ -15673,6 +16593,7 @@ public enum console { @usableFromInline static let cells: JSString = "cells" @usableFromInline static let ch: JSString = "ch" @usableFromInline static let chOff: JSString = "chOff" + @usableFromInline static let channelCount: JSString = "channelCount" @usableFromInline static let charCode: JSString = "charCode" @usableFromInline static let characterData: JSString = "characterData" @usableFromInline static let characterDataOldValue: JSString = "characterDataOldValue" @@ -15733,6 +16654,7 @@ public enum console { @usableFromInline static let computedOffset: JSString = "computedOffset" @usableFromInline static let confirm: JSString = "confirm" @usableFromInline static let console: JSString = "console" + @usableFromInline static let constraint: JSString = "constraint" @usableFromInline static let contains: JSString = "contains" @usableFromInline static let content: JSString = "content" @usableFromInline static let contentDocument: JSString = "contentDocument" @@ -15826,6 +16748,7 @@ public enum console { @usableFromInline static let desynchronized: JSString = "desynchronized" @usableFromInline static let detach: JSString = "detach" @usableFromInline static let detail: JSString = "detail" + @usableFromInline static let deviceId: JSString = "deviceId" @usableFromInline static let dir: JSString = "dir" @usableFromInline static let dirName: JSString = "dirName" @usableFromInline static let direction: JSString = "direction" @@ -15848,6 +16771,7 @@ public enum console { @usableFromInline static let duration: JSString = "duration" @usableFromInline static let e: JSString = "e" @usableFromInline static let easing: JSString = "easing" + @usableFromInline static let echoCancellation: JSString = "echoCancellation" @usableFromInline static let effect: JSString = "effect" @usableFromInline static let effectAllowed: JSString = "effectAllowed" @usableFromInline static let elements: JSString = "elements" @@ -15869,16 +16793,19 @@ public enum console { @usableFromInline static let endings: JSString = "endings" @usableFromInline static let enqueue: JSString = "enqueue" @usableFromInline static let enterKeyHint: JSString = "enterKeyHint" + @usableFromInline static let enumerateDevices: JSString = "enumerateDevices" @usableFromInline static let error: JSString = "error" @usableFromInline static let evaluate: JSString = "evaluate" @usableFromInline static let event: JSString = "event" @usableFromInline static let eventPhase: JSString = "eventPhase" + @usableFromInline static let exact: JSString = "exact" @usableFromInline static let execCommand: JSString = "execCommand" @usableFromInline static let extends: JSString = "extends" @usableFromInline static let external: JSString = "external" @usableFromInline static let extractContents: JSString = "extractContents" @usableFromInline static let f: JSString = "f" @usableFromInline static let face: JSString = "face" + @usableFromInline static let facingMode: JSString = "facingMode" @usableFromInline static let fastSeek: JSString = "fastSeek" @usableFromInline static let fetch: JSString = "fetch" @usableFromInline static let fgColor: JSString = "fgColor" @@ -15916,6 +16843,7 @@ public enum console { @usableFromInline static let frame: JSString = "frame" @usableFromInline static let frameBorder: JSString = "frameBorder" @usableFromInline static let frameElement: JSString = "frameElement" + @usableFromInline static let frameRate: JSString = "frameRate" @usableFromInline static let frames: JSString = "frames" @usableFromInline static let fromFloat32Array: JSString = "fromFloat32Array" @usableFromInline static let fromFloat64Array: JSString = "fromFloat64Array" @@ -15933,8 +16861,11 @@ public enum console { @usableFromInline static let getAttributeNames: JSString = "getAttributeNames" @usableFromInline static let getAttributeNode: JSString = "getAttributeNode" @usableFromInline static let getAttributeNodeNS: JSString = "getAttributeNodeNS" + @usableFromInline static let getAudioTracks: JSString = "getAudioTracks" @usableFromInline static let getBounds: JSString = "getBounds" + @usableFromInline static let getCapabilities: JSString = "getCapabilities" @usableFromInline static let getComputedTiming: JSString = "getComputedTiming" + @usableFromInline static let getConstraints: JSString = "getConstraints" @usableFromInline static let getContext: JSString = "getContext" @usableFromInline static let getContextAttributes: JSString = "getContextAttributes" @usableFromInline static let getCueById: JSString = "getCueById" @@ -15956,11 +16887,16 @@ public enum console { @usableFromInline static let getResponseHeader: JSString = "getResponseHeader" @usableFromInline static let getRootNode: JSString = "getRootNode" @usableFromInline static let getSVGDocument: JSString = "getSVGDocument" + @usableFromInline static let getSettings: JSString = "getSettings" @usableFromInline static let getStartDate: JSString = "getStartDate" @usableFromInline static let getState: JSString = "getState" + @usableFromInline static let getSupportedConstraints: JSString = "getSupportedConstraints" @usableFromInline static let getTiming: JSString = "getTiming" @usableFromInline static let getTrackById: JSString = "getTrackById" + @usableFromInline static let getTracks: JSString = "getTracks" @usableFromInline static let getTransform: JSString = "getTransform" + @usableFromInline static let getUserMedia: JSString = "getUserMedia" + @usableFromInline static let getVideoTracks: JSString = "getVideoTracks" @usableFromInline static let getWriter: JSString = "getWriter" @usableFromInline static let globalAlpha: JSString = "globalAlpha" @usableFromInline static let globalCompositeOperation: JSString = "globalCompositeOperation" @@ -15968,6 +16904,7 @@ public enum console { @usableFromInline static let group: JSString = "group" @usableFromInline static let groupCollapsed: JSString = "groupCollapsed" @usableFromInline static let groupEnd: JSString = "groupEnd" + @usableFromInline static let groupId: JSString = "groupId" @usableFromInline static let handled: JSString = "handled" @usableFromInline static let hangingBaseline: JSString = "hangingBaseline" @usableFromInline static let hardwareConcurrency: JSString = "hardwareConcurrency" @@ -15995,6 +16932,7 @@ public enum console { @usableFromInline static let htmlFor: JSString = "htmlFor" @usableFromInline static let httpEquiv: JSString = "httpEquiv" @usableFromInline static let id: JSString = "id" + @usableFromInline static let ideal: JSString = "ideal" @usableFromInline static let ideographicBaseline: JSString = "ideographicBaseline" @usableFromInline static let ignoreMethod: JSString = "ignoreMethod" @usableFromInline static let ignoreSearch: JSString = "ignoreSearch" @@ -16079,6 +17017,7 @@ public enum console { @usableFromInline static let lastElementChild: JSString = "lastElementChild" @usableFromInline static let lastEventId: JSString = "lastEventId" @usableFromInline static let lastModified: JSString = "lastModified" + @usableFromInline static let latency: JSString = "latency" @usableFromInline static let left: JSString = "left" @usableFromInline static let length: JSString = "length" @usableFromInline static let lengthComputable: JSString = "lengthComputable" @@ -16134,6 +17073,7 @@ public enum console { @usableFromInline static let maxLength: JSString = "maxLength" @usableFromInline static let measureText: JSString = "measureText" @usableFromInline static let media: JSString = "media" + @usableFromInline static let mediaDevices: JSString = "mediaDevices" @usableFromInline static let menubar: JSString = "menubar" @usableFromInline static let message: JSString = "message" @usableFromInline static let metaKey: JSString = "metaKey" @@ -16180,6 +17120,7 @@ public enum console { @usableFromInline static let nodeName: JSString = "nodeName" @usableFromInline static let nodeType: JSString = "nodeType" @usableFromInline static let nodeValue: JSString = "nodeValue" + @usableFromInline static let noiseSuppression: JSString = "noiseSuppression" @usableFromInline static let nonce: JSString = "nonce" @usableFromInline static let normalize: JSString = "normalize" @usableFromInline static let now: JSString = "now" @@ -16212,6 +17153,7 @@ public enum console { @usableFromInline static let oncuechange: JSString = "oncuechange" @usableFromInline static let oncut: JSString = "oncut" @usableFromInline static let ondblclick: JSString = "ondblclick" + @usableFromInline static let ondevicechange: JSString = "ondevicechange" @usableFromInline static let ondrag: JSString = "ondrag" @usableFromInline static let ondragend: JSString = "ondragend" @usableFromInline static let ondragenter: JSString = "ondragenter" @@ -16249,6 +17191,7 @@ public enum console { @usableFromInline static let onmouseout: JSString = "onmouseout" @usableFromInline static let onmouseover: JSString = "onmouseover" @usableFromInline static let onmouseup: JSString = "onmouseup" + @usableFromInline static let onmute: JSString = "onmute" @usableFromInline static let onoffline: JSString = "onoffline" @usableFromInline static let ononline: JSString = "ononline" @usableFromInline static let onopen: JSString = "onopen" @@ -16283,6 +17226,7 @@ public enum console { @usableFromInline static let ontoggle: JSString = "ontoggle" @usableFromInline static let onunhandledrejection: JSString = "onunhandledrejection" @usableFromInline static let onunload: JSString = "onunload" + @usableFromInline static let onunmute: JSString = "onunmute" @usableFromInline static let onupdatefound: JSString = "onupdatefound" @usableFromInline static let onvisibilitychange: JSString = "onvisibilitychange" @usableFromInline static let onvolumechange: JSString = "onvolumechange" @@ -16308,6 +17252,7 @@ public enum console { @usableFromInline static let p2: JSString = "p2" @usableFromInline static let p3: JSString = "p3" @usableFromInline static let p4: JSString = "p4" + @usableFromInline static let panTiltZoom: JSString = "panTiltZoom" @usableFromInline static let parent: JSString = "parent" @usableFromInline static let parentElement: JSString = "parentElement" @usableFromInline static let parentNode: JSString = "parentNode" @@ -16422,6 +17367,7 @@ public enum console { @usableFromInline static let removeNamedItem: JSString = "removeNamedItem" @usableFromInline static let removeNamedItemNS: JSString = "removeNamedItemNS" @usableFromInline static let removeParameter: JSString = "removeParameter" + @usableFromInline static let removeTrack: JSString = "removeTrack" @usableFromInline static let removedNodes: JSString = "removedNodes" @usableFromInline static let `repeat`: JSString = "repeat" @usableFromInline static let replace: JSString = "replace" @@ -16439,6 +17385,7 @@ public enum console { @usableFromInline static let reset: JSString = "reset" @usableFromInline static let resetTransform: JSString = "resetTransform" @usableFromInline static let resizeHeight: JSString = "resizeHeight" + @usableFromInline static let resizeMode: JSString = "resizeMode" @usableFromInline static let resizeQuality: JSString = "resizeQuality" @usableFromInline static let resizeWidth: JSString = "resizeWidth" @usableFromInline static let respond: JSString = "respond" @@ -16471,6 +17418,8 @@ public enum console { @usableFromInline static let rowSpan: JSString = "rowSpan" @usableFromInline static let rows: JSString = "rows" @usableFromInline static let rules: JSString = "rules" + @usableFromInline static let sampleRate: JSString = "sampleRate" + @usableFromInline static let sampleSize: JSString = "sampleSize" @usableFromInline static let sandbox: JSString = "sandbox" @usableFromInline static let save: JSString = "save" @usableFromInline static let scale: JSString = "scale" @@ -16684,6 +17633,7 @@ public enum console { @usableFromInline static let vendor: JSString = "vendor" @usableFromInline static let vendorSub: JSString = "vendorSub" @usableFromInline static let version: JSString = "version" + @usableFromInline static let video: JSString = "video" @usableFromInline static let videoHeight: JSString = "videoHeight" @usableFromInline static let videoTracks: JSString = "videoTracks" @usableFromInline static let videoWidth: JSString = "videoWidth" @@ -16871,6 +17821,48 @@ public enum BlobPart: JSValueCompatible, Any_BlobPart { } } +public protocol Any_Bool_or_MediaTrackConstraints: ConvertibleToJSValue {} +extension Bool: Any_Bool_or_MediaTrackConstraints {} +extension MediaTrackConstraints: Any_Bool_or_MediaTrackConstraints {} + +public enum Bool_or_MediaTrackConstraints: JSValueCompatible, Any_Bool_or_MediaTrackConstraints { + case bool(Bool) + case mediaTrackConstraints(MediaTrackConstraints) + + var bool: Bool? { + switch self { + case let .bool(bool): return bool + default: return nil + } + } + + var mediaTrackConstraints: MediaTrackConstraints? { + switch self { + case let .mediaTrackConstraints(mediaTrackConstraints): return mediaTrackConstraints + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let bool: Bool = value.fromJSValue() { + return .bool(bool) + } + if let mediaTrackConstraints: MediaTrackConstraints = value.fromJSValue() { + return .mediaTrackConstraints(mediaTrackConstraints) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .bool(bool): + return bool.jsValue + case let .mediaTrackConstraints(mediaTrackConstraints): + return mediaTrackConstraints.jsValue + } + } +} + public protocol Any_BufferSource: ConvertibleToJSValue {} extension ArrayBuffer: Any_BufferSource {} extension ArrayBufferView: Any_BufferSource {} @@ -17095,6 +18087,188 @@ public enum CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto: JSValue } } +public protocol Any_ConstrainBoolean: ConvertibleToJSValue {} +extension Bool: Any_ConstrainBoolean {} +extension ConstrainBooleanParameters: Any_ConstrainBoolean {} + +public enum ConstrainBoolean: JSValueCompatible, Any_ConstrainBoolean { + case bool(Bool) + case constrainBooleanParameters(ConstrainBooleanParameters) + + var bool: Bool? { + switch self { + case let .bool(bool): return bool + default: return nil + } + } + + var constrainBooleanParameters: ConstrainBooleanParameters? { + switch self { + case let .constrainBooleanParameters(constrainBooleanParameters): return constrainBooleanParameters + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let bool: Bool = value.fromJSValue() { + return .bool(bool) + } + if let constrainBooleanParameters: ConstrainBooleanParameters = value.fromJSValue() { + return .constrainBooleanParameters(constrainBooleanParameters) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .bool(bool): + return bool.jsValue + case let .constrainBooleanParameters(constrainBooleanParameters): + return constrainBooleanParameters.jsValue + } + } +} + +public protocol Any_ConstrainDOMString: ConvertibleToJSValue {} +extension ConstrainDOMStringParameters: Any_ConstrainDOMString {} +extension String: Any_ConstrainDOMString {} +extension Array: Any_ConstrainDOMString where Element == String {} + +public enum ConstrainDOMString: JSValueCompatible, Any_ConstrainDOMString { + case constrainDOMStringParameters(ConstrainDOMStringParameters) + case string(String) + case seq_of_String([String]) + + var constrainDOMStringParameters: ConstrainDOMStringParameters? { + switch self { + case let .constrainDOMStringParameters(constrainDOMStringParameters): return constrainDOMStringParameters + default: return nil + } + } + + var string: String? { + switch self { + case let .string(string): return string + default: return nil + } + } + + var seq_of_String: [String]? { + switch self { + case let .seq_of_String(seq_of_String): return seq_of_String + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let constrainDOMStringParameters: ConstrainDOMStringParameters = value.fromJSValue() { + return .constrainDOMStringParameters(constrainDOMStringParameters) + } + if let string: String = value.fromJSValue() { + return .string(string) + } + if let seq_of_String: [String] = value.fromJSValue() { + return .seq_of_String(seq_of_String) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .constrainDOMStringParameters(constrainDOMStringParameters): + return constrainDOMStringParameters.jsValue + case let .string(string): + return string.jsValue + case let .seq_of_String(seq_of_String): + return seq_of_String.jsValue + } + } +} + +public protocol Any_ConstrainDouble: ConvertibleToJSValue {} +extension ConstrainDoubleRange: Any_ConstrainDouble {} +extension Double: Any_ConstrainDouble {} + +public enum ConstrainDouble: JSValueCompatible, Any_ConstrainDouble { + case constrainDoubleRange(ConstrainDoubleRange) + case double(Double) + + var constrainDoubleRange: ConstrainDoubleRange? { + switch self { + case let .constrainDoubleRange(constrainDoubleRange): return constrainDoubleRange + default: return nil + } + } + + var double: Double? { + switch self { + case let .double(double): return double + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let constrainDoubleRange: ConstrainDoubleRange = value.fromJSValue() { + return .constrainDoubleRange(constrainDoubleRange) + } + if let double: Double = value.fromJSValue() { + return .double(double) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .constrainDoubleRange(constrainDoubleRange): + return constrainDoubleRange.jsValue + case let .double(double): + return double.jsValue + } + } +} + +public protocol Any_ConstrainULong: ConvertibleToJSValue {} +extension ConstrainULongRange: Any_ConstrainULong {} +extension UInt32: Any_ConstrainULong {} + +public enum ConstrainULong: JSValueCompatible, Any_ConstrainULong { + case constrainULongRange(ConstrainULongRange) + case uInt32(UInt32) + + var constrainULongRange: ConstrainULongRange? { + switch self { + case let .constrainULongRange(constrainULongRange): return constrainULongRange + default: return nil + } + } + + var uInt32: UInt32? { + switch self { + case let .uInt32(uInt32): return uInt32 + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let constrainULongRange: ConstrainULongRange = value.fromJSValue() { + return .constrainULongRange(constrainULongRange) + } + if let uInt32: UInt32 = value.fromJSValue() { + return .uInt32(uInt32) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .constrainULongRange(constrainULongRange): + return constrainULongRange.jsValue + case let .uInt32(uInt32): + return uInt32.jsValue + } + } +} + public protocol Any_DOMPointInit_or_Double: ConvertibleToJSValue {} extension DOMPointInit: Any_DOMPointInit_or_Double {} extension Double: Any_DOMPointInit_or_Double {} diff --git a/parse-idl/parse-all.js b/parse-idl/parse-all.js index a992f772..08b8be31 100644 --- a/parse-idl/parse-all.js +++ b/parse-idl/parse-all.js @@ -7,6 +7,7 @@ const parsedFiles = await parseAll(); console.log( JSON.stringify( [ + "console", "dom", "fetch", "FileAPI", @@ -22,7 +23,7 @@ console.log( "service-workers", "url", "streams", - "console", + "mediacapture-streams", ].map((key) => parsedFiles[key]), null, 2 From c6fb68d8acd327c8086cc63f4ce029df26b2abcb Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 3 May 2022 11:03:00 +0100 Subject: [PATCH 2/8] Add `mediastream-recording` IDL and generated code This is a requirement for `webgl2`, which I'm going to add in a future PR. --- Sources/DOMKit/Generated.swift | 253 +++++++++++++++++++++++++++++++++ parse-idl/parse-all.js | 1 + 2 files changed, 254 insertions(+) diff --git a/Sources/DOMKit/Generated.swift b/Sources/DOMKit/Generated.swift index 907d355b..3cfbd4a3 100644 --- a/Sources/DOMKit/Generated.swift +++ b/Sources/DOMKit/Generated.swift @@ -760,6 +760,24 @@ public class BeforeUnloadEvent: Event { // XXX: member 'returnValue' is ignored } +public enum BitrateMode: JSString, JSValueCompatible { + case constant = "constant" + case variable = "variable" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + public class Blob: JSBridgedClass { @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Blob].function! } @@ -813,6 +831,47 @@ public class Blob: JSBridgedClass { } } +public class BlobEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BlobEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _timecode = ReadonlyAttribute(jsObject: jsObject, name: Strings.timecode) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(type: String, eventInitDict: BlobEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) + } + + @ReadonlyAttribute + public var data: Blob + + @ReadonlyAttribute + public var timecode: DOMHighResTimeStamp +} + +public class BlobEventInit: BridgedDictionary { + public convenience init(data: Blob, timecode: DOMHighResTimeStamp) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.data] = data.jsValue + object[Strings.timecode] = timecode.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + _timecode = ReadWriteAttribute(jsObject: object, name: Strings.timecode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var data: Blob + + @ReadWriteAttribute + public var timecode: DOMHighResTimeStamp +} + public class BlobPropertyBag: BridgedDictionary { public convenience init(type: String, endings: EndingType) { let object = JSObject.global[Strings.Object].function!.new() @@ -9918,6 +9977,164 @@ public class MediaError: JSBridgedClass { public var message: String } +public class MediaRecorder: EventTarget { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaRecorder].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _stream = ReadonlyAttribute(jsObject: jsObject, name: Strings.stream) + _mimeType = ReadonlyAttribute(jsObject: jsObject, name: Strings.mimeType) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _onstart = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstart) + _onstop = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onstop) + _ondataavailable = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.ondataavailable) + _onpause = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onpause) + _onresume = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onresume) + _onerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onerror) + _videoBitsPerSecond = ReadonlyAttribute(jsObject: jsObject, name: Strings.videoBitsPerSecond) + _audioBitsPerSecond = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioBitsPerSecond) + _audioBitrateMode = ReadonlyAttribute(jsObject: jsObject, name: Strings.audioBitrateMode) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(stream: MediaStream, options: MediaRecorderOptions? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue, options?.jsValue ?? .undefined])) + } + + @ReadonlyAttribute + public var stream: MediaStream + + @ReadonlyAttribute + public var mimeType: String + + @ReadonlyAttribute + public var state: RecordingState + + @ClosureAttribute1Optional + public var onstart: EventHandler + + @ClosureAttribute1Optional + public var onstop: EventHandler + + @ClosureAttribute1Optional + public var ondataavailable: EventHandler + + @ClosureAttribute1Optional + public var onpause: EventHandler + + @ClosureAttribute1Optional + public var onresume: EventHandler + + @ClosureAttribute1Optional + public var onerror: EventHandler + + @ReadonlyAttribute + public var videoBitsPerSecond: UInt32 + + @ReadonlyAttribute + public var audioBitsPerSecond: UInt32 + + @ReadonlyAttribute + public var audioBitrateMode: BitrateMode + + @inlinable public func start(timeslice: UInt32? = nil) { + let this = jsObject + _ = this[Strings.start].function!(this: this, arguments: [timeslice?.jsValue ?? .undefined]) + } + + @inlinable public func stop() { + let this = jsObject + _ = this[Strings.stop].function!(this: this, arguments: []) + } + + @inlinable public func pause() { + let this = jsObject + _ = this[Strings.pause].function!(this: this, arguments: []) + } + + @inlinable public func resume() { + let this = jsObject + _ = this[Strings.resume].function!(this: this, arguments: []) + } + + @inlinable public func requestData() { + let this = jsObject + _ = this[Strings.requestData].function!(this: this, arguments: []) + } + + @inlinable public static func isTypeSupported(type: String) -> Bool { + let this = constructor + return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue]).fromJSValue()! + } +} + +public class MediaRecorderErrorEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaRecorderErrorEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _error = ReadonlyAttribute(jsObject: jsObject, name: Strings.error) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(type: String, eventInitDict: MediaRecorderErrorEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) + } + + @ReadonlyAttribute + public var error: DOMException +} + +public class MediaRecorderErrorEventInit: BridgedDictionary { + public convenience init(error: DOMException) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.error] = error.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _error = ReadWriteAttribute(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var error: DOMException +} + +public class MediaRecorderOptions: BridgedDictionary { + public convenience init(mimeType: String, audioBitsPerSecond: UInt32, videoBitsPerSecond: UInt32, bitsPerSecond: UInt32, audioBitrateMode: BitrateMode) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.mimeType] = mimeType.jsValue + object[Strings.audioBitsPerSecond] = audioBitsPerSecond.jsValue + object[Strings.videoBitsPerSecond] = videoBitsPerSecond.jsValue + object[Strings.bitsPerSecond] = bitsPerSecond.jsValue + object[Strings.audioBitrateMode] = audioBitrateMode.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _mimeType = ReadWriteAttribute(jsObject: object, name: Strings.mimeType) + _audioBitsPerSecond = ReadWriteAttribute(jsObject: object, name: Strings.audioBitsPerSecond) + _videoBitsPerSecond = ReadWriteAttribute(jsObject: object, name: Strings.videoBitsPerSecond) + _bitsPerSecond = ReadWriteAttribute(jsObject: object, name: Strings.bitsPerSecond) + _audioBitrateMode = ReadWriteAttribute(jsObject: object, name: Strings.audioBitrateMode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var mimeType: String + + @ReadWriteAttribute + public var audioBitsPerSecond: UInt32 + + @ReadWriteAttribute + public var videoBitsPerSecond: UInt32 + + @ReadWriteAttribute + public var bitsPerSecond: UInt32 + + @ReadWriteAttribute + public var audioBitrateMode: BitrateMode +} + public class MediaStream: EventTarget { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.MediaStream].function! } @@ -12529,6 +12746,25 @@ public class ReadableWritablePair: BridgedDictionary { public var writable: WritableStream } +public enum RecordingState: JSString, JSValueCompatible { + case inactive = "inactive" + case recording = "recording" + case paused = "paused" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + public enum ReferrerPolicy: JSString, JSValueCompatible { case _empty = "" case noReferrer = "no-referrer" @@ -16206,6 +16442,7 @@ public enum console { @usableFromInline static let BarProp: JSString = "BarProp" @usableFromInline static let BeforeUnloadEvent: JSString = "BeforeUnloadEvent" @usableFromInline static let Blob: JSString = "Blob" + @usableFromInline static let BlobEvent: JSString = "BlobEvent" @usableFromInline static let BroadcastChannel: JSString = "BroadcastChannel" @usableFromInline static let ByteLengthQueuingStrategy: JSString = "ByteLengthQueuingStrategy" @usableFromInline static let CDATASection: JSString = "CDATASection" @@ -16346,6 +16583,8 @@ public enum console { @usableFromInline static let MediaDeviceInfo: JSString = "MediaDeviceInfo" @usableFromInline static let MediaDevices: JSString = "MediaDevices" @usableFromInline static let MediaError: JSString = "MediaError" + @usableFromInline static let MediaRecorder: JSString = "MediaRecorder" + @usableFromInline static let MediaRecorderErrorEvent: JSString = "MediaRecorderErrorEvent" @usableFromInline static let MediaStream: JSString = "MediaStream" @usableFromInline static let MediaStreamTrack: JSString = "MediaStreamTrack" @usableFromInline static let MediaStreamTrackEvent: JSString = "MediaStreamTrackEvent" @@ -16542,6 +16781,8 @@ public enum console { @usableFromInline static let attributeOldValue: JSString = "attributeOldValue" @usableFromInline static let attributes: JSString = "attributes" @usableFromInline static let audio: JSString = "audio" + @usableFromInline static let audioBitrateMode: JSString = "audioBitrateMode" + @usableFromInline static let audioBitsPerSecond: JSString = "audioBitsPerSecond" @usableFromInline static let audioTracks: JSString = "audioTracks" @usableFromInline static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize" @usableFromInline static let autoGainControl: JSString = "autoGainControl" @@ -16560,6 +16801,7 @@ public enum console { @usableFromInline static let behavior: JSString = "behavior" @usableFromInline static let bezierCurveTo: JSString = "bezierCurveTo" @usableFromInline static let bgColor: JSString = "bgColor" + @usableFromInline static let bitsPerSecond: JSString = "bitsPerSecond" @usableFromInline static let blob: JSString = "blob" @usableFromInline static let blocking: JSString = "blocking" @usableFromInline static let blur: JSString = "blur" @@ -16996,6 +17238,7 @@ public enum console { @usableFromInline static let isSameNode: JSString = "isSameNode" @usableFromInline static let isSecureContext: JSString = "isSecureContext" @usableFromInline static let isTrusted: JSString = "isTrusted" + @usableFromInline static let isTypeSupported: JSString = "isTypeSupported" @usableFromInline static let item: JSString = "item" @usableFromInline static let items: JSString = "items" @usableFromInline static let iterateNext: JSString = "iterateNext" @@ -17078,6 +17321,7 @@ public enum console { @usableFromInline static let message: JSString = "message" @usableFromInline static let metaKey: JSString = "metaKey" @usableFromInline static let method: JSString = "method" + @usableFromInline static let mimeType: JSString = "mimeType" @usableFromInline static let mimeTypes: JSString = "mimeTypes" @usableFromInline static let min: JSString = "min" @usableFromInline static let minLength: JSString = "minLength" @@ -17152,6 +17396,7 @@ public enum console { @usableFromInline static let oncopy: JSString = "oncopy" @usableFromInline static let oncuechange: JSString = "oncuechange" @usableFromInline static let oncut: JSString = "oncut" + @usableFromInline static let ondataavailable: JSString = "ondataavailable" @usableFromInline static let ondblclick: JSString = "ondblclick" @usableFromInline static let ondevicechange: JSString = "ondevicechange" @usableFromInline static let ondrag: JSString = "ondrag" @@ -17210,6 +17455,7 @@ public enum console { @usableFromInline static let onremovetrack: JSString = "onremovetrack" @usableFromInline static let onreset: JSString = "onreset" @usableFromInline static let onresize: JSString = "onresize" + @usableFromInline static let onresume: JSString = "onresume" @usableFromInline static let onscroll: JSString = "onscroll" @usableFromInline static let onsecuritypolicyviolation: JSString = "onsecuritypolicyviolation" @usableFromInline static let onseeked: JSString = "onseeked" @@ -17217,7 +17463,9 @@ public enum console { @usableFromInline static let onselect: JSString = "onselect" @usableFromInline static let onslotchange: JSString = "onslotchange" @usableFromInline static let onstalled: JSString = "onstalled" + @usableFromInline static let onstart: JSString = "onstart" @usableFromInline static let onstatechange: JSString = "onstatechange" + @usableFromInline static let onstop: JSString = "onstop" @usableFromInline static let onstorage: JSString = "onstorage" @usableFromInline static let onsubmit: JSString = "onsubmit" @usableFromInline static let onsuspend: JSString = "onsuspend" @@ -17380,6 +17628,7 @@ public enum console { @usableFromInline static let reportError: JSString = "reportError" @usableFromInline static let reportValidity: JSString = "reportValidity" @usableFromInline static let request: JSString = "request" + @usableFromInline static let requestData: JSString = "requestData" @usableFromInline static let requestSubmit: JSString = "requestSubmit" @usableFromInline static let required: JSString = "required" @usableFromInline static let reset: JSString = "reset" @@ -17399,6 +17648,7 @@ public enum console { @usableFromInline static let result: JSString = "result" @usableFromInline static let resultType: JSString = "resultType" @usableFromInline static let resultingClientId: JSString = "resultingClientId" + @usableFromInline static let resume: JSString = "resume" @usableFromInline static let returnValue: JSString = "returnValue" @usableFromInline static let rev: JSString = "rev" @usableFromInline static let reverse: JSString = "reverse" @@ -17537,6 +17787,7 @@ public enum console { @usableFromInline static let stopImmediatePropagation: JSString = "stopImmediatePropagation" @usableFromInline static let stopPropagation: JSString = "stopPropagation" @usableFromInline static let storageArea: JSString = "storageArea" + @usableFromInline static let stream: JSString = "stream" @usableFromInline static let stringValue: JSString = "stringValue" @usableFromInline static let stroke: JSString = "stroke" @usableFromInline static let strokeRect: JSString = "strokeRect" @@ -17577,6 +17828,7 @@ public enum console { @usableFromInline static let timeLog: JSString = "timeLog" @usableFromInline static let timeOrigin: JSString = "timeOrigin" @usableFromInline static let timeStamp: JSString = "timeStamp" + @usableFromInline static let timecode: JSString = "timecode" @usableFromInline static let timeline: JSString = "timeline" @usableFromInline static let timeout: JSString = "timeout" @usableFromInline static let title: JSString = "title" @@ -17634,6 +17886,7 @@ public enum console { @usableFromInline static let vendorSub: JSString = "vendorSub" @usableFromInline static let version: JSString = "version" @usableFromInline static let video: JSString = "video" + @usableFromInline static let videoBitsPerSecond: JSString = "videoBitsPerSecond" @usableFromInline static let videoHeight: JSString = "videoHeight" @usableFromInline static let videoTracks: JSString = "videoTracks" @usableFromInline static let videoWidth: JSString = "videoWidth" diff --git a/parse-idl/parse-all.js b/parse-idl/parse-all.js index 08b8be31..36343f70 100644 --- a/parse-idl/parse-all.js +++ b/parse-idl/parse-all.js @@ -24,6 +24,7 @@ console.log( "url", "streams", "mediacapture-streams", + "mediastream-recording", ].map((key) => parsedFiles[key]), null, 2 From 49fa44502902abbe1998742817ec6f73b4f120e1 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 2 May 2022 16:07:16 +0100 Subject: [PATCH 3/8] Add `webcodecs` IDL spec and generated code --- Sources/DOMKit/WebIDL/AlphaOption.swift | 22 +++++ Sources/DOMKit/WebIDL/AudioData.swift | 62 +++++++++++++ .../WebIDL/AudioDataCopyToOptions.swift | 35 ++++++++ Sources/DOMKit/WebIDL/AudioDataInit.swift | 45 ++++++++++ Sources/DOMKit/WebIDL/AudioDecoder.swift | 70 +++++++++++++++ .../DOMKit/WebIDL/AudioDecoderConfig.swift | 35 ++++++++ Sources/DOMKit/WebIDL/AudioDecoderInit.swift | 25 ++++++ .../DOMKit/WebIDL/AudioDecoderSupport.swift | 25 ++++++ Sources/DOMKit/WebIDL/AudioEncoder.swift | 70 +++++++++++++++ .../DOMKit/WebIDL/AudioEncoderConfig.swift | 35 ++++++++ Sources/DOMKit/WebIDL/AudioEncoderInit.swift | 25 ++++++ .../DOMKit/WebIDL/AudioEncoderSupport.swift | 25 ++++++ Sources/DOMKit/WebIDL/AudioSampleFormat.swift | 28 ++++++ Sources/DOMKit/WebIDL/CodecState.swift | 23 +++++ Sources/DOMKit/WebIDL/EncodedAudioChunk.swift | 39 ++++++++ .../DOMKit/WebIDL/EncodedAudioChunkInit.swift | 35 ++++++++ .../WebIDL/EncodedAudioChunkMetadata.swift | 20 +++++ .../DOMKit/WebIDL/EncodedAudioChunkType.swift | 22 +++++ Sources/DOMKit/WebIDL/EncodedVideoChunk.swift | 39 ++++++++ .../DOMKit/WebIDL/EncodedVideoChunkInit.swift | 35 ++++++++ .../WebIDL/EncodedVideoChunkMetadata.swift | 30 +++++++ .../DOMKit/WebIDL/EncodedVideoChunkType.swift | 22 +++++ .../DOMKit/WebIDL/HardwareAcceleration.swift | 23 +++++ Sources/DOMKit/WebIDL/ImageBufferSource.swift | 46 ++++++++++ .../DOMKit/WebIDL/ImageDecodeOptions.swift | 25 ++++++ Sources/DOMKit/WebIDL/ImageDecodeResult.swift | 25 ++++++ Sources/DOMKit/WebIDL/ImageDecoder.swift | 68 ++++++++++++++ Sources/DOMKit/WebIDL/ImageDecoderInit.swift | 50 +++++++++++ Sources/DOMKit/WebIDL/ImageTrack.swift | 32 +++++++ Sources/DOMKit/WebIDL/ImageTrackList.swift | 34 +++++++ Sources/DOMKit/WebIDL/LatencyMode.swift | 22 +++++ Sources/DOMKit/WebIDL/PlaneLayout.swift | 25 ++++++ Sources/DOMKit/WebIDL/SvcOutputMetadata.swift | 20 +++++ .../DOMKit/WebIDL/VideoColorPrimaries.swift | 23 +++++ Sources/DOMKit/WebIDL/VideoColorSpace.swift | 39 ++++++++ .../DOMKit/WebIDL/VideoColorSpaceInit.swift | 35 ++++++++ Sources/DOMKit/WebIDL/VideoDecoder.swift | 70 +++++++++++++++ .../DOMKit/WebIDL/VideoDecoderConfig.swift | 60 +++++++++++++ Sources/DOMKit/WebIDL/VideoDecoderInit.swift | 25 ++++++ .../DOMKit/WebIDL/VideoDecoderSupport.swift | 25 ++++++ Sources/DOMKit/WebIDL/VideoEncoder.swift | 70 +++++++++++++++ .../DOMKit/WebIDL/VideoEncoderConfig.swift | 75 ++++++++++++++++ .../WebIDL/VideoEncoderEncodeOptions.swift | 20 +++++ Sources/DOMKit/WebIDL/VideoEncoderInit.swift | 25 ++++++ .../DOMKit/WebIDL/VideoEncoderSupport.swift | 25 ++++++ Sources/DOMKit/WebIDL/VideoFrame.swift | 89 +++++++++++++++++++ .../DOMKit/WebIDL/VideoFrameBufferInit.swift | 65 ++++++++++++++ .../WebIDL/VideoFrameCopyToOptions.swift | 25 ++++++ Sources/DOMKit/WebIDL/VideoFrameInit.swift | 45 ++++++++++ .../WebIDL/VideoMatrixCoefficients.swift | 24 +++++ Sources/DOMKit/WebIDL/VideoPixelFormat.swift | 29 ++++++ .../WebIDL/VideoTransferCharacteristics.swift | 23 +++++ parse-idl/parse-all.js | 1 + 53 files changed, 1930 insertions(+) create mode 100644 Sources/DOMKit/WebIDL/AlphaOption.swift create mode 100644 Sources/DOMKit/WebIDL/AudioData.swift create mode 100644 Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift create mode 100644 Sources/DOMKit/WebIDL/AudioDataInit.swift create mode 100644 Sources/DOMKit/WebIDL/AudioDecoder.swift create mode 100644 Sources/DOMKit/WebIDL/AudioDecoderConfig.swift create mode 100644 Sources/DOMKit/WebIDL/AudioDecoderInit.swift create mode 100644 Sources/DOMKit/WebIDL/AudioDecoderSupport.swift create mode 100644 Sources/DOMKit/WebIDL/AudioEncoder.swift create mode 100644 Sources/DOMKit/WebIDL/AudioEncoderConfig.swift create mode 100644 Sources/DOMKit/WebIDL/AudioEncoderInit.swift create mode 100644 Sources/DOMKit/WebIDL/AudioEncoderSupport.swift create mode 100644 Sources/DOMKit/WebIDL/AudioSampleFormat.swift create mode 100644 Sources/DOMKit/WebIDL/CodecState.swift create mode 100644 Sources/DOMKit/WebIDL/EncodedAudioChunk.swift create mode 100644 Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift create mode 100644 Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift create mode 100644 Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift create mode 100644 Sources/DOMKit/WebIDL/EncodedVideoChunk.swift create mode 100644 Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift create mode 100644 Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift create mode 100644 Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift create mode 100644 Sources/DOMKit/WebIDL/HardwareAcceleration.swift create mode 100644 Sources/DOMKit/WebIDL/ImageBufferSource.swift create mode 100644 Sources/DOMKit/WebIDL/ImageDecodeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/ImageDecodeResult.swift create mode 100644 Sources/DOMKit/WebIDL/ImageDecoder.swift create mode 100644 Sources/DOMKit/WebIDL/ImageDecoderInit.swift create mode 100644 Sources/DOMKit/WebIDL/ImageTrack.swift create mode 100644 Sources/DOMKit/WebIDL/ImageTrackList.swift create mode 100644 Sources/DOMKit/WebIDL/LatencyMode.swift create mode 100644 Sources/DOMKit/WebIDL/PlaneLayout.swift create mode 100644 Sources/DOMKit/WebIDL/SvcOutputMetadata.swift create mode 100644 Sources/DOMKit/WebIDL/VideoColorPrimaries.swift create mode 100644 Sources/DOMKit/WebIDL/VideoColorSpace.swift create mode 100644 Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift create mode 100644 Sources/DOMKit/WebIDL/VideoDecoder.swift create mode 100644 Sources/DOMKit/WebIDL/VideoDecoderConfig.swift create mode 100644 Sources/DOMKit/WebIDL/VideoDecoderInit.swift create mode 100644 Sources/DOMKit/WebIDL/VideoDecoderSupport.swift create mode 100644 Sources/DOMKit/WebIDL/VideoEncoder.swift create mode 100644 Sources/DOMKit/WebIDL/VideoEncoderConfig.swift create mode 100644 Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift create mode 100644 Sources/DOMKit/WebIDL/VideoEncoderInit.swift create mode 100644 Sources/DOMKit/WebIDL/VideoEncoderSupport.swift create mode 100644 Sources/DOMKit/WebIDL/VideoFrame.swift create mode 100644 Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift create mode 100644 Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift create mode 100644 Sources/DOMKit/WebIDL/VideoFrameInit.swift create mode 100644 Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift create mode 100644 Sources/DOMKit/WebIDL/VideoPixelFormat.swift create mode 100644 Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift diff --git a/Sources/DOMKit/WebIDL/AlphaOption.swift b/Sources/DOMKit/WebIDL/AlphaOption.swift new file mode 100644 index 00000000..f086fd3a --- /dev/null +++ b/Sources/DOMKit/WebIDL/AlphaOption.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AlphaOption: JSString, JSValueCompatible { + case keep = "keep" + case discard = "discard" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/AudioData.swift b/Sources/DOMKit/WebIDL/AudioData.swift new file mode 100644 index 00000000..a0fc829f --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioData.swift @@ -0,0 +1,62 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioData: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioData].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _format = ReadonlyAttribute(jsObject: jsObject, name: Strings.format) + _sampleRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleRate) + _numberOfFrames = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfFrames) + _numberOfChannels = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfChannels) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: AudioDataInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var format: AudioSampleFormat? + + @ReadonlyAttribute + public var sampleRate: Float + + @ReadonlyAttribute + public var numberOfFrames: UInt32 + + @ReadonlyAttribute + public var numberOfChannels: UInt32 + + @ReadonlyAttribute + public var duration: UInt64 + + @ReadonlyAttribute + public var timestamp: Int64 + + @inlinable public func allocationSize(options: AudioDataCopyToOptions) -> UInt32 { + let this = jsObject + return this[Strings.allocationSize].function!(this: this, arguments: [options.jsValue]).fromJSValue()! + } + + @inlinable public func copyTo(destination: BufferSource, options: AudioDataCopyToOptions) { + let this = jsObject + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue, options.jsValue]) + } + + @inlinable public func clone() -> Self { + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } +} diff --git a/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift b/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift new file mode 100644 index 00000000..78daea46 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioDataCopyToOptions: BridgedDictionary { + public convenience init(planeIndex: UInt32, frameOffset: UInt32, frameCount: UInt32, format: AudioSampleFormat) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.planeIndex] = planeIndex.jsValue + object[Strings.frameOffset] = frameOffset.jsValue + object[Strings.frameCount] = frameCount.jsValue + object[Strings.format] = format.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _planeIndex = ReadWriteAttribute(jsObject: object, name: Strings.planeIndex) + _frameOffset = ReadWriteAttribute(jsObject: object, name: Strings.frameOffset) + _frameCount = ReadWriteAttribute(jsObject: object, name: Strings.frameCount) + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var planeIndex: UInt32 + + @ReadWriteAttribute + public var frameOffset: UInt32 + + @ReadWriteAttribute + public var frameCount: UInt32 + + @ReadWriteAttribute + public var format: AudioSampleFormat +} diff --git a/Sources/DOMKit/WebIDL/AudioDataInit.swift b/Sources/DOMKit/WebIDL/AudioDataInit.swift new file mode 100644 index 00000000..d0395761 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioDataInit.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioDataInit: BridgedDictionary { + public convenience init(format: AudioSampleFormat, sampleRate: Float, numberOfFrames: UInt32, numberOfChannels: UInt32, timestamp: Int64, data: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.format] = format.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.numberOfFrames] = numberOfFrames.jsValue + object[Strings.numberOfChannels] = numberOfChannels.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.data] = data.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + _numberOfFrames = ReadWriteAttribute(jsObject: object, name: Strings.numberOfFrames) + _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var format: AudioSampleFormat + + @ReadWriteAttribute + public var sampleRate: Float + + @ReadWriteAttribute + public var numberOfFrames: UInt32 + + @ReadWriteAttribute + public var numberOfChannels: UInt32 + + @ReadWriteAttribute + public var timestamp: Int64 + + @ReadWriteAttribute + public var data: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/AudioDecoder.swift b/Sources/DOMKit/WebIDL/AudioDecoder.swift new file mode 100644 index 00000000..d511e5ba --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioDecoder.swift @@ -0,0 +1,70 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioDecoder: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioDecoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _decodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.decodeQueueSize) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: AudioDecoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var state: CodecState + + @ReadonlyAttribute + public var decodeQueueSize: UInt32 + + @inlinable public func configure(config: AudioDecoderConfig) { + let this = jsObject + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) + } + + @inlinable public func decode(chunk: EncodedAudioChunk) { + let this = jsObject + _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue]) + } + + @inlinable public func flush() -> JSPromise { + let this = jsObject + return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func flush() async throws { + let this = jsObject + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + _ = try await _promise.value + } + + @inlinable public func reset() { + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) + } + + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } + + @inlinable public static func isConfigSupported(config: AudioDecoderConfig) -> JSPromise { + let this = constructor + return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public static func isConfigSupported(config: AudioDecoderConfig) async throws -> AudioDecoderSupport { + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/AudioDecoderConfig.swift b/Sources/DOMKit/WebIDL/AudioDecoderConfig.swift new file mode 100644 index 00000000..55aa5a27 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioDecoderConfig.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioDecoderConfig: BridgedDictionary { + public convenience init(codec: String, sampleRate: UInt32, numberOfChannels: UInt32, description: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.codec] = codec.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.numberOfChannels] = numberOfChannels.jsValue + object[Strings.description] = description.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) + _description = ReadWriteAttribute(jsObject: object, name: Strings.description) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var codec: String + + @ReadWriteAttribute + public var sampleRate: UInt32 + + @ReadWriteAttribute + public var numberOfChannels: UInt32 + + @ReadWriteAttribute + public var description: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/AudioDecoderInit.swift b/Sources/DOMKit/WebIDL/AudioDecoderInit.swift new file mode 100644 index 00000000..b98e0449 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioDecoderInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioDecoderInit: BridgedDictionary { + public convenience init(output: @escaping AudioDataOutputCallback, error: @escaping WebCodecsErrorCallback) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute1Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute1Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute1Void + public var output: AudioDataOutputCallback + + @ClosureAttribute1Void + public var error: WebCodecsErrorCallback +} diff --git a/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift b/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift new file mode 100644 index 00000000..8245e0da --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioDecoderSupport: BridgedDictionary { + public convenience init(supported: Bool, config: AudioDecoderConfig) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) + _config = ReadWriteAttribute(jsObject: object, name: Strings.config) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var supported: Bool + + @ReadWriteAttribute + public var config: AudioDecoderConfig +} diff --git a/Sources/DOMKit/WebIDL/AudioEncoder.swift b/Sources/DOMKit/WebIDL/AudioEncoder.swift new file mode 100644 index 00000000..7565bc23 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioEncoder.swift @@ -0,0 +1,70 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioEncoder: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioEncoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _encodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.encodeQueueSize) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: AudioEncoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var state: CodecState + + @ReadonlyAttribute + public var encodeQueueSize: UInt32 + + @inlinable public func configure(config: AudioEncoderConfig) { + let this = jsObject + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) + } + + @inlinable public func encode(data: AudioData) { + let this = jsObject + _ = this[Strings.encode].function!(this: this, arguments: [data.jsValue]) + } + + @inlinable public func flush() -> JSPromise { + let this = jsObject + return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func flush() async throws { + let this = jsObject + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + _ = try await _promise.value + } + + @inlinable public func reset() { + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) + } + + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } + + @inlinable public static func isConfigSupported(config: AudioEncoderConfig) -> JSPromise { + let this = constructor + return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public static func isConfigSupported(config: AudioEncoderConfig) async throws -> AudioEncoderSupport { + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/AudioEncoderConfig.swift b/Sources/DOMKit/WebIDL/AudioEncoderConfig.swift new file mode 100644 index 00000000..0d8f8acf --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioEncoderConfig.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioEncoderConfig: BridgedDictionary { + public convenience init(codec: String, sampleRate: UInt32, numberOfChannels: UInt32, bitrate: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.codec] = codec.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.numberOfChannels] = numberOfChannels.jsValue + object[Strings.bitrate] = bitrate.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) + _bitrate = ReadWriteAttribute(jsObject: object, name: Strings.bitrate) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var codec: String + + @ReadWriteAttribute + public var sampleRate: UInt32 + + @ReadWriteAttribute + public var numberOfChannels: UInt32 + + @ReadWriteAttribute + public var bitrate: UInt64 +} diff --git a/Sources/DOMKit/WebIDL/AudioEncoderInit.swift b/Sources/DOMKit/WebIDL/AudioEncoderInit.swift new file mode 100644 index 00000000..550e8415 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioEncoderInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioEncoderInit: BridgedDictionary { + public convenience init(output: @escaping EncodedAudioChunkOutputCallback, error: @escaping WebCodecsErrorCallback) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute2Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute2Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute2Void + public var output: EncodedAudioChunkOutputCallback + + @ClosureAttribute1Void + public var error: WebCodecsErrorCallback +} diff --git a/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift b/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift new file mode 100644 index 00000000..bed3a52b --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class AudioEncoderSupport: BridgedDictionary { + public convenience init(supported: Bool, config: AudioEncoderConfig) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) + _config = ReadWriteAttribute(jsObject: object, name: Strings.config) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var supported: Bool + + @ReadWriteAttribute + public var config: AudioEncoderConfig +} diff --git a/Sources/DOMKit/WebIDL/AudioSampleFormat.swift b/Sources/DOMKit/WebIDL/AudioSampleFormat.swift new file mode 100644 index 00000000..a629b0a5 --- /dev/null +++ b/Sources/DOMKit/WebIDL/AudioSampleFormat.swift @@ -0,0 +1,28 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum AudioSampleFormat: JSString, JSValueCompatible { + case u8 = "u8" + case s16 = "s16" + case s32 = "s32" + case f32 = "f32" + case u8Planar = "u8-planar" + case s16Planar = "s16-planar" + case s32Planar = "s32-planar" + case f32Planar = "f32-planar" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/CodecState.swift b/Sources/DOMKit/WebIDL/CodecState.swift new file mode 100644 index 00000000..3495763f --- /dev/null +++ b/Sources/DOMKit/WebIDL/CodecState.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum CodecState: JSString, JSValueCompatible { + case unconfigured = "unconfigured" + case configured = "configured" + case closed = "closed" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift new file mode 100644 index 00000000..010e2b06 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EncodedAudioChunk: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EncodedAudioChunk].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _byteLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.byteLength) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: EncodedAudioChunkInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var type: EncodedAudioChunkType + + @ReadonlyAttribute + public var timestamp: Int64 + + @ReadonlyAttribute + public var duration: UInt64? + + @ReadonlyAttribute + public var byteLength: UInt32 + + @inlinable public func copyTo(destination: BufferSource) { + let this = jsObject + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue]) + } +} diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift new file mode 100644 index 00000000..054201f8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EncodedAudioChunkInit: BridgedDictionary { + public convenience init(type: EncodedAudioChunkType, timestamp: Int64, duration: UInt64, data: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.data] = data.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: EncodedAudioChunkType + + @ReadWriteAttribute + public var timestamp: Int64 + + @ReadWriteAttribute + public var duration: UInt64 + + @ReadWriteAttribute + public var data: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift new file mode 100644 index 00000000..6f5f8314 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EncodedAudioChunkMetadata: BridgedDictionary { + public convenience init(decoderConfig: AudioDecoderConfig) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.decoderConfig] = decoderConfig.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _decoderConfig = ReadWriteAttribute(jsObject: object, name: Strings.decoderConfig) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var decoderConfig: AudioDecoderConfig +} diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift new file mode 100644 index 00000000..9c35362e --- /dev/null +++ b/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum EncodedAudioChunkType: JSString, JSValueCompatible { + case key = "key" + case delta = "delta" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift new file mode 100644 index 00000000..1da80666 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EncodedVideoChunk: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EncodedVideoChunk].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _byteLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.byteLength) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: EncodedVideoChunkInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var type: EncodedVideoChunkType + + @ReadonlyAttribute + public var timestamp: Int64 + + @ReadonlyAttribute + public var duration: UInt64? + + @ReadonlyAttribute + public var byteLength: UInt32 + + @inlinable public func copyTo(destination: BufferSource) { + let this = jsObject + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue]) + } +} diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift new file mode 100644 index 00000000..0c95c51f --- /dev/null +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EncodedVideoChunkInit: BridgedDictionary { + public convenience init(type: EncodedVideoChunkType, timestamp: Int64, duration: UInt64, data: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.data] = data.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: EncodedVideoChunkType + + @ReadWriteAttribute + public var timestamp: Int64 + + @ReadWriteAttribute + public var duration: UInt64 + + @ReadWriteAttribute + public var data: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift new file mode 100644 index 00000000..6b3572e9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift @@ -0,0 +1,30 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class EncodedVideoChunkMetadata: BridgedDictionary { + public convenience init(decoderConfig: VideoDecoderConfig, svc: SvcOutputMetadata, alphaSideData: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.decoderConfig] = decoderConfig.jsValue + object[Strings.svc] = svc.jsValue + object[Strings.alphaSideData] = alphaSideData.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _decoderConfig = ReadWriteAttribute(jsObject: object, name: Strings.decoderConfig) + _svc = ReadWriteAttribute(jsObject: object, name: Strings.svc) + _alphaSideData = ReadWriteAttribute(jsObject: object, name: Strings.alphaSideData) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var decoderConfig: VideoDecoderConfig + + @ReadWriteAttribute + public var svc: SvcOutputMetadata + + @ReadWriteAttribute + public var alphaSideData: BufferSource +} diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift new file mode 100644 index 00000000..f59b9723 --- /dev/null +++ b/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum EncodedVideoChunkType: JSString, JSValueCompatible { + case key = "key" + case delta = "delta" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/HardwareAcceleration.swift b/Sources/DOMKit/WebIDL/HardwareAcceleration.swift new file mode 100644 index 00000000..9adb76b1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/HardwareAcceleration.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum HardwareAcceleration: JSString, JSValueCompatible { + case noPreference = "no-preference" + case preferHardware = "prefer-hardware" + case preferSoftware = "prefer-software" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/ImageBufferSource.swift b/Sources/DOMKit/WebIDL/ImageBufferSource.swift new file mode 100644 index 00000000..0aa23282 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageBufferSource.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_ImageBufferSource: ConvertibleToJSValue {} +extension BufferSource: Any_ImageBufferSource {} +extension ReadableStream: Any_ImageBufferSource {} + +public enum ImageBufferSource: JSValueCompatible, Any_ImageBufferSource { + case bufferSource(BufferSource) + case readableStream(ReadableStream) + + var bufferSource: BufferSource? { + switch self { + case let .bufferSource(bufferSource): return bufferSource + default: return nil + } + } + + var readableStream: ReadableStream? { + switch self { + case let .readableStream(readableStream): return readableStream + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let bufferSource: BufferSource = value.fromJSValue() { + return .bufferSource(bufferSource) + } + if let readableStream: ReadableStream = value.fromJSValue() { + return .readableStream(readableStream) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .bufferSource(bufferSource): + return bufferSource.jsValue + case let .readableStream(readableStream): + return readableStream.jsValue + } + } +} diff --git a/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift b/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift new file mode 100644 index 00000000..89806708 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageDecodeOptions: BridgedDictionary { + public convenience init(frameIndex: UInt32, completeFramesOnly: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.frameIndex] = frameIndex.jsValue + object[Strings.completeFramesOnly] = completeFramesOnly.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _frameIndex = ReadWriteAttribute(jsObject: object, name: Strings.frameIndex) + _completeFramesOnly = ReadWriteAttribute(jsObject: object, name: Strings.completeFramesOnly) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var frameIndex: UInt32 + + @ReadWriteAttribute + public var completeFramesOnly: Bool +} diff --git a/Sources/DOMKit/WebIDL/ImageDecodeResult.swift b/Sources/DOMKit/WebIDL/ImageDecodeResult.swift new file mode 100644 index 00000000..1a4cb939 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageDecodeResult.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageDecodeResult: BridgedDictionary { + public convenience init(image: VideoFrame, complete: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.image] = image.jsValue + object[Strings.complete] = complete.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _image = ReadWriteAttribute(jsObject: object, name: Strings.image) + _complete = ReadWriteAttribute(jsObject: object, name: Strings.complete) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var image: VideoFrame + + @ReadWriteAttribute + public var complete: Bool +} diff --git a/Sources/DOMKit/WebIDL/ImageDecoder.swift b/Sources/DOMKit/WebIDL/ImageDecoder.swift new file mode 100644 index 00000000..6112d940 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageDecoder.swift @@ -0,0 +1,68 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageDecoder: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageDecoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _complete = ReadonlyAttribute(jsObject: jsObject, name: Strings.complete) + _completed = ReadonlyAttribute(jsObject: jsObject, name: Strings.completed) + _tracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.tracks) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: ImageDecoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var type: String + + @ReadonlyAttribute + public var complete: Bool + + @ReadonlyAttribute + public var completed: JSPromise + + @ReadonlyAttribute + public var tracks: ImageTrackList + + @inlinable public func decode(options: ImageDecodeOptions? = nil) -> JSPromise { + let this = jsObject + return this[Strings.decode].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func decode(options: ImageDecodeOptions? = nil) async throws -> ImageDecodeResult { + let this = jsObject + let _promise: JSPromise = this[Strings.decode].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } + + @inlinable public func reset() { + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) + } + + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } + + @inlinable public static func isTypeSupported(type: String) -> JSPromise { + let this = constructor + return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public static func isTypeSupported(type: String) async throws -> Bool { + let this = constructor + let _promise: JSPromise = this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/ImageDecoderInit.swift b/Sources/DOMKit/WebIDL/ImageDecoderInit.swift new file mode 100644 index 00000000..06179973 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageDecoderInit.swift @@ -0,0 +1,50 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageDecoderInit: BridgedDictionary { + public convenience init(type: String, data: ImageBufferSource, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, desiredWidth: UInt32, desiredHeight: UInt32, preferAnimation: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue + object[Strings.data] = data.jsValue + object[Strings.premultiplyAlpha] = premultiplyAlpha.jsValue + object[Strings.colorSpaceConversion] = colorSpaceConversion.jsValue + object[Strings.desiredWidth] = desiredWidth.jsValue + object[Strings.desiredHeight] = desiredHeight.jsValue + object[Strings.preferAnimation] = preferAnimation.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + _premultiplyAlpha = ReadWriteAttribute(jsObject: object, name: Strings.premultiplyAlpha) + _colorSpaceConversion = ReadWriteAttribute(jsObject: object, name: Strings.colorSpaceConversion) + _desiredWidth = ReadWriteAttribute(jsObject: object, name: Strings.desiredWidth) + _desiredHeight = ReadWriteAttribute(jsObject: object, name: Strings.desiredHeight) + _preferAnimation = ReadWriteAttribute(jsObject: object, name: Strings.preferAnimation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var data: ImageBufferSource + + @ReadWriteAttribute + public var premultiplyAlpha: PremultiplyAlpha + + @ReadWriteAttribute + public var colorSpaceConversion: ColorSpaceConversion + + @ReadWriteAttribute + public var desiredWidth: UInt32 + + @ReadWriteAttribute + public var desiredHeight: UInt32 + + @ReadWriteAttribute + public var preferAnimation: Bool +} diff --git a/Sources/DOMKit/WebIDL/ImageTrack.swift b/Sources/DOMKit/WebIDL/ImageTrack.swift new file mode 100644 index 00000000..b68c7a97 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageTrack.swift @@ -0,0 +1,32 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageTrack: EventTarget { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ImageTrack].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _animated = ReadonlyAttribute(jsObject: jsObject, name: Strings.animated) + _frameCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameCount) + _repetitionCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.repetitionCount) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) + _selected = ReadWriteAttribute(jsObject: jsObject, name: Strings.selected) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var animated: Bool + + @ReadonlyAttribute + public var frameCount: UInt32 + + @ReadonlyAttribute + public var repetitionCount: Float + + @ClosureAttribute1Optional + public var onchange: EventHandler + + @ReadWriteAttribute + public var selected: Bool +} diff --git a/Sources/DOMKit/WebIDL/ImageTrackList.swift b/Sources/DOMKit/WebIDL/ImageTrackList.swift new file mode 100644 index 00000000..10b44925 --- /dev/null +++ b/Sources/DOMKit/WebIDL/ImageTrackList.swift @@ -0,0 +1,34 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class ImageTrackList: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageTrackList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedIndex) + _selectedTrack = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedTrack) + self.jsObject = jsObject + } + + @inlinable public subscript(key: Int) -> ImageTrack { + jsObject[key].fromJSValue()! + } + + @ReadonlyAttribute + public var ready: JSPromise + + @ReadonlyAttribute + public var length: UInt32 + + @ReadonlyAttribute + public var selectedIndex: Int32 + + @ReadonlyAttribute + public var selectedTrack: ImageTrack? +} diff --git a/Sources/DOMKit/WebIDL/LatencyMode.swift b/Sources/DOMKit/WebIDL/LatencyMode.swift new file mode 100644 index 00000000..d4aa61af --- /dev/null +++ b/Sources/DOMKit/WebIDL/LatencyMode.swift @@ -0,0 +1,22 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum LatencyMode: JSString, JSValueCompatible { + case quality = "quality" + case realtime = "realtime" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/PlaneLayout.swift b/Sources/DOMKit/WebIDL/PlaneLayout.swift new file mode 100644 index 00000000..a4de400e --- /dev/null +++ b/Sources/DOMKit/WebIDL/PlaneLayout.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class PlaneLayout: BridgedDictionary { + public convenience init(offset: UInt32, stride: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.offset] = offset.jsValue + object[Strings.stride] = stride.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) + _stride = ReadWriteAttribute(jsObject: object, name: Strings.stride) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var offset: UInt32 + + @ReadWriteAttribute + public var stride: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift b/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift new file mode 100644 index 00000000..2487040f --- /dev/null +++ b/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class SvcOutputMetadata: BridgedDictionary { + public convenience init(temporalLayerId: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.temporalLayerId] = temporalLayerId.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _temporalLayerId = ReadWriteAttribute(jsObject: object, name: Strings.temporalLayerId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var temporalLayerId: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift b/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift new file mode 100644 index 00000000..364fa134 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum VideoColorPrimaries: JSString, JSValueCompatible { + case bt709 = "bt709" + case bt470bg = "bt470bg" + case smpte170m = "smpte170m" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/VideoColorSpace.swift b/Sources/DOMKit/WebIDL/VideoColorSpace.swift new file mode 100644 index 00000000..25b08860 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoColorSpace.swift @@ -0,0 +1,39 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoColorSpace: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoColorSpace].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _primaries = ReadonlyAttribute(jsObject: jsObject, name: Strings.primaries) + _transfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.transfer) + _matrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.matrix) + _fullRange = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullRange) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: VideoColorSpaceInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) + } + + @ReadonlyAttribute + public var primaries: VideoColorPrimaries? + + @ReadonlyAttribute + public var transfer: VideoTransferCharacteristics? + + @ReadonlyAttribute + public var matrix: VideoMatrixCoefficients? + + @ReadonlyAttribute + public var fullRange: Bool? + + @inlinable public func toJSON() -> VideoColorSpaceInit { + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift b/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift new file mode 100644 index 00000000..786cfccc --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift @@ -0,0 +1,35 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoColorSpaceInit: BridgedDictionary { + public convenience init(primaries: VideoColorPrimaries, transfer: VideoTransferCharacteristics, matrix: VideoMatrixCoefficients, fullRange: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.primaries] = primaries.jsValue + object[Strings.transfer] = transfer.jsValue + object[Strings.matrix] = matrix.jsValue + object[Strings.fullRange] = fullRange.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _primaries = ReadWriteAttribute(jsObject: object, name: Strings.primaries) + _transfer = ReadWriteAttribute(jsObject: object, name: Strings.transfer) + _matrix = ReadWriteAttribute(jsObject: object, name: Strings.matrix) + _fullRange = ReadWriteAttribute(jsObject: object, name: Strings.fullRange) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var primaries: VideoColorPrimaries + + @ReadWriteAttribute + public var transfer: VideoTransferCharacteristics + + @ReadWriteAttribute + public var matrix: VideoMatrixCoefficients + + @ReadWriteAttribute + public var fullRange: Bool +} diff --git a/Sources/DOMKit/WebIDL/VideoDecoder.swift b/Sources/DOMKit/WebIDL/VideoDecoder.swift new file mode 100644 index 00000000..8f8900c2 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoDecoder.swift @@ -0,0 +1,70 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoDecoder: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoDecoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _decodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.decodeQueueSize) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: VideoDecoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var state: CodecState + + @ReadonlyAttribute + public var decodeQueueSize: UInt32 + + @inlinable public func configure(config: VideoDecoderConfig) { + let this = jsObject + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) + } + + @inlinable public func decode(chunk: EncodedVideoChunk) { + let this = jsObject + _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue]) + } + + @inlinable public func flush() -> JSPromise { + let this = jsObject + return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func flush() async throws { + let this = jsObject + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + _ = try await _promise.value + } + + @inlinable public func reset() { + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) + } + + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } + + @inlinable public static func isConfigSupported(config: VideoDecoderConfig) -> JSPromise { + let this = constructor + return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public static func isConfigSupported(config: VideoDecoderConfig) async throws -> VideoDecoderSupport { + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/VideoDecoderConfig.swift b/Sources/DOMKit/WebIDL/VideoDecoderConfig.swift new file mode 100644 index 00000000..3e431877 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoDecoderConfig.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoDecoderConfig: BridgedDictionary { + public convenience init(codec: String, description: BufferSource, codedWidth: UInt32, codedHeight: UInt32, displayAspectWidth: UInt32, displayAspectHeight: UInt32, colorSpace: VideoColorSpaceInit, hardwareAcceleration: HardwareAcceleration, optimizeForLatency: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.codec] = codec.jsValue + object[Strings.description] = description.jsValue + object[Strings.codedWidth] = codedWidth.jsValue + object[Strings.codedHeight] = codedHeight.jsValue + object[Strings.displayAspectWidth] = displayAspectWidth.jsValue + object[Strings.displayAspectHeight] = displayAspectHeight.jsValue + object[Strings.colorSpace] = colorSpace.jsValue + object[Strings.hardwareAcceleration] = hardwareAcceleration.jsValue + object[Strings.optimizeForLatency] = optimizeForLatency.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) + _description = ReadWriteAttribute(jsObject: object, name: Strings.description) + _codedWidth = ReadWriteAttribute(jsObject: object, name: Strings.codedWidth) + _codedHeight = ReadWriteAttribute(jsObject: object, name: Strings.codedHeight) + _displayAspectWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayAspectWidth) + _displayAspectHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayAspectHeight) + _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) + _hardwareAcceleration = ReadWriteAttribute(jsObject: object, name: Strings.hardwareAcceleration) + _optimizeForLatency = ReadWriteAttribute(jsObject: object, name: Strings.optimizeForLatency) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var codec: String + + @ReadWriteAttribute + public var description: BufferSource + + @ReadWriteAttribute + public var codedWidth: UInt32 + + @ReadWriteAttribute + public var codedHeight: UInt32 + + @ReadWriteAttribute + public var displayAspectWidth: UInt32 + + @ReadWriteAttribute + public var displayAspectHeight: UInt32 + + @ReadWriteAttribute + public var colorSpace: VideoColorSpaceInit + + @ReadWriteAttribute + public var hardwareAcceleration: HardwareAcceleration + + @ReadWriteAttribute + public var optimizeForLatency: Bool +} diff --git a/Sources/DOMKit/WebIDL/VideoDecoderInit.swift b/Sources/DOMKit/WebIDL/VideoDecoderInit.swift new file mode 100644 index 00000000..0614f47e --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoDecoderInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoDecoderInit: BridgedDictionary { + public convenience init(output: @escaping VideoFrameOutputCallback, error: @escaping WebCodecsErrorCallback) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute1Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute1Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute1Void + public var output: VideoFrameOutputCallback + + @ClosureAttribute1Void + public var error: WebCodecsErrorCallback +} diff --git a/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift b/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift new file mode 100644 index 00000000..4d41da3d --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoDecoderSupport: BridgedDictionary { + public convenience init(supported: Bool, config: VideoDecoderConfig) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) + _config = ReadWriteAttribute(jsObject: object, name: Strings.config) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var supported: Bool + + @ReadWriteAttribute + public var config: VideoDecoderConfig +} diff --git a/Sources/DOMKit/WebIDL/VideoEncoder.swift b/Sources/DOMKit/WebIDL/VideoEncoder.swift new file mode 100644 index 00000000..2349c057 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoEncoder.swift @@ -0,0 +1,70 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoEncoder: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoEncoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _encodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.encodeQueueSize) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: VideoEncoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var state: CodecState + + @ReadonlyAttribute + public var encodeQueueSize: UInt32 + + @inlinable public func configure(config: VideoEncoderConfig) { + let this = jsObject + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) + } + + @inlinable public func encode(frame: VideoFrame, options: VideoEncoderEncodeOptions? = nil) { + let this = jsObject + _ = this[Strings.encode].function!(this: this, arguments: [frame.jsValue, options?.jsValue ?? .undefined]) + } + + @inlinable public func flush() -> JSPromise { + let this = jsObject + return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func flush() async throws { + let this = jsObject + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + _ = try await _promise.value + } + + @inlinable public func reset() { + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) + } + + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } + + @inlinable public static func isConfigSupported(config: VideoEncoderConfig) -> JSPromise { + let this = constructor + return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public static func isConfigSupported(config: VideoEncoderConfig) async throws -> VideoEncoderSupport { + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } +} diff --git a/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift b/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift new file mode 100644 index 00000000..c6fdfd98 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift @@ -0,0 +1,75 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoEncoderConfig: BridgedDictionary { + public convenience init(codec: String, width: UInt32, height: UInt32, displayWidth: UInt32, displayHeight: UInt32, bitrate: UInt64, framerate: Double, hardwareAcceleration: HardwareAcceleration, alpha: AlphaOption, scalabilityMode: String, bitrateMode: BitrateMode, latencyMode: LatencyMode) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.codec] = codec.jsValue + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.displayWidth] = displayWidth.jsValue + object[Strings.displayHeight] = displayHeight.jsValue + object[Strings.bitrate] = bitrate.jsValue + object[Strings.framerate] = framerate.jsValue + object[Strings.hardwareAcceleration] = hardwareAcceleration.jsValue + object[Strings.alpha] = alpha.jsValue + object[Strings.scalabilityMode] = scalabilityMode.jsValue + object[Strings.bitrateMode] = bitrateMode.jsValue + object[Strings.latencyMode] = latencyMode.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + _displayWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayWidth) + _displayHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayHeight) + _bitrate = ReadWriteAttribute(jsObject: object, name: Strings.bitrate) + _framerate = ReadWriteAttribute(jsObject: object, name: Strings.framerate) + _hardwareAcceleration = ReadWriteAttribute(jsObject: object, name: Strings.hardwareAcceleration) + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) + _bitrateMode = ReadWriteAttribute(jsObject: object, name: Strings.bitrateMode) + _latencyMode = ReadWriteAttribute(jsObject: object, name: Strings.latencyMode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var codec: String + + @ReadWriteAttribute + public var width: UInt32 + + @ReadWriteAttribute + public var height: UInt32 + + @ReadWriteAttribute + public var displayWidth: UInt32 + + @ReadWriteAttribute + public var displayHeight: UInt32 + + @ReadWriteAttribute + public var bitrate: UInt64 + + @ReadWriteAttribute + public var framerate: Double + + @ReadWriteAttribute + public var hardwareAcceleration: HardwareAcceleration + + @ReadWriteAttribute + public var alpha: AlphaOption + + @ReadWriteAttribute + public var scalabilityMode: String + + @ReadWriteAttribute + public var bitrateMode: BitrateMode + + @ReadWriteAttribute + public var latencyMode: LatencyMode +} diff --git a/Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift b/Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift new file mode 100644 index 00000000..583d307c --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoEncoderEncodeOptions: BridgedDictionary { + public convenience init(keyFrame: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.keyFrame] = keyFrame.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _keyFrame = ReadWriteAttribute(jsObject: object, name: Strings.keyFrame) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var keyFrame: Bool +} diff --git a/Sources/DOMKit/WebIDL/VideoEncoderInit.swift b/Sources/DOMKit/WebIDL/VideoEncoderInit.swift new file mode 100644 index 00000000..f9859e1b --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoEncoderInit.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoEncoderInit: BridgedDictionary { + public convenience init(output: @escaping EncodedVideoChunkOutputCallback, error: @escaping WebCodecsErrorCallback) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute2Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute2Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute2Void + public var output: EncodedVideoChunkOutputCallback + + @ClosureAttribute1Void + public var error: WebCodecsErrorCallback +} diff --git a/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift b/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift new file mode 100644 index 00000000..f6419290 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoEncoderSupport: BridgedDictionary { + public convenience init(supported: Bool, config: VideoEncoderConfig) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) + _config = ReadWriteAttribute(jsObject: object, name: Strings.config) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var supported: Bool + + @ReadWriteAttribute + public var config: VideoEncoderConfig +} diff --git a/Sources/DOMKit/WebIDL/VideoFrame.swift b/Sources/DOMKit/WebIDL/VideoFrame.swift new file mode 100644 index 00000000..9743b3fc --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoFrame.swift @@ -0,0 +1,89 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoFrame: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoFrame].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _format = ReadonlyAttribute(jsObject: jsObject, name: Strings.format) + _codedWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.codedWidth) + _codedHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.codedHeight) + _codedRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.codedRect) + _visibleRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibleRect) + _displayWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.displayWidth) + _displayHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.displayHeight) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorSpace) + self.jsObject = jsObject + } + + @inlinable public convenience init(image: CanvasImageSource, init: VideoFrameInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [image.jsValue, `init`?.jsValue ?? .undefined])) + } + + @inlinable public convenience init(data: BufferSource, init: VideoFrameBufferInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue, `init`.jsValue])) + } + + @ReadonlyAttribute + public var format: VideoPixelFormat? + + @ReadonlyAttribute + public var codedWidth: UInt32 + + @ReadonlyAttribute + public var codedHeight: UInt32 + + @ReadonlyAttribute + public var codedRect: DOMRectReadOnly? + + @ReadonlyAttribute + public var visibleRect: DOMRectReadOnly? + + @ReadonlyAttribute + public var displayWidth: UInt32 + + @ReadonlyAttribute + public var displayHeight: UInt32 + + @ReadonlyAttribute + public var duration: UInt64? + + @ReadonlyAttribute + public var timestamp: Int64? + + @ReadonlyAttribute + public var colorSpace: VideoColorSpace + + @inlinable public func allocationSize(options: VideoFrameCopyToOptions? = nil) -> UInt32 { + let this = jsObject + return this[Strings.allocationSize].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + } + + @inlinable public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) -> JSPromise { + let this = jsObject + return this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) async throws -> [PlaneLayout] { + let this = jsObject + let _promise: JSPromise = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } + + @inlinable public func clone() -> Self { + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } +} diff --git a/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift b/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift new file mode 100644 index 00000000..0607012e --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift @@ -0,0 +1,65 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoFrameBufferInit: BridgedDictionary { + public convenience init(format: VideoPixelFormat, codedWidth: UInt32, codedHeight: UInt32, timestamp: Int64, duration: UInt64, layout: [PlaneLayout], visibleRect: DOMRectInit, displayWidth: UInt32, displayHeight: UInt32, colorSpace: VideoColorSpaceInit) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.format] = format.jsValue + object[Strings.codedWidth] = codedWidth.jsValue + object[Strings.codedHeight] = codedHeight.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.layout] = layout.jsValue + object[Strings.visibleRect] = visibleRect.jsValue + object[Strings.displayWidth] = displayWidth.jsValue + object[Strings.displayHeight] = displayHeight.jsValue + object[Strings.colorSpace] = colorSpace.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _codedWidth = ReadWriteAttribute(jsObject: object, name: Strings.codedWidth) + _codedHeight = ReadWriteAttribute(jsObject: object, name: Strings.codedHeight) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + _visibleRect = ReadWriteAttribute(jsObject: object, name: Strings.visibleRect) + _displayWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayWidth) + _displayHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayHeight) + _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var format: VideoPixelFormat + + @ReadWriteAttribute + public var codedWidth: UInt32 + + @ReadWriteAttribute + public var codedHeight: UInt32 + + @ReadWriteAttribute + public var timestamp: Int64 + + @ReadWriteAttribute + public var duration: UInt64 + + @ReadWriteAttribute + public var layout: [PlaneLayout] + + @ReadWriteAttribute + public var visibleRect: DOMRectInit + + @ReadWriteAttribute + public var displayWidth: UInt32 + + @ReadWriteAttribute + public var displayHeight: UInt32 + + @ReadWriteAttribute + public var colorSpace: VideoColorSpaceInit +} diff --git a/Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift b/Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift new file mode 100644 index 00000000..a86c57dd --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift @@ -0,0 +1,25 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoFrameCopyToOptions: BridgedDictionary { + public convenience init(rect: DOMRectInit, layout: [PlaneLayout]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.rect] = rect.jsValue + object[Strings.layout] = layout.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _rect = ReadWriteAttribute(jsObject: object, name: Strings.rect) + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var rect: DOMRectInit + + @ReadWriteAttribute + public var layout: [PlaneLayout] +} diff --git a/Sources/DOMKit/WebIDL/VideoFrameInit.swift b/Sources/DOMKit/WebIDL/VideoFrameInit.swift new file mode 100644 index 00000000..a70eaea1 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoFrameInit.swift @@ -0,0 +1,45 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class VideoFrameInit: BridgedDictionary { + public convenience init(duration: UInt64, timestamp: Int64, alpha: AlphaOption, visibleRect: DOMRectInit, displayWidth: UInt32, displayHeight: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.duration] = duration.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.alpha] = alpha.jsValue + object[Strings.visibleRect] = visibleRect.jsValue + object[Strings.displayWidth] = displayWidth.jsValue + object[Strings.displayHeight] = displayHeight.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _visibleRect = ReadWriteAttribute(jsObject: object, name: Strings.visibleRect) + _displayWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayWidth) + _displayHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayHeight) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var duration: UInt64 + + @ReadWriteAttribute + public var timestamp: Int64 + + @ReadWriteAttribute + public var alpha: AlphaOption + + @ReadWriteAttribute + public var visibleRect: DOMRectInit + + @ReadWriteAttribute + public var displayWidth: UInt32 + + @ReadWriteAttribute + public var displayHeight: UInt32 +} diff --git a/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift b/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift new file mode 100644 index 00000000..58f11f73 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift @@ -0,0 +1,24 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum VideoMatrixCoefficients: JSString, JSValueCompatible { + case rgb = "rgb" + case bt709 = "bt709" + case bt470bg = "bt470bg" + case smpte170m = "smpte170m" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/VideoPixelFormat.swift b/Sources/DOMKit/WebIDL/VideoPixelFormat.swift new file mode 100644 index 00000000..1c8dea1f --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoPixelFormat.swift @@ -0,0 +1,29 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum VideoPixelFormat: JSString, JSValueCompatible { + case i420 = "I420" + case i420A = "I420A" + case i422 = "I422" + case i444 = "I444" + case nV12 = "NV12" + case rGBA = "RGBA" + case rGBX = "RGBX" + case bGRA = "BGRA" + case bGRX = "BGRX" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift b/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift new file mode 100644 index 00000000..e8407da6 --- /dev/null +++ b/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum VideoTransferCharacteristics: JSString, JSValueCompatible { + case bt709 = "bt709" + case smpte170m = "smpte170m" + case iec6196621 = "iec61966-2-1" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/parse-idl/parse-all.js b/parse-idl/parse-all.js index 36343f70..3a3c1f5e 100644 --- a/parse-idl/parse-all.js +++ b/parse-idl/parse-all.js @@ -25,6 +25,7 @@ console.log( "streams", "mediacapture-streams", "mediastream-recording", + "webcodecs", ].map((key) => parsedFiles[key]), null, 2 From a663185b94e8ebaeaa7a08c6760fcc9dba22eba8 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 2 May 2022 16:11:45 +0100 Subject: [PATCH 4/8] Fix build issue with `BitrateMode` --- Sources/DOMKit/WebIDL/VideoEncoderConfig.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift b/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift index c6fdfd98..c4c3b885 100644 --- a/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift +++ b/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift @@ -4,6 +4,8 @@ import JavaScriptEventLoop import JavaScriptKit public class VideoEncoderConfig: BridgedDictionary { + public typealias BitrateMode = String + public convenience init(codec: String, width: UInt32, height: UInt32, displayWidth: UInt32, displayHeight: UInt32, bitrate: UInt64, framerate: Double, hardwareAcceleration: HardwareAcceleration, alpha: AlphaOption, scalabilityMode: String, bitrateMode: BitrateMode, latencyMode: LatencyMode) { let object = JSObject.global[Strings.Object].function!.new() object[Strings.codec] = codec.jsValue From 6f27a486dd5494a8ddd63e9c3ac5bfa969cfeea4 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 3 May 2022 11:07:39 +0100 Subject: [PATCH 5/8] Resolve merge conflict --- Sources/DOMKit/WebIDL/AlphaOption.swift | 22 ----- Sources/DOMKit/WebIDL/AudioData.swift | 62 ------------- .../WebIDL/AudioDataCopyToOptions.swift | 35 -------- Sources/DOMKit/WebIDL/AudioDataInit.swift | 45 ---------- Sources/DOMKit/WebIDL/AudioDecoder.swift | 70 --------------- .../DOMKit/WebIDL/AudioDecoderConfig.swift | 35 -------- Sources/DOMKit/WebIDL/AudioDecoderInit.swift | 25 ------ .../DOMKit/WebIDL/AudioDecoderSupport.swift | 25 ------ Sources/DOMKit/WebIDL/AudioEncoder.swift | 70 --------------- .../DOMKit/WebIDL/AudioEncoderConfig.swift | 35 -------- Sources/DOMKit/WebIDL/AudioEncoderInit.swift | 25 ------ .../DOMKit/WebIDL/AudioEncoderSupport.swift | 25 ------ Sources/DOMKit/WebIDL/AudioSampleFormat.swift | 28 ------ Sources/DOMKit/WebIDL/CodecState.swift | 23 ----- Sources/DOMKit/WebIDL/EncodedAudioChunk.swift | 39 -------- .../DOMKit/WebIDL/EncodedAudioChunkInit.swift | 35 -------- .../WebIDL/EncodedAudioChunkMetadata.swift | 20 ----- .../DOMKit/WebIDL/EncodedAudioChunkType.swift | 22 ----- Sources/DOMKit/WebIDL/EncodedVideoChunk.swift | 39 -------- .../DOMKit/WebIDL/EncodedVideoChunkInit.swift | 35 -------- .../WebIDL/EncodedVideoChunkMetadata.swift | 30 ------- .../DOMKit/WebIDL/EncodedVideoChunkType.swift | 22 ----- .../DOMKit/WebIDL/HardwareAcceleration.swift | 23 ----- Sources/DOMKit/WebIDL/ImageBufferSource.swift | 46 ---------- .../DOMKit/WebIDL/ImageDecodeOptions.swift | 25 ------ Sources/DOMKit/WebIDL/ImageDecodeResult.swift | 25 ------ Sources/DOMKit/WebIDL/ImageDecoder.swift | 68 -------------- Sources/DOMKit/WebIDL/ImageDecoderInit.swift | 50 ----------- Sources/DOMKit/WebIDL/ImageTrack.swift | 32 ------- Sources/DOMKit/WebIDL/ImageTrackList.swift | 34 ------- Sources/DOMKit/WebIDL/LatencyMode.swift | 22 ----- Sources/DOMKit/WebIDL/PlaneLayout.swift | 25 ------ Sources/DOMKit/WebIDL/SvcOutputMetadata.swift | 20 ----- .../DOMKit/WebIDL/VideoColorPrimaries.swift | 23 ----- Sources/DOMKit/WebIDL/VideoColorSpace.swift | 39 -------- .../DOMKit/WebIDL/VideoColorSpaceInit.swift | 35 -------- Sources/DOMKit/WebIDL/VideoDecoder.swift | 70 --------------- .../DOMKit/WebIDL/VideoDecoderConfig.swift | 60 ------------- Sources/DOMKit/WebIDL/VideoDecoderInit.swift | 25 ------ .../DOMKit/WebIDL/VideoDecoderSupport.swift | 25 ------ Sources/DOMKit/WebIDL/VideoEncoder.swift | 70 --------------- .../DOMKit/WebIDL/VideoEncoderConfig.swift | 77 ---------------- .../WebIDL/VideoEncoderEncodeOptions.swift | 20 ----- Sources/DOMKit/WebIDL/VideoEncoderInit.swift | 25 ------ .../DOMKit/WebIDL/VideoEncoderSupport.swift | 25 ------ Sources/DOMKit/WebIDL/VideoFrame.swift | 89 ------------------- .../DOMKit/WebIDL/VideoFrameBufferInit.swift | 65 -------------- .../WebIDL/VideoFrameCopyToOptions.swift | 25 ------ Sources/DOMKit/WebIDL/VideoFrameInit.swift | 45 ---------- .../WebIDL/VideoMatrixCoefficients.swift | 24 ----- Sources/DOMKit/WebIDL/VideoPixelFormat.swift | 29 ------ .../WebIDL/VideoTransferCharacteristics.swift | 23 ----- 52 files changed, 1931 deletions(-) delete mode 100644 Sources/DOMKit/WebIDL/AlphaOption.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioData.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioDataInit.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioDecoder.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioDecoderConfig.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioDecoderInit.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioDecoderSupport.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioEncoder.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioEncoderConfig.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioEncoderInit.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioEncoderSupport.swift delete mode 100644 Sources/DOMKit/WebIDL/AudioSampleFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/CodecState.swift delete mode 100644 Sources/DOMKit/WebIDL/EncodedAudioChunk.swift delete mode 100644 Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift delete mode 100644 Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift delete mode 100644 Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift delete mode 100644 Sources/DOMKit/WebIDL/EncodedVideoChunk.swift delete mode 100644 Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift delete mode 100644 Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift delete mode 100644 Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift delete mode 100644 Sources/DOMKit/WebIDL/HardwareAcceleration.swift delete mode 100644 Sources/DOMKit/WebIDL/ImageBufferSource.swift delete mode 100644 Sources/DOMKit/WebIDL/ImageDecodeOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/ImageDecodeResult.swift delete mode 100644 Sources/DOMKit/WebIDL/ImageDecoder.swift delete mode 100644 Sources/DOMKit/WebIDL/ImageDecoderInit.swift delete mode 100644 Sources/DOMKit/WebIDL/ImageTrack.swift delete mode 100644 Sources/DOMKit/WebIDL/ImageTrackList.swift delete mode 100644 Sources/DOMKit/WebIDL/LatencyMode.swift delete mode 100644 Sources/DOMKit/WebIDL/PlaneLayout.swift delete mode 100644 Sources/DOMKit/WebIDL/SvcOutputMetadata.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoColorPrimaries.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoColorSpace.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoDecoder.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoDecoderConfig.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoDecoderInit.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoDecoderSupport.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoEncoder.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoEncoderConfig.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoEncoderInit.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoEncoderSupport.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoFrame.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoFrameInit.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoPixelFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift diff --git a/Sources/DOMKit/WebIDL/AlphaOption.swift b/Sources/DOMKit/WebIDL/AlphaOption.swift deleted file mode 100644 index f086fd3a..00000000 --- a/Sources/DOMKit/WebIDL/AlphaOption.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AlphaOption: JSString, JSValueCompatible { - case keep = "keep" - case discard = "discard" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/AudioData.swift b/Sources/DOMKit/WebIDL/AudioData.swift deleted file mode 100644 index a0fc829f..00000000 --- a/Sources/DOMKit/WebIDL/AudioData.swift +++ /dev/null @@ -1,62 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioData: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioData].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _format = ReadonlyAttribute(jsObject: jsObject, name: Strings.format) - _sampleRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleRate) - _numberOfFrames = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfFrames) - _numberOfChannels = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfChannels) - _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) - _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: AudioDataInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) - } - - @ReadonlyAttribute - public var format: AudioSampleFormat? - - @ReadonlyAttribute - public var sampleRate: Float - - @ReadonlyAttribute - public var numberOfFrames: UInt32 - - @ReadonlyAttribute - public var numberOfChannels: UInt32 - - @ReadonlyAttribute - public var duration: UInt64 - - @ReadonlyAttribute - public var timestamp: Int64 - - @inlinable public func allocationSize(options: AudioDataCopyToOptions) -> UInt32 { - let this = jsObject - return this[Strings.allocationSize].function!(this: this, arguments: [options.jsValue]).fromJSValue()! - } - - @inlinable public func copyTo(destination: BufferSource, options: AudioDataCopyToOptions) { - let this = jsObject - _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue, options.jsValue]) - } - - @inlinable public func clone() -> Self { - let this = jsObject - return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift b/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift deleted file mode 100644 index 78daea46..00000000 --- a/Sources/DOMKit/WebIDL/AudioDataCopyToOptions.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioDataCopyToOptions: BridgedDictionary { - public convenience init(planeIndex: UInt32, frameOffset: UInt32, frameCount: UInt32, format: AudioSampleFormat) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.planeIndex] = planeIndex.jsValue - object[Strings.frameOffset] = frameOffset.jsValue - object[Strings.frameCount] = frameCount.jsValue - object[Strings.format] = format.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _planeIndex = ReadWriteAttribute(jsObject: object, name: Strings.planeIndex) - _frameOffset = ReadWriteAttribute(jsObject: object, name: Strings.frameOffset) - _frameCount = ReadWriteAttribute(jsObject: object, name: Strings.frameCount) - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var planeIndex: UInt32 - - @ReadWriteAttribute - public var frameOffset: UInt32 - - @ReadWriteAttribute - public var frameCount: UInt32 - - @ReadWriteAttribute - public var format: AudioSampleFormat -} diff --git a/Sources/DOMKit/WebIDL/AudioDataInit.swift b/Sources/DOMKit/WebIDL/AudioDataInit.swift deleted file mode 100644 index d0395761..00000000 --- a/Sources/DOMKit/WebIDL/AudioDataInit.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioDataInit: BridgedDictionary { - public convenience init(format: AudioSampleFormat, sampleRate: Float, numberOfFrames: UInt32, numberOfChannels: UInt32, timestamp: Int64, data: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.format] = format.jsValue - object[Strings.sampleRate] = sampleRate.jsValue - object[Strings.numberOfFrames] = numberOfFrames.jsValue - object[Strings.numberOfChannels] = numberOfChannels.jsValue - object[Strings.timestamp] = timestamp.jsValue - object[Strings.data] = data.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) - _numberOfFrames = ReadWriteAttribute(jsObject: object, name: Strings.numberOfFrames) - _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var format: AudioSampleFormat - - @ReadWriteAttribute - public var sampleRate: Float - - @ReadWriteAttribute - public var numberOfFrames: UInt32 - - @ReadWriteAttribute - public var numberOfChannels: UInt32 - - @ReadWriteAttribute - public var timestamp: Int64 - - @ReadWriteAttribute - public var data: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/AudioDecoder.swift b/Sources/DOMKit/WebIDL/AudioDecoder.swift deleted file mode 100644 index d511e5ba..00000000 --- a/Sources/DOMKit/WebIDL/AudioDecoder.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioDecoder: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioDecoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _decodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.decodeQueueSize) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: AudioDecoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) - } - - @ReadonlyAttribute - public var state: CodecState - - @ReadonlyAttribute - public var decodeQueueSize: UInt32 - - @inlinable public func configure(config: AudioDecoderConfig) { - let this = jsObject - _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) - } - - @inlinable public func decode(chunk: EncodedAudioChunk) { - let this = jsObject - _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue]) - } - - @inlinable public func flush() -> JSPromise { - let this = jsObject - return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func flush() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func reset() { - let this = jsObject - _ = this[Strings.reset].function!(this: this, arguments: []) - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @inlinable public static func isConfigSupported(config: AudioDecoderConfig) -> JSPromise { - let this = constructor - return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func isConfigSupported(config: AudioDecoderConfig) async throws -> AudioDecoderSupport { - let this = constructor - let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/AudioDecoderConfig.swift b/Sources/DOMKit/WebIDL/AudioDecoderConfig.swift deleted file mode 100644 index 55aa5a27..00000000 --- a/Sources/DOMKit/WebIDL/AudioDecoderConfig.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioDecoderConfig: BridgedDictionary { - public convenience init(codec: String, sampleRate: UInt32, numberOfChannels: UInt32, description: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.codec] = codec.jsValue - object[Strings.sampleRate] = sampleRate.jsValue - object[Strings.numberOfChannels] = numberOfChannels.jsValue - object[Strings.description] = description.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) - _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) - _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) - _description = ReadWriteAttribute(jsObject: object, name: Strings.description) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var codec: String - - @ReadWriteAttribute - public var sampleRate: UInt32 - - @ReadWriteAttribute - public var numberOfChannels: UInt32 - - @ReadWriteAttribute - public var description: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/AudioDecoderInit.swift b/Sources/DOMKit/WebIDL/AudioDecoderInit.swift deleted file mode 100644 index b98e0449..00000000 --- a/Sources/DOMKit/WebIDL/AudioDecoderInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioDecoderInit: BridgedDictionary { - public convenience init(output: @escaping AudioDataOutputCallback, error: @escaping WebCodecsErrorCallback) { - let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute1Void[Strings.output, in: object] = output - ClosureAttribute1Void[Strings.error, in: object] = error - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute1Void(jsObject: object, name: Strings.output) - _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) - super.init(unsafelyWrapping: object) - } - - @ClosureAttribute1Void - public var output: AudioDataOutputCallback - - @ClosureAttribute1Void - public var error: WebCodecsErrorCallback -} diff --git a/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift b/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift deleted file mode 100644 index 8245e0da..00000000 --- a/Sources/DOMKit/WebIDL/AudioDecoderSupport.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioDecoderSupport: BridgedDictionary { - public convenience init(supported: Bool, config: AudioDecoderConfig) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supported] = supported.jsValue - object[Strings.config] = config.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) - _config = ReadWriteAttribute(jsObject: object, name: Strings.config) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var supported: Bool - - @ReadWriteAttribute - public var config: AudioDecoderConfig -} diff --git a/Sources/DOMKit/WebIDL/AudioEncoder.swift b/Sources/DOMKit/WebIDL/AudioEncoder.swift deleted file mode 100644 index 7565bc23..00000000 --- a/Sources/DOMKit/WebIDL/AudioEncoder.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioEncoder: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioEncoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _encodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.encodeQueueSize) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: AudioEncoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) - } - - @ReadonlyAttribute - public var state: CodecState - - @ReadonlyAttribute - public var encodeQueueSize: UInt32 - - @inlinable public func configure(config: AudioEncoderConfig) { - let this = jsObject - _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) - } - - @inlinable public func encode(data: AudioData) { - let this = jsObject - _ = this[Strings.encode].function!(this: this, arguments: [data.jsValue]) - } - - @inlinable public func flush() -> JSPromise { - let this = jsObject - return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func flush() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func reset() { - let this = jsObject - _ = this[Strings.reset].function!(this: this, arguments: []) - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @inlinable public static func isConfigSupported(config: AudioEncoderConfig) -> JSPromise { - let this = constructor - return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func isConfigSupported(config: AudioEncoderConfig) async throws -> AudioEncoderSupport { - let this = constructor - let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/AudioEncoderConfig.swift b/Sources/DOMKit/WebIDL/AudioEncoderConfig.swift deleted file mode 100644 index 0d8f8acf..00000000 --- a/Sources/DOMKit/WebIDL/AudioEncoderConfig.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioEncoderConfig: BridgedDictionary { - public convenience init(codec: String, sampleRate: UInt32, numberOfChannels: UInt32, bitrate: UInt64) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.codec] = codec.jsValue - object[Strings.sampleRate] = sampleRate.jsValue - object[Strings.numberOfChannels] = numberOfChannels.jsValue - object[Strings.bitrate] = bitrate.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) - _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) - _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) - _bitrate = ReadWriteAttribute(jsObject: object, name: Strings.bitrate) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var codec: String - - @ReadWriteAttribute - public var sampleRate: UInt32 - - @ReadWriteAttribute - public var numberOfChannels: UInt32 - - @ReadWriteAttribute - public var bitrate: UInt64 -} diff --git a/Sources/DOMKit/WebIDL/AudioEncoderInit.swift b/Sources/DOMKit/WebIDL/AudioEncoderInit.swift deleted file mode 100644 index 550e8415..00000000 --- a/Sources/DOMKit/WebIDL/AudioEncoderInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioEncoderInit: BridgedDictionary { - public convenience init(output: @escaping EncodedAudioChunkOutputCallback, error: @escaping WebCodecsErrorCallback) { - let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute2Void[Strings.output, in: object] = output - ClosureAttribute1Void[Strings.error, in: object] = error - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute2Void(jsObject: object, name: Strings.output) - _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) - super.init(unsafelyWrapping: object) - } - - @ClosureAttribute2Void - public var output: EncodedAudioChunkOutputCallback - - @ClosureAttribute1Void - public var error: WebCodecsErrorCallback -} diff --git a/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift b/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift deleted file mode 100644 index bed3a52b..00000000 --- a/Sources/DOMKit/WebIDL/AudioEncoderSupport.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class AudioEncoderSupport: BridgedDictionary { - public convenience init(supported: Bool, config: AudioEncoderConfig) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supported] = supported.jsValue - object[Strings.config] = config.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) - _config = ReadWriteAttribute(jsObject: object, name: Strings.config) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var supported: Bool - - @ReadWriteAttribute - public var config: AudioEncoderConfig -} diff --git a/Sources/DOMKit/WebIDL/AudioSampleFormat.swift b/Sources/DOMKit/WebIDL/AudioSampleFormat.swift deleted file mode 100644 index a629b0a5..00000000 --- a/Sources/DOMKit/WebIDL/AudioSampleFormat.swift +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum AudioSampleFormat: JSString, JSValueCompatible { - case u8 = "u8" - case s16 = "s16" - case s32 = "s32" - case f32 = "f32" - case u8Planar = "u8-planar" - case s16Planar = "s16-planar" - case s32Planar = "s32-planar" - case f32Planar = "f32-planar" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/CodecState.swift b/Sources/DOMKit/WebIDL/CodecState.swift deleted file mode 100644 index 3495763f..00000000 --- a/Sources/DOMKit/WebIDL/CodecState.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum CodecState: JSString, JSValueCompatible { - case unconfigured = "unconfigured" - case configured = "configured" - case closed = "closed" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift deleted file mode 100644 index 010e2b06..00000000 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunk.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EncodedAudioChunk: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EncodedAudioChunk].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) - _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) - _byteLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.byteLength) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: EncodedAudioChunkInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) - } - - @ReadonlyAttribute - public var type: EncodedAudioChunkType - - @ReadonlyAttribute - public var timestamp: Int64 - - @ReadonlyAttribute - public var duration: UInt64? - - @ReadonlyAttribute - public var byteLength: UInt32 - - @inlinable public func copyTo(destination: BufferSource) { - let this = jsObject - _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift deleted file mode 100644 index 054201f8..00000000 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunkInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EncodedAudioChunkInit: BridgedDictionary { - public convenience init(type: EncodedAudioChunkType, timestamp: Int64, duration: UInt64, data: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.timestamp] = timestamp.jsValue - object[Strings.duration] = duration.jsValue - object[Strings.data] = data.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: EncodedAudioChunkType - - @ReadWriteAttribute - public var timestamp: Int64 - - @ReadWriteAttribute - public var duration: UInt64 - - @ReadWriteAttribute - public var data: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift deleted file mode 100644 index 6f5f8314..00000000 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunkMetadata.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EncodedAudioChunkMetadata: BridgedDictionary { - public convenience init(decoderConfig: AudioDecoderConfig) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.decoderConfig] = decoderConfig.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _decoderConfig = ReadWriteAttribute(jsObject: object, name: Strings.decoderConfig) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var decoderConfig: AudioDecoderConfig -} diff --git a/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift b/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift deleted file mode 100644 index 9c35362e..00000000 --- a/Sources/DOMKit/WebIDL/EncodedAudioChunkType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum EncodedAudioChunkType: JSString, JSValueCompatible { - case key = "key" - case delta = "delta" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift deleted file mode 100644 index 1da80666..00000000 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunk.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EncodedVideoChunk: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EncodedVideoChunk].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) - _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) - _byteLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.byteLength) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: EncodedVideoChunkInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) - } - - @ReadonlyAttribute - public var type: EncodedVideoChunkType - - @ReadonlyAttribute - public var timestamp: Int64 - - @ReadonlyAttribute - public var duration: UInt64? - - @ReadonlyAttribute - public var byteLength: UInt32 - - @inlinable public func copyTo(destination: BufferSource) { - let this = jsObject - _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift deleted file mode 100644 index 0c95c51f..00000000 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunkInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EncodedVideoChunkInit: BridgedDictionary { - public convenience init(type: EncodedVideoChunkType, timestamp: Int64, duration: UInt64, data: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.timestamp] = timestamp.jsValue - object[Strings.duration] = duration.jsValue - object[Strings.data] = data.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: EncodedVideoChunkType - - @ReadWriteAttribute - public var timestamp: Int64 - - @ReadWriteAttribute - public var duration: UInt64 - - @ReadWriteAttribute - public var data: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift deleted file mode 100644 index 6b3572e9..00000000 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunkMetadata.swift +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class EncodedVideoChunkMetadata: BridgedDictionary { - public convenience init(decoderConfig: VideoDecoderConfig, svc: SvcOutputMetadata, alphaSideData: BufferSource) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.decoderConfig] = decoderConfig.jsValue - object[Strings.svc] = svc.jsValue - object[Strings.alphaSideData] = alphaSideData.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _decoderConfig = ReadWriteAttribute(jsObject: object, name: Strings.decoderConfig) - _svc = ReadWriteAttribute(jsObject: object, name: Strings.svc) - _alphaSideData = ReadWriteAttribute(jsObject: object, name: Strings.alphaSideData) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var decoderConfig: VideoDecoderConfig - - @ReadWriteAttribute - public var svc: SvcOutputMetadata - - @ReadWriteAttribute - public var alphaSideData: BufferSource -} diff --git a/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift b/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift deleted file mode 100644 index f59b9723..00000000 --- a/Sources/DOMKit/WebIDL/EncodedVideoChunkType.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum EncodedVideoChunkType: JSString, JSValueCompatible { - case key = "key" - case delta = "delta" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/HardwareAcceleration.swift b/Sources/DOMKit/WebIDL/HardwareAcceleration.swift deleted file mode 100644 index 9adb76b1..00000000 --- a/Sources/DOMKit/WebIDL/HardwareAcceleration.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum HardwareAcceleration: JSString, JSValueCompatible { - case noPreference = "no-preference" - case preferHardware = "prefer-hardware" - case preferSoftware = "prefer-software" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/ImageBufferSource.swift b/Sources/DOMKit/WebIDL/ImageBufferSource.swift deleted file mode 100644 index 0aa23282..00000000 --- a/Sources/DOMKit/WebIDL/ImageBufferSource.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_ImageBufferSource: ConvertibleToJSValue {} -extension BufferSource: Any_ImageBufferSource {} -extension ReadableStream: Any_ImageBufferSource {} - -public enum ImageBufferSource: JSValueCompatible, Any_ImageBufferSource { - case bufferSource(BufferSource) - case readableStream(ReadableStream) - - var bufferSource: BufferSource? { - switch self { - case let .bufferSource(bufferSource): return bufferSource - default: return nil - } - } - - var readableStream: ReadableStream? { - switch self { - case let .readableStream(readableStream): return readableStream - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let bufferSource: BufferSource = value.fromJSValue() { - return .bufferSource(bufferSource) - } - if let readableStream: ReadableStream = value.fromJSValue() { - return .readableStream(readableStream) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .bufferSource(bufferSource): - return bufferSource.jsValue - case let .readableStream(readableStream): - return readableStream.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift b/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift deleted file mode 100644 index 89806708..00000000 --- a/Sources/DOMKit/WebIDL/ImageDecodeOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ImageDecodeOptions: BridgedDictionary { - public convenience init(frameIndex: UInt32, completeFramesOnly: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.frameIndex] = frameIndex.jsValue - object[Strings.completeFramesOnly] = completeFramesOnly.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _frameIndex = ReadWriteAttribute(jsObject: object, name: Strings.frameIndex) - _completeFramesOnly = ReadWriteAttribute(jsObject: object, name: Strings.completeFramesOnly) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var frameIndex: UInt32 - - @ReadWriteAttribute - public var completeFramesOnly: Bool -} diff --git a/Sources/DOMKit/WebIDL/ImageDecodeResult.swift b/Sources/DOMKit/WebIDL/ImageDecodeResult.swift deleted file mode 100644 index 1a4cb939..00000000 --- a/Sources/DOMKit/WebIDL/ImageDecodeResult.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ImageDecodeResult: BridgedDictionary { - public convenience init(image: VideoFrame, complete: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.image] = image.jsValue - object[Strings.complete] = complete.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _image = ReadWriteAttribute(jsObject: object, name: Strings.image) - _complete = ReadWriteAttribute(jsObject: object, name: Strings.complete) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var image: VideoFrame - - @ReadWriteAttribute - public var complete: Bool -} diff --git a/Sources/DOMKit/WebIDL/ImageDecoder.swift b/Sources/DOMKit/WebIDL/ImageDecoder.swift deleted file mode 100644 index 6112d940..00000000 --- a/Sources/DOMKit/WebIDL/ImageDecoder.swift +++ /dev/null @@ -1,68 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ImageDecoder: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageDecoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _complete = ReadonlyAttribute(jsObject: jsObject, name: Strings.complete) - _completed = ReadonlyAttribute(jsObject: jsObject, name: Strings.completed) - _tracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.tracks) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: ImageDecoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) - } - - @ReadonlyAttribute - public var type: String - - @ReadonlyAttribute - public var complete: Bool - - @ReadonlyAttribute - public var completed: JSPromise - - @ReadonlyAttribute - public var tracks: ImageTrackList - - @inlinable public func decode(options: ImageDecodeOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.decode].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func decode(options: ImageDecodeOptions? = nil) async throws -> ImageDecodeResult { - let this = jsObject - let _promise: JSPromise = this[Strings.decode].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func reset() { - let this = jsObject - _ = this[Strings.reset].function!(this: this, arguments: []) - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @inlinable public static func isTypeSupported(type: String) -> JSPromise { - let this = constructor - return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func isTypeSupported(type: String) async throws -> Bool { - let this = constructor - let _promise: JSPromise = this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/ImageDecoderInit.swift b/Sources/DOMKit/WebIDL/ImageDecoderInit.swift deleted file mode 100644 index 06179973..00000000 --- a/Sources/DOMKit/WebIDL/ImageDecoderInit.swift +++ /dev/null @@ -1,50 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ImageDecoderInit: BridgedDictionary { - public convenience init(type: String, data: ImageBufferSource, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, desiredWidth: UInt32, desiredHeight: UInt32, preferAnimation: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.data] = data.jsValue - object[Strings.premultiplyAlpha] = premultiplyAlpha.jsValue - object[Strings.colorSpaceConversion] = colorSpaceConversion.jsValue - object[Strings.desiredWidth] = desiredWidth.jsValue - object[Strings.desiredHeight] = desiredHeight.jsValue - object[Strings.preferAnimation] = preferAnimation.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - _premultiplyAlpha = ReadWriteAttribute(jsObject: object, name: Strings.premultiplyAlpha) - _colorSpaceConversion = ReadWriteAttribute(jsObject: object, name: Strings.colorSpaceConversion) - _desiredWidth = ReadWriteAttribute(jsObject: object, name: Strings.desiredWidth) - _desiredHeight = ReadWriteAttribute(jsObject: object, name: Strings.desiredHeight) - _preferAnimation = ReadWriteAttribute(jsObject: object, name: Strings.preferAnimation) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var type: String - - @ReadWriteAttribute - public var data: ImageBufferSource - - @ReadWriteAttribute - public var premultiplyAlpha: PremultiplyAlpha - - @ReadWriteAttribute - public var colorSpaceConversion: ColorSpaceConversion - - @ReadWriteAttribute - public var desiredWidth: UInt32 - - @ReadWriteAttribute - public var desiredHeight: UInt32 - - @ReadWriteAttribute - public var preferAnimation: Bool -} diff --git a/Sources/DOMKit/WebIDL/ImageTrack.swift b/Sources/DOMKit/WebIDL/ImageTrack.swift deleted file mode 100644 index b68c7a97..00000000 --- a/Sources/DOMKit/WebIDL/ImageTrack.swift +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ImageTrack: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ImageTrack].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _animated = ReadonlyAttribute(jsObject: jsObject, name: Strings.animated) - _frameCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameCount) - _repetitionCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.repetitionCount) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - _selected = ReadWriteAttribute(jsObject: jsObject, name: Strings.selected) - super.init(unsafelyWrapping: jsObject) - } - - @ReadonlyAttribute - public var animated: Bool - - @ReadonlyAttribute - public var frameCount: UInt32 - - @ReadonlyAttribute - public var repetitionCount: Float - - @ClosureAttribute1Optional - public var onchange: EventHandler - - @ReadWriteAttribute - public var selected: Bool -} diff --git a/Sources/DOMKit/WebIDL/ImageTrackList.swift b/Sources/DOMKit/WebIDL/ImageTrackList.swift deleted file mode 100644 index 10b44925..00000000 --- a/Sources/DOMKit/WebIDL/ImageTrackList.swift +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class ImageTrackList: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageTrackList].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedIndex) - _selectedTrack = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedTrack) - self.jsObject = jsObject - } - - @inlinable public subscript(key: Int) -> ImageTrack { - jsObject[key].fromJSValue()! - } - - @ReadonlyAttribute - public var ready: JSPromise - - @ReadonlyAttribute - public var length: UInt32 - - @ReadonlyAttribute - public var selectedIndex: Int32 - - @ReadonlyAttribute - public var selectedTrack: ImageTrack? -} diff --git a/Sources/DOMKit/WebIDL/LatencyMode.swift b/Sources/DOMKit/WebIDL/LatencyMode.swift deleted file mode 100644 index d4aa61af..00000000 --- a/Sources/DOMKit/WebIDL/LatencyMode.swift +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum LatencyMode: JSString, JSValueCompatible { - case quality = "quality" - case realtime = "realtime" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/PlaneLayout.swift b/Sources/DOMKit/WebIDL/PlaneLayout.swift deleted file mode 100644 index a4de400e..00000000 --- a/Sources/DOMKit/WebIDL/PlaneLayout.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class PlaneLayout: BridgedDictionary { - public convenience init(offset: UInt32, stride: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.offset] = offset.jsValue - object[Strings.stride] = stride.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) - _stride = ReadWriteAttribute(jsObject: object, name: Strings.stride) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var offset: UInt32 - - @ReadWriteAttribute - public var stride: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift b/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift deleted file mode 100644 index 2487040f..00000000 --- a/Sources/DOMKit/WebIDL/SvcOutputMetadata.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class SvcOutputMetadata: BridgedDictionary { - public convenience init(temporalLayerId: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.temporalLayerId] = temporalLayerId.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _temporalLayerId = ReadWriteAttribute(jsObject: object, name: Strings.temporalLayerId) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var temporalLayerId: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift b/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift deleted file mode 100644 index 364fa134..00000000 --- a/Sources/DOMKit/WebIDL/VideoColorPrimaries.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum VideoColorPrimaries: JSString, JSValueCompatible { - case bt709 = "bt709" - case bt470bg = "bt470bg" - case smpte170m = "smpte170m" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/VideoColorSpace.swift b/Sources/DOMKit/WebIDL/VideoColorSpace.swift deleted file mode 100644 index 25b08860..00000000 --- a/Sources/DOMKit/WebIDL/VideoColorSpace.swift +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoColorSpace: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoColorSpace].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _primaries = ReadonlyAttribute(jsObject: jsObject, name: Strings.primaries) - _transfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.transfer) - _matrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.matrix) - _fullRange = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullRange) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: VideoColorSpaceInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var primaries: VideoColorPrimaries? - - @ReadonlyAttribute - public var transfer: VideoTransferCharacteristics? - - @ReadonlyAttribute - public var matrix: VideoMatrixCoefficients? - - @ReadonlyAttribute - public var fullRange: Bool? - - @inlinable public func toJSON() -> VideoColorSpaceInit { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift b/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift deleted file mode 100644 index 786cfccc..00000000 --- a/Sources/DOMKit/WebIDL/VideoColorSpaceInit.swift +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoColorSpaceInit: BridgedDictionary { - public convenience init(primaries: VideoColorPrimaries, transfer: VideoTransferCharacteristics, matrix: VideoMatrixCoefficients, fullRange: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.primaries] = primaries.jsValue - object[Strings.transfer] = transfer.jsValue - object[Strings.matrix] = matrix.jsValue - object[Strings.fullRange] = fullRange.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _primaries = ReadWriteAttribute(jsObject: object, name: Strings.primaries) - _transfer = ReadWriteAttribute(jsObject: object, name: Strings.transfer) - _matrix = ReadWriteAttribute(jsObject: object, name: Strings.matrix) - _fullRange = ReadWriteAttribute(jsObject: object, name: Strings.fullRange) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var primaries: VideoColorPrimaries - - @ReadWriteAttribute - public var transfer: VideoTransferCharacteristics - - @ReadWriteAttribute - public var matrix: VideoMatrixCoefficients - - @ReadWriteAttribute - public var fullRange: Bool -} diff --git a/Sources/DOMKit/WebIDL/VideoDecoder.swift b/Sources/DOMKit/WebIDL/VideoDecoder.swift deleted file mode 100644 index 8f8900c2..00000000 --- a/Sources/DOMKit/WebIDL/VideoDecoder.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoDecoder: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoDecoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _decodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.decodeQueueSize) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: VideoDecoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) - } - - @ReadonlyAttribute - public var state: CodecState - - @ReadonlyAttribute - public var decodeQueueSize: UInt32 - - @inlinable public func configure(config: VideoDecoderConfig) { - let this = jsObject - _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) - } - - @inlinable public func decode(chunk: EncodedVideoChunk) { - let this = jsObject - _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue]) - } - - @inlinable public func flush() -> JSPromise { - let this = jsObject - return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func flush() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func reset() { - let this = jsObject - _ = this[Strings.reset].function!(this: this, arguments: []) - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @inlinable public static func isConfigSupported(config: VideoDecoderConfig) -> JSPromise { - let this = constructor - return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func isConfigSupported(config: VideoDecoderConfig) async throws -> VideoDecoderSupport { - let this = constructor - let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/VideoDecoderConfig.swift b/Sources/DOMKit/WebIDL/VideoDecoderConfig.swift deleted file mode 100644 index 3e431877..00000000 --- a/Sources/DOMKit/WebIDL/VideoDecoderConfig.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoDecoderConfig: BridgedDictionary { - public convenience init(codec: String, description: BufferSource, codedWidth: UInt32, codedHeight: UInt32, displayAspectWidth: UInt32, displayAspectHeight: UInt32, colorSpace: VideoColorSpaceInit, hardwareAcceleration: HardwareAcceleration, optimizeForLatency: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.codec] = codec.jsValue - object[Strings.description] = description.jsValue - object[Strings.codedWidth] = codedWidth.jsValue - object[Strings.codedHeight] = codedHeight.jsValue - object[Strings.displayAspectWidth] = displayAspectWidth.jsValue - object[Strings.displayAspectHeight] = displayAspectHeight.jsValue - object[Strings.colorSpace] = colorSpace.jsValue - object[Strings.hardwareAcceleration] = hardwareAcceleration.jsValue - object[Strings.optimizeForLatency] = optimizeForLatency.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) - _description = ReadWriteAttribute(jsObject: object, name: Strings.description) - _codedWidth = ReadWriteAttribute(jsObject: object, name: Strings.codedWidth) - _codedHeight = ReadWriteAttribute(jsObject: object, name: Strings.codedHeight) - _displayAspectWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayAspectWidth) - _displayAspectHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayAspectHeight) - _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) - _hardwareAcceleration = ReadWriteAttribute(jsObject: object, name: Strings.hardwareAcceleration) - _optimizeForLatency = ReadWriteAttribute(jsObject: object, name: Strings.optimizeForLatency) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var codec: String - - @ReadWriteAttribute - public var description: BufferSource - - @ReadWriteAttribute - public var codedWidth: UInt32 - - @ReadWriteAttribute - public var codedHeight: UInt32 - - @ReadWriteAttribute - public var displayAspectWidth: UInt32 - - @ReadWriteAttribute - public var displayAspectHeight: UInt32 - - @ReadWriteAttribute - public var colorSpace: VideoColorSpaceInit - - @ReadWriteAttribute - public var hardwareAcceleration: HardwareAcceleration - - @ReadWriteAttribute - public var optimizeForLatency: Bool -} diff --git a/Sources/DOMKit/WebIDL/VideoDecoderInit.swift b/Sources/DOMKit/WebIDL/VideoDecoderInit.swift deleted file mode 100644 index 0614f47e..00000000 --- a/Sources/DOMKit/WebIDL/VideoDecoderInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoDecoderInit: BridgedDictionary { - public convenience init(output: @escaping VideoFrameOutputCallback, error: @escaping WebCodecsErrorCallback) { - let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute1Void[Strings.output, in: object] = output - ClosureAttribute1Void[Strings.error, in: object] = error - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute1Void(jsObject: object, name: Strings.output) - _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) - super.init(unsafelyWrapping: object) - } - - @ClosureAttribute1Void - public var output: VideoFrameOutputCallback - - @ClosureAttribute1Void - public var error: WebCodecsErrorCallback -} diff --git a/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift b/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift deleted file mode 100644 index 4d41da3d..00000000 --- a/Sources/DOMKit/WebIDL/VideoDecoderSupport.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoDecoderSupport: BridgedDictionary { - public convenience init(supported: Bool, config: VideoDecoderConfig) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supported] = supported.jsValue - object[Strings.config] = config.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) - _config = ReadWriteAttribute(jsObject: object, name: Strings.config) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var supported: Bool - - @ReadWriteAttribute - public var config: VideoDecoderConfig -} diff --git a/Sources/DOMKit/WebIDL/VideoEncoder.swift b/Sources/DOMKit/WebIDL/VideoEncoder.swift deleted file mode 100644 index 2349c057..00000000 --- a/Sources/DOMKit/WebIDL/VideoEncoder.swift +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoEncoder: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoEncoder].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) - _encodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.encodeQueueSize) - self.jsObject = jsObject - } - - @inlinable public convenience init(init: VideoEncoderInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) - } - - @ReadonlyAttribute - public var state: CodecState - - @ReadonlyAttribute - public var encodeQueueSize: UInt32 - - @inlinable public func configure(config: VideoEncoderConfig) { - let this = jsObject - _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) - } - - @inlinable public func encode(frame: VideoFrame, options: VideoEncoderEncodeOptions? = nil) { - let this = jsObject - _ = this[Strings.encode].function!(this: this, arguments: [frame.jsValue, options?.jsValue ?? .undefined]) - } - - @inlinable public func flush() -> JSPromise { - let this = jsObject - return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func flush() async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! - _ = try await _promise.value - } - - @inlinable public func reset() { - let this = jsObject - _ = this[Strings.reset].function!(this: this, arguments: []) - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } - - @inlinable public static func isConfigSupported(config: VideoEncoderConfig) -> JSPromise { - let this = constructor - return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public static func isConfigSupported(config: VideoEncoderConfig) async throws -> VideoEncoderSupport { - let this = constructor - let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } -} diff --git a/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift b/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift deleted file mode 100644 index c4c3b885..00000000 --- a/Sources/DOMKit/WebIDL/VideoEncoderConfig.swift +++ /dev/null @@ -1,77 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoEncoderConfig: BridgedDictionary { - public typealias BitrateMode = String - - public convenience init(codec: String, width: UInt32, height: UInt32, displayWidth: UInt32, displayHeight: UInt32, bitrate: UInt64, framerate: Double, hardwareAcceleration: HardwareAcceleration, alpha: AlphaOption, scalabilityMode: String, bitrateMode: BitrateMode, latencyMode: LatencyMode) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.codec] = codec.jsValue - object[Strings.width] = width.jsValue - object[Strings.height] = height.jsValue - object[Strings.displayWidth] = displayWidth.jsValue - object[Strings.displayHeight] = displayHeight.jsValue - object[Strings.bitrate] = bitrate.jsValue - object[Strings.framerate] = framerate.jsValue - object[Strings.hardwareAcceleration] = hardwareAcceleration.jsValue - object[Strings.alpha] = alpha.jsValue - object[Strings.scalabilityMode] = scalabilityMode.jsValue - object[Strings.bitrateMode] = bitrateMode.jsValue - object[Strings.latencyMode] = latencyMode.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) - _width = ReadWriteAttribute(jsObject: object, name: Strings.width) - _height = ReadWriteAttribute(jsObject: object, name: Strings.height) - _displayWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayWidth) - _displayHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayHeight) - _bitrate = ReadWriteAttribute(jsObject: object, name: Strings.bitrate) - _framerate = ReadWriteAttribute(jsObject: object, name: Strings.framerate) - _hardwareAcceleration = ReadWriteAttribute(jsObject: object, name: Strings.hardwareAcceleration) - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) - _bitrateMode = ReadWriteAttribute(jsObject: object, name: Strings.bitrateMode) - _latencyMode = ReadWriteAttribute(jsObject: object, name: Strings.latencyMode) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var codec: String - - @ReadWriteAttribute - public var width: UInt32 - - @ReadWriteAttribute - public var height: UInt32 - - @ReadWriteAttribute - public var displayWidth: UInt32 - - @ReadWriteAttribute - public var displayHeight: UInt32 - - @ReadWriteAttribute - public var bitrate: UInt64 - - @ReadWriteAttribute - public var framerate: Double - - @ReadWriteAttribute - public var hardwareAcceleration: HardwareAcceleration - - @ReadWriteAttribute - public var alpha: AlphaOption - - @ReadWriteAttribute - public var scalabilityMode: String - - @ReadWriteAttribute - public var bitrateMode: BitrateMode - - @ReadWriteAttribute - public var latencyMode: LatencyMode -} diff --git a/Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift b/Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift deleted file mode 100644 index 583d307c..00000000 --- a/Sources/DOMKit/WebIDL/VideoEncoderEncodeOptions.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoEncoderEncodeOptions: BridgedDictionary { - public convenience init(keyFrame: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.keyFrame] = keyFrame.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _keyFrame = ReadWriteAttribute(jsObject: object, name: Strings.keyFrame) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var keyFrame: Bool -} diff --git a/Sources/DOMKit/WebIDL/VideoEncoderInit.swift b/Sources/DOMKit/WebIDL/VideoEncoderInit.swift deleted file mode 100644 index f9859e1b..00000000 --- a/Sources/DOMKit/WebIDL/VideoEncoderInit.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoEncoderInit: BridgedDictionary { - public convenience init(output: @escaping EncodedVideoChunkOutputCallback, error: @escaping WebCodecsErrorCallback) { - let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute2Void[Strings.output, in: object] = output - ClosureAttribute1Void[Strings.error, in: object] = error - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _output = ClosureAttribute2Void(jsObject: object, name: Strings.output) - _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) - super.init(unsafelyWrapping: object) - } - - @ClosureAttribute2Void - public var output: EncodedVideoChunkOutputCallback - - @ClosureAttribute1Void - public var error: WebCodecsErrorCallback -} diff --git a/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift b/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift deleted file mode 100644 index f6419290..00000000 --- a/Sources/DOMKit/WebIDL/VideoEncoderSupport.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoEncoderSupport: BridgedDictionary { - public convenience init(supported: Bool, config: VideoEncoderConfig) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.supported] = supported.jsValue - object[Strings.config] = config.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) - _config = ReadWriteAttribute(jsObject: object, name: Strings.config) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var supported: Bool - - @ReadWriteAttribute - public var config: VideoEncoderConfig -} diff --git a/Sources/DOMKit/WebIDL/VideoFrame.swift b/Sources/DOMKit/WebIDL/VideoFrame.swift deleted file mode 100644 index 9743b3fc..00000000 --- a/Sources/DOMKit/WebIDL/VideoFrame.swift +++ /dev/null @@ -1,89 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoFrame: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoFrame].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _format = ReadonlyAttribute(jsObject: jsObject, name: Strings.format) - _codedWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.codedWidth) - _codedHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.codedHeight) - _codedRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.codedRect) - _visibleRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibleRect) - _displayWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.displayWidth) - _displayHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.displayHeight) - _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) - _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) - _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorSpace) - self.jsObject = jsObject - } - - @inlinable public convenience init(image: CanvasImageSource, init: VideoFrameInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [image.jsValue, `init`?.jsValue ?? .undefined])) - } - - @inlinable public convenience init(data: BufferSource, init: VideoFrameBufferInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue, `init`.jsValue])) - } - - @ReadonlyAttribute - public var format: VideoPixelFormat? - - @ReadonlyAttribute - public var codedWidth: UInt32 - - @ReadonlyAttribute - public var codedHeight: UInt32 - - @ReadonlyAttribute - public var codedRect: DOMRectReadOnly? - - @ReadonlyAttribute - public var visibleRect: DOMRectReadOnly? - - @ReadonlyAttribute - public var displayWidth: UInt32 - - @ReadonlyAttribute - public var displayHeight: UInt32 - - @ReadonlyAttribute - public var duration: UInt64? - - @ReadonlyAttribute - public var timestamp: Int64? - - @ReadonlyAttribute - public var colorSpace: VideoColorSpace - - @inlinable public func allocationSize(options: VideoFrameCopyToOptions? = nil) -> UInt32 { - let this = jsObject - return this[Strings.allocationSize].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! - } - - @inlinable public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) async throws -> [PlaneLayout] { - let this = jsObject - let _promise: JSPromise = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func clone() -> Self { - let this = jsObject - return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) - } -} diff --git a/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift b/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift deleted file mode 100644 index 0607012e..00000000 --- a/Sources/DOMKit/WebIDL/VideoFrameBufferInit.swift +++ /dev/null @@ -1,65 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoFrameBufferInit: BridgedDictionary { - public convenience init(format: VideoPixelFormat, codedWidth: UInt32, codedHeight: UInt32, timestamp: Int64, duration: UInt64, layout: [PlaneLayout], visibleRect: DOMRectInit, displayWidth: UInt32, displayHeight: UInt32, colorSpace: VideoColorSpaceInit) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.format] = format.jsValue - object[Strings.codedWidth] = codedWidth.jsValue - object[Strings.codedHeight] = codedHeight.jsValue - object[Strings.timestamp] = timestamp.jsValue - object[Strings.duration] = duration.jsValue - object[Strings.layout] = layout.jsValue - object[Strings.visibleRect] = visibleRect.jsValue - object[Strings.displayWidth] = displayWidth.jsValue - object[Strings.displayHeight] = displayHeight.jsValue - object[Strings.colorSpace] = colorSpace.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _format = ReadWriteAttribute(jsObject: object, name: Strings.format) - _codedWidth = ReadWriteAttribute(jsObject: object, name: Strings.codedWidth) - _codedHeight = ReadWriteAttribute(jsObject: object, name: Strings.codedHeight) - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - _visibleRect = ReadWriteAttribute(jsObject: object, name: Strings.visibleRect) - _displayWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayWidth) - _displayHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayHeight) - _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var format: VideoPixelFormat - - @ReadWriteAttribute - public var codedWidth: UInt32 - - @ReadWriteAttribute - public var codedHeight: UInt32 - - @ReadWriteAttribute - public var timestamp: Int64 - - @ReadWriteAttribute - public var duration: UInt64 - - @ReadWriteAttribute - public var layout: [PlaneLayout] - - @ReadWriteAttribute - public var visibleRect: DOMRectInit - - @ReadWriteAttribute - public var displayWidth: UInt32 - - @ReadWriteAttribute - public var displayHeight: UInt32 - - @ReadWriteAttribute - public var colorSpace: VideoColorSpaceInit -} diff --git a/Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift b/Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift deleted file mode 100644 index a86c57dd..00000000 --- a/Sources/DOMKit/WebIDL/VideoFrameCopyToOptions.swift +++ /dev/null @@ -1,25 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoFrameCopyToOptions: BridgedDictionary { - public convenience init(rect: DOMRectInit, layout: [PlaneLayout]) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.rect] = rect.jsValue - object[Strings.layout] = layout.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _rect = ReadWriteAttribute(jsObject: object, name: Strings.rect) - _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var rect: DOMRectInit - - @ReadWriteAttribute - public var layout: [PlaneLayout] -} diff --git a/Sources/DOMKit/WebIDL/VideoFrameInit.swift b/Sources/DOMKit/WebIDL/VideoFrameInit.swift deleted file mode 100644 index a70eaea1..00000000 --- a/Sources/DOMKit/WebIDL/VideoFrameInit.swift +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class VideoFrameInit: BridgedDictionary { - public convenience init(duration: UInt64, timestamp: Int64, alpha: AlphaOption, visibleRect: DOMRectInit, displayWidth: UInt32, displayHeight: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.duration] = duration.jsValue - object[Strings.timestamp] = timestamp.jsValue - object[Strings.alpha] = alpha.jsValue - object[Strings.visibleRect] = visibleRect.jsValue - object[Strings.displayWidth] = displayWidth.jsValue - object[Strings.displayHeight] = displayHeight.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) - _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - _visibleRect = ReadWriteAttribute(jsObject: object, name: Strings.visibleRect) - _displayWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayWidth) - _displayHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayHeight) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var duration: UInt64 - - @ReadWriteAttribute - public var timestamp: Int64 - - @ReadWriteAttribute - public var alpha: AlphaOption - - @ReadWriteAttribute - public var visibleRect: DOMRectInit - - @ReadWriteAttribute - public var displayWidth: UInt32 - - @ReadWriteAttribute - public var displayHeight: UInt32 -} diff --git a/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift b/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift deleted file mode 100644 index 58f11f73..00000000 --- a/Sources/DOMKit/WebIDL/VideoMatrixCoefficients.swift +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum VideoMatrixCoefficients: JSString, JSValueCompatible { - case rgb = "rgb" - case bt709 = "bt709" - case bt470bg = "bt470bg" - case smpte170m = "smpte170m" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/VideoPixelFormat.swift b/Sources/DOMKit/WebIDL/VideoPixelFormat.swift deleted file mode 100644 index 1c8dea1f..00000000 --- a/Sources/DOMKit/WebIDL/VideoPixelFormat.swift +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum VideoPixelFormat: JSString, JSValueCompatible { - case i420 = "I420" - case i420A = "I420A" - case i422 = "I422" - case i444 = "I444" - case nV12 = "NV12" - case rGBA = "RGBA" - case rGBX = "RGBX" - case bGRA = "BGRA" - case bGRX = "BGRX" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift b/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift deleted file mode 100644 index e8407da6..00000000 --- a/Sources/DOMKit/WebIDL/VideoTransferCharacteristics.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum VideoTransferCharacteristics: JSString, JSValueCompatible { - case bt709 = "bt709" - case smpte170m = "smpte170m" - case iec6196621 = "iec61966-2-1" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} From 60c66438c7dca5527d3d3e009bddd6af7379cf49 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 3 May 2022 11:09:30 +0100 Subject: [PATCH 6/8] Fix merge conflict --- Sources/DOMKit/Generated.swift | 4923 ++++++++++++++++++++++---------- 1 file changed, 3358 insertions(+), 1565 deletions(-) diff --git a/Sources/DOMKit/Generated.swift b/Sources/DOMKit/Generated.swift index 3cfbd4a3..88bb7667 100644 --- a/Sources/DOMKit/Generated.swift +++ b/Sources/DOMKit/Generated.swift @@ -333,6 +333,24 @@ public class AddEventListenerOptions: BridgedDictionary { public var signal: AbortSignal } +public enum AlphaOption: JSString, JSValueCompatible { + case keep = "keep" + case discard = "discard" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + public protocol Animatable: JSBridgedClass {} public extension Animatable { @inlinable func animate(keyframes: JSObject?, options: Double_or_KeyframeAnimationOptions? = nil) -> Animation { @@ -590,682 +608,611 @@ public class Attr: Node { public var specified: Bool } -public class AudioTrack: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioTrack].function! } +public class AudioData: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioData].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) - _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) - _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) - _enabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.enabled) + _format = ReadonlyAttribute(jsObject: jsObject, name: Strings.format) + _sampleRate = ReadonlyAttribute(jsObject: jsObject, name: Strings.sampleRate) + _numberOfFrames = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfFrames) + _numberOfChannels = ReadonlyAttribute(jsObject: jsObject, name: Strings.numberOfChannels) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) self.jsObject = jsObject } - @ReadonlyAttribute - public var id: String + @inlinable public convenience init(init: AudioDataInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } @ReadonlyAttribute - public var kind: String + public var format: AudioSampleFormat? @ReadonlyAttribute - public var label: String + public var sampleRate: Float @ReadonlyAttribute - public var language: String - - @ReadWriteAttribute - public var enabled: Bool -} + public var numberOfFrames: UInt32 -public class AudioTrackList: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioTrackList].function! } + @ReadonlyAttribute + public var numberOfChannels: UInt32 - public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - _onaddtrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaddtrack) - _onremovetrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremovetrack) - super.init(unsafelyWrapping: jsObject) - } + @ReadonlyAttribute + public var duration: UInt64 @ReadonlyAttribute - public var length: UInt32 + public var timestamp: Int64 - @inlinable public subscript(key: Int) -> AudioTrack { - jsObject[key].fromJSValue()! + @inlinable public func allocationSize(options: AudioDataCopyToOptions) -> UInt32 { + let this = jsObject + return this[Strings.allocationSize].function!(this: this, arguments: [options.jsValue]).fromJSValue()! } - @inlinable public func getTrackById(id: String) -> AudioTrack? { + @inlinable public func copyTo(destination: BufferSource, options: AudioDataCopyToOptions) { let this = jsObject - return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue]).fromJSValue()! + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue, options.jsValue]) } - @ClosureAttribute1Optional - public var onchange: EventHandler - - @ClosureAttribute1Optional - public var onaddtrack: EventHandler - - @ClosureAttribute1Optional - public var onremovetrack: EventHandler -} - -public class BarProp: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BarProp].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _visible = ReadonlyAttribute(jsObject: jsObject, name: Strings.visible) - self.jsObject = jsObject + @inlinable public func clone() -> Self { + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! } - @ReadonlyAttribute - public var visible: Bool + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } } -public class BaseComputedKeyframe: BridgedDictionary { - public convenience init(offset: Double?, computedOffset: Double, easing: String, composite: CompositeOperationOrAuto) { +public class AudioDataCopyToOptions: BridgedDictionary { + public convenience init(planeIndex: UInt32, frameOffset: UInt32, frameCount: UInt32, format: AudioSampleFormat) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.offset] = offset.jsValue - object[Strings.computedOffset] = computedOffset.jsValue - object[Strings.easing] = easing.jsValue - object[Strings.composite] = composite.jsValue + object[Strings.planeIndex] = planeIndex.jsValue + object[Strings.frameOffset] = frameOffset.jsValue + object[Strings.frameCount] = frameCount.jsValue + object[Strings.format] = format.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) - _computedOffset = ReadWriteAttribute(jsObject: object, name: Strings.computedOffset) - _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) - _composite = ReadWriteAttribute(jsObject: object, name: Strings.composite) + _planeIndex = ReadWriteAttribute(jsObject: object, name: Strings.planeIndex) + _frameOffset = ReadWriteAttribute(jsObject: object, name: Strings.frameOffset) + _frameCount = ReadWriteAttribute(jsObject: object, name: Strings.frameCount) + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var offset: Double? + public var planeIndex: UInt32 @ReadWriteAttribute - public var computedOffset: Double + public var frameOffset: UInt32 @ReadWriteAttribute - public var easing: String + public var frameCount: UInt32 @ReadWriteAttribute - public var composite: CompositeOperationOrAuto + public var format: AudioSampleFormat } -public class BaseKeyframe: BridgedDictionary { - public convenience init(offset: Double?, easing: String, composite: CompositeOperationOrAuto) { +public class AudioDataInit: BridgedDictionary { + public convenience init(format: AudioSampleFormat, sampleRate: Float, numberOfFrames: UInt32, numberOfChannels: UInt32, timestamp: Int64, data: BufferSource) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.offset] = offset.jsValue - object[Strings.easing] = easing.jsValue - object[Strings.composite] = composite.jsValue + object[Strings.format] = format.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.numberOfFrames] = numberOfFrames.jsValue + object[Strings.numberOfChannels] = numberOfChannels.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) - _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) - _composite = ReadWriteAttribute(jsObject: object, name: Strings.composite) + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + _numberOfFrames = ReadWriteAttribute(jsObject: object, name: Strings.numberOfFrames) + _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var offset: Double? + public var format: AudioSampleFormat @ReadWriteAttribute - public var easing: String + public var sampleRate: Float @ReadWriteAttribute - public var composite: CompositeOperationOrAuto -} - -public class BasePropertyIndexedKeyframe: BridgedDictionary { - public convenience init(offset: nullable_Double_or_seq_of_nullable_Double, easing: String_or_seq_of_String, composite: CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.offset] = offset.jsValue - object[Strings.easing] = easing.jsValue - object[Strings.composite] = composite.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) - _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) - _composite = ReadWriteAttribute(jsObject: object, name: Strings.composite) - super.init(unsafelyWrapping: object) - } + public var numberOfFrames: UInt32 @ReadWriteAttribute - public var offset: nullable_Double_or_seq_of_nullable_Double + public var numberOfChannels: UInt32 @ReadWriteAttribute - public var easing: String_or_seq_of_String + public var timestamp: Int64 @ReadWriteAttribute - public var composite: CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto -} - -public class BeforeUnloadEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BeforeUnloadEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } - - // XXX: member 'returnValue' is ignored -} - -public enum BitrateMode: JSString, JSValueCompatible { - case constant = "constant" - case variable = "variable" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } + public var data: BufferSource } -public class Blob: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Blob].function! } +public class AudioDecoder: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioDecoder].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _decodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.decodeQueueSize) self.jsObject = jsObject } - @inlinable public convenience init(blobParts: [BlobPart]? = nil, options: BlobPropertyBag? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [blobParts?.jsValue ?? .undefined, options?.jsValue ?? .undefined])) + @inlinable public convenience init(init: AudioDecoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute - public var size: UInt64 + public var state: CodecState @ReadonlyAttribute - public var type: String + public var decodeQueueSize: UInt32 - @inlinable public func slice(start: Int64? = nil, end: Int64? = nil, contentType: String? = nil) -> Self { + @inlinable public func configure(config: AudioDecoderConfig) { let this = jsObject - return this[Strings.slice].function!(this: this, arguments: [start?.jsValue ?? .undefined, end?.jsValue ?? .undefined, contentType?.jsValue ?? .undefined]).fromJSValue()! + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) } - // XXX: member 'stream' is ignored + @inlinable public func decode(chunk: EncodedAudioChunk) { + let this = jsObject + _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue]) + } - @inlinable public func text() -> JSPromise { + @inlinable public func flush() -> JSPromise { let this = jsObject - return this[Strings.text].function!(this: this, arguments: []).fromJSValue()! + return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func text() async throws -> String { + @inlinable public func flush() async throws { let this = jsObject - let _promise: JSPromise = this[Strings.text].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + _ = try await _promise.value } - @inlinable public func arrayBuffer() -> JSPromise { + @inlinable public func reset() { let this = jsObject - return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! + _ = this[Strings.reset].function!(this: this, arguments: []) } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func arrayBuffer() async throws -> ArrayBuffer { + @inlinable public func close() { let this = jsObject - let _promise: JSPromise = this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! + _ = this[Strings.close].function!(this: this, arguments: []) + } + + @inlinable public static func isConfigSupported(config: AudioDecoderConfig) -> JSPromise { + let this = constructor + return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public static func isConfigSupported(config: AudioDecoderConfig) async throws -> AudioDecoderSupport { + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! return try await _promise.value.fromJSValue()! } } -public class BlobEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BlobEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - _timecode = ReadonlyAttribute(jsObject: jsObject, name: Strings.timecode) - super.init(unsafelyWrapping: jsObject) +public class AudioDecoderConfig: BridgedDictionary { + public convenience init(codec: String, sampleRate: UInt32, numberOfChannels: UInt32, description: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.codec] = codec.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.numberOfChannels] = numberOfChannels.jsValue + object[Strings.description] = description.jsValue + self.init(unsafelyWrapping: object) } - @inlinable public convenience init(type: String, eventInitDict: BlobEventInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) + public required init(unsafelyWrapping object: JSObject) { + _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) + _description = ReadWriteAttribute(jsObject: object, name: Strings.description) + super.init(unsafelyWrapping: object) } - @ReadonlyAttribute - public var data: Blob + @ReadWriteAttribute + public var codec: String - @ReadonlyAttribute - public var timecode: DOMHighResTimeStamp + @ReadWriteAttribute + public var sampleRate: UInt32 + + @ReadWriteAttribute + public var numberOfChannels: UInt32 + + @ReadWriteAttribute + public var description: BufferSource } -public class BlobEventInit: BridgedDictionary { - public convenience init(data: Blob, timecode: DOMHighResTimeStamp) { +public class AudioDecoderInit: BridgedDictionary { + public convenience init(output: @escaping AudioDataOutputCallback, error: @escaping WebCodecsErrorCallback) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.data] = data.jsValue - object[Strings.timecode] = timecode.jsValue + ClosureAttribute1Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - _timecode = ReadWriteAttribute(jsObject: object, name: Strings.timecode) + _output = ClosureAttribute1Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) super.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var data: Blob + @ClosureAttribute1Void + public var output: AudioDataOutputCallback - @ReadWriteAttribute - public var timecode: DOMHighResTimeStamp + @ClosureAttribute1Void + public var error: WebCodecsErrorCallback } -public class BlobPropertyBag: BridgedDictionary { - public convenience init(type: String, endings: EndingType) { +public class AudioDecoderSupport: BridgedDictionary { + public convenience init(supported: Bool, config: AudioDecoderConfig) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.type] = type.jsValue - object[Strings.endings] = endings.jsValue + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _endings = ReadWriteAttribute(jsObject: object, name: Strings.endings) + _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) + _config = ReadWriteAttribute(jsObject: object, name: Strings.config) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var type: String + public var supported: Bool @ReadWriteAttribute - public var endings: EndingType + public var config: AudioDecoderConfig } -public protocol Body: JSBridgedClass {} -public extension Body { - // XXX: attribute 'body' is ignored +public class AudioEncoder: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioEncoder].function! } - @inlinable var bodyUsed: Bool { ReadonlyAttribute[Strings.bodyUsed, in: jsObject] } + public let jsObject: JSObject - @inlinable func arrayBuffer() -> JSPromise { - let this = jsObject - return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! + public required init(unsafelyWrapping jsObject: JSObject) { + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _encodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.encodeQueueSize) + self.jsObject = jsObject } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable func arrayBuffer() async throws -> ArrayBuffer { - let this = jsObject - let _promise: JSPromise = this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! + @inlinable public convenience init(init: AudioEncoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } - @inlinable func blob() -> JSPromise { - let this = jsObject - return this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! - } + @ReadonlyAttribute + public var state: CodecState - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable func blob() async throws -> Blob { + @ReadonlyAttribute + public var encodeQueueSize: UInt32 + + @inlinable public func configure(config: AudioEncoderConfig) { let this = jsObject - let _promise: JSPromise = this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) } - @inlinable func formData() -> JSPromise { + @inlinable public func encode(data: AudioData) { let this = jsObject - return this[Strings.formData].function!(this: this, arguments: []).fromJSValue()! + _ = this[Strings.encode].function!(this: this, arguments: [data.jsValue]) } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable func formData() async throws -> FormData { + @inlinable public func flush() -> JSPromise { let this = jsObject - let _promise: JSPromise = this[Strings.formData].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! + return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! } - @inlinable func json() -> JSPromise { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func flush() async throws { let this = jsObject - return this[Strings.json].function!(this: this, arguments: []).fromJSValue()! + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + _ = try await _promise.value } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable func json() async throws -> JSValue { + @inlinable public func reset() { let this = jsObject - let _promise: JSPromise = this[Strings.json].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! + _ = this[Strings.reset].function!(this: this, arguments: []) } - @inlinable func text() -> JSPromise { + @inlinable public func close() { let this = jsObject - return this[Strings.text].function!(this: this, arguments: []).fromJSValue()! + _ = this[Strings.close].function!(this: this, arguments: []) + } + + @inlinable public static func isConfigSupported(config: AudioEncoderConfig) -> JSPromise { + let this = constructor + return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable func text() async throws -> String { - let this = jsObject - let _promise: JSPromise = this[Strings.text].function!(this: this, arguments: []).fromJSValue()! + @inlinable public static func isConfigSupported(config: AudioEncoderConfig) async throws -> AudioEncoderSupport { + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! return try await _promise.value.fromJSValue()! } } -public class BroadcastChannel: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BroadcastChannel].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) - _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) - super.init(unsafelyWrapping: jsObject) +public class AudioEncoderConfig: BridgedDictionary { + public convenience init(codec: String, sampleRate: UInt32, numberOfChannels: UInt32, bitrate: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.codec] = codec.jsValue + object[Strings.sampleRate] = sampleRate.jsValue + object[Strings.numberOfChannels] = numberOfChannels.jsValue + object[Strings.bitrate] = bitrate.jsValue + self.init(unsafelyWrapping: object) } - @inlinable public convenience init(name: String) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue])) + public required init(unsafelyWrapping object: JSObject) { + _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) + _sampleRate = ReadWriteAttribute(jsObject: object, name: Strings.sampleRate) + _numberOfChannels = ReadWriteAttribute(jsObject: object, name: Strings.numberOfChannels) + _bitrate = ReadWriteAttribute(jsObject: object, name: Strings.bitrate) + super.init(unsafelyWrapping: object) } - @ReadonlyAttribute - public var name: String + @ReadWriteAttribute + public var codec: String - @inlinable public func postMessage(message: JSValue) { - let this = jsObject - _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue]) + @ReadWriteAttribute + public var sampleRate: UInt32 + + @ReadWriteAttribute + public var numberOfChannels: UInt32 + + @ReadWriteAttribute + public var bitrate: UInt64 +} + +public class AudioEncoderInit: BridgedDictionary { + public convenience init(output: @escaping EncodedAudioChunkOutputCallback, error: @escaping WebCodecsErrorCallback) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute2Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) } - @inlinable public func close() { - let this = jsObject - _ = this[Strings.close].function!(this: this, arguments: []) + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute2Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) } - @ClosureAttribute1Optional - public var onmessage: EventHandler + @ClosureAttribute2Void + public var output: EncodedAudioChunkOutputCallback - @ClosureAttribute1Optional - public var onmessageerror: EventHandler + @ClosureAttribute1Void + public var error: WebCodecsErrorCallback } -public class ByteLengthQueuingStrategy: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ByteLengthQueuingStrategy].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: Strings.highWaterMark) - _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) - self.jsObject = jsObject +public class AudioEncoderSupport: BridgedDictionary { + public convenience init(supported: Bool, config: AudioEncoderConfig) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue + self.init(unsafelyWrapping: object) } - @inlinable public convenience init(init: QueuingStrategyInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + public required init(unsafelyWrapping object: JSObject) { + _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) + _config = ReadWriteAttribute(jsObject: object, name: Strings.config) + super.init(unsafelyWrapping: object) } - @ReadonlyAttribute - public var highWaterMark: Double + @ReadWriteAttribute + public var supported: Bool - @ReadonlyAttribute - public var size: JSFunction + @ReadWriteAttribute + public var config: AudioEncoderConfig } -public class CDATASection: Text { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CDATASection].function! } +public enum AudioSampleFormat: JSString, JSValueCompatible { + case u8 = "u8" + case s16 = "s16" + case s32 = "s32" + case f32 = "f32" + case u8Planar = "u8-planar" + case s16Planar = "s16-planar" + case s32Planar = "s32-planar" + case f32Planar = "f32-planar" - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public class Cache: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Cache].function! } +public class AudioTrack: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.AudioTrack].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) + _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) + _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) + _enabled = ReadWriteAttribute(jsObject: jsObject, name: Strings.enabled) self.jsObject = jsObject } - @inlinable public func match(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.match].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } + @ReadonlyAttribute + public var id: String - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> Response? { - let this = jsObject - let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } + @ReadonlyAttribute + public var kind: String - @inlinable public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! - } + @ReadonlyAttribute + public var label: String - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [Response] { - let this = jsObject - let _promise: JSPromise = this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } + @ReadonlyAttribute + public var language: String - @inlinable public func add(request: RequestInfo) -> JSPromise { - let this = jsObject - return this[Strings.add].function!(this: this, arguments: [request.jsValue]).fromJSValue()! - } + @ReadWriteAttribute + public var enabled: Bool +} - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func add(request: RequestInfo) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.add].function!(this: this, arguments: [request.jsValue]).fromJSValue()! - _ = try await _promise.value - } +public class AudioTrackList: EventTarget { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.AudioTrackList].function! } - @inlinable public func addAll(requests: [RequestInfo]) -> JSPromise { - let this = jsObject - return this[Strings.addAll].function!(this: this, arguments: [requests.jsValue]).fromJSValue()! + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) + _onaddtrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaddtrack) + _onremovetrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremovetrack) + super.init(unsafelyWrapping: jsObject) } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func addAll(requests: [RequestInfo]) async throws { - let this = jsObject - let _promise: JSPromise = this[Strings.addAll].function!(this: this, arguments: [requests.jsValue]).fromJSValue()! - _ = try await _promise.value - } + @ReadonlyAttribute + public var length: UInt32 - @inlinable public func put(request: RequestInfo, response: Response) -> JSPromise { - let this = jsObject - return this[Strings.put].function!(this: this, arguments: [request.jsValue, response.jsValue]).fromJSValue()! + @inlinable public subscript(key: Int) -> AudioTrack { + jsObject[key].fromJSValue()! } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func put(request: RequestInfo, response: Response) async throws { + @inlinable public func getTrackById(id: String) -> AudioTrack? { let this = jsObject - let _promise: JSPromise = this[Strings.put].function!(this: this, arguments: [request.jsValue, response.jsValue]).fromJSValue()! - _ = try await _promise.value + return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue]).fromJSValue()! } - @inlinable public func delete(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } + @ClosureAttribute1Optional + public var onchange: EventHandler - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func delete(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } + @ClosureAttribute1Optional + public var onaddtrack: EventHandler - @inlinable public func keys(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.keys].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! - } + @ClosureAttribute1Optional + public var onremovetrack: EventHandler +} - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func keys(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [Request] { - let this = jsObject - let _promise: JSPromise = this[Strings.keys].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! +public class BarProp: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.BarProp].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _visible = ReadonlyAttribute(jsObject: jsObject, name: Strings.visible) + self.jsObject = jsObject } + + @ReadonlyAttribute + public var visible: Bool } -public class CacheQueryOptions: BridgedDictionary { - public convenience init(ignoreSearch: Bool, ignoreMethod: Bool, ignoreVary: Bool) { +public class BaseComputedKeyframe: BridgedDictionary { + public convenience init(offset: Double?, computedOffset: Double, easing: String, composite: CompositeOperationOrAuto) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.ignoreSearch] = ignoreSearch.jsValue - object[Strings.ignoreMethod] = ignoreMethod.jsValue - object[Strings.ignoreVary] = ignoreVary.jsValue + object[Strings.offset] = offset.jsValue + object[Strings.computedOffset] = computedOffset.jsValue + object[Strings.easing] = easing.jsValue + object[Strings.composite] = composite.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _ignoreSearch = ReadWriteAttribute(jsObject: object, name: Strings.ignoreSearch) - _ignoreMethod = ReadWriteAttribute(jsObject: object, name: Strings.ignoreMethod) - _ignoreVary = ReadWriteAttribute(jsObject: object, name: Strings.ignoreVary) + _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) + _computedOffset = ReadWriteAttribute(jsObject: object, name: Strings.computedOffset) + _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) + _composite = ReadWriteAttribute(jsObject: object, name: Strings.composite) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var ignoreSearch: Bool + public var offset: Double? @ReadWriteAttribute - public var ignoreMethod: Bool + public var computedOffset: Double @ReadWriteAttribute - public var ignoreVary: Bool + public var easing: String + + @ReadWriteAttribute + public var composite: CompositeOperationOrAuto } -public class CacheStorage: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CacheStorage].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) -> JSPromise { - let this = jsObject - return this[Strings.match].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) async throws -> Response? { - let this = jsObject - let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func has(cacheName: String) -> JSPromise { - let this = jsObject - return this[Strings.has].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func has(cacheName: String) async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.has].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } - - @inlinable public func open(cacheName: String) -> JSPromise { - let this = jsObject - return this[Strings.open].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! - } - - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func open(cacheName: String) async throws -> Cache { - let this = jsObject - let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! +public class BaseKeyframe: BridgedDictionary { + public convenience init(offset: Double?, easing: String, composite: CompositeOperationOrAuto) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.offset] = offset.jsValue + object[Strings.easing] = easing.jsValue + object[Strings.composite] = composite.jsValue + self.init(unsafelyWrapping: object) } - @inlinable public func delete(cacheName: String) -> JSPromise { - let this = jsObject - return this[Strings.delete].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! + public required init(unsafelyWrapping object: JSObject) { + _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) + _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) + _composite = ReadWriteAttribute(jsObject: object, name: Strings.composite) + super.init(unsafelyWrapping: object) } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func delete(cacheName: String) async throws -> Bool { - let this = jsObject - let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! - } + @ReadWriteAttribute + public var offset: Double? - @inlinable public func keys() -> JSPromise { - let this = jsObject - return this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! - } + @ReadWriteAttribute + public var easing: String - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func keys() async throws -> [String] { - let this = jsObject - let _promise: JSPromise = this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! - return try await _promise.value.fromJSValue()! - } + @ReadWriteAttribute + public var composite: CompositeOperationOrAuto } -public class CameraDevicePermissionDescriptor: BridgedDictionary { - public convenience init(panTiltZoom: Bool) { +public class BasePropertyIndexedKeyframe: BridgedDictionary { + public convenience init(offset: nullable_Double_or_seq_of_nullable_Double, easing: String_or_seq_of_String, composite: CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.panTiltZoom] = panTiltZoom.jsValue + object[Strings.offset] = offset.jsValue + object[Strings.easing] = easing.jsValue + object[Strings.composite] = composite.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _panTiltZoom = ReadWriteAttribute(jsObject: object, name: Strings.panTiltZoom) + _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) + _easing = ReadWriteAttribute(jsObject: object, name: Strings.easing) + _composite = ReadWriteAttribute(jsObject: object, name: Strings.composite) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var panTiltZoom: Bool -} - -public enum CanPlayTypeResult: JSString, JSValueCompatible { - case _empty = "" - case maybe = "maybe" - case probably = "probably" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } + public var offset: nullable_Double_or_seq_of_nullable_Double - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } + @ReadWriteAttribute + public var easing: String_or_seq_of_String - @inlinable public var jsValue: JSValue { rawValue.jsValue } + @ReadWriteAttribute + public var composite: CompositeOperationOrAuto_or_seq_of_CompositeOperationOrAuto } -public protocol CanvasCompositing: JSBridgedClass {} -public extension CanvasCompositing { - @inlinable var globalAlpha: Double { - get { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] = newValue } - } +public class BeforeUnloadEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BeforeUnloadEvent].function! } - @inlinable var globalCompositeOperation: String { - get { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] = newValue } + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) } + + // XXX: member 'returnValue' is ignored } -public enum CanvasDirection: JSString, JSValueCompatible { - case ltr = "ltr" - case rtl = "rtl" - case inherit = "inherit" +public enum BitrateMode: JSString, JSValueCompatible { + case constant = "constant" + case variable = "variable" @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -1281,239 +1228,254 @@ public enum CanvasDirection: JSString, JSValueCompatible { @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public protocol CanvasDrawImage: JSBridgedClass {} -public extension CanvasDrawImage { - @inlinable func drawImage(image: CanvasImageSource, dx: Double, dy: Double) { - let this = jsObject - _ = this[Strings.drawImage].function!(this: this, arguments: [image.jsValue, dx.jsValue, dy.jsValue]) - } +public class Blob: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Blob].function! } - @inlinable func drawImage(image: CanvasImageSource, dx: Double, dy: Double, dw: Double, dh: Double) { - let this = jsObject - _ = this[Strings.drawImage].function!(this: this, arguments: [image.jsValue, dx.jsValue, dy.jsValue, dw.jsValue, dh.jsValue]) - } + public let jsObject: JSObject - @inlinable func drawImage(image: CanvasImageSource, sx: Double, sy: Double, sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double) { - let _arg0 = image.jsValue - let _arg1 = sx.jsValue - let _arg2 = sy.jsValue - let _arg3 = sw.jsValue - let _arg4 = sh.jsValue - let _arg5 = dx.jsValue - let _arg6 = dy.jsValue - let _arg7 = dw.jsValue - let _arg8 = dh.jsValue - let this = jsObject - _ = this[Strings.drawImage].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + public required init(unsafelyWrapping jsObject: JSObject) { + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + self.jsObject = jsObject } -} -public protocol CanvasDrawPath: JSBridgedClass {} -public extension CanvasDrawPath { - @inlinable func beginPath() { - let this = jsObject - _ = this[Strings.beginPath].function!(this: this, arguments: []) + @inlinable public convenience init(blobParts: [BlobPart]? = nil, options: BlobPropertyBag? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [blobParts?.jsValue ?? .undefined, options?.jsValue ?? .undefined])) } - @inlinable func fill(fillRule: CanvasFillRule? = nil) { - let this = jsObject - _ = this[Strings.fill].function!(this: this, arguments: [fillRule?.jsValue ?? .undefined]) - } + @ReadonlyAttribute + public var size: UInt64 - @inlinable func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { - let this = jsObject - _ = this[Strings.fill].function!(this: this, arguments: [path.jsValue, fillRule?.jsValue ?? .undefined]) - } + @ReadonlyAttribute + public var type: String - @inlinable func stroke() { + @inlinable public func slice(start: Int64? = nil, end: Int64? = nil, contentType: String? = nil) -> Self { let this = jsObject - _ = this[Strings.stroke].function!(this: this, arguments: []) + return this[Strings.slice].function!(this: this, arguments: [start?.jsValue ?? .undefined, end?.jsValue ?? .undefined, contentType?.jsValue ?? .undefined]).fromJSValue()! } - @inlinable func stroke(path: Path2D) { - let this = jsObject - _ = this[Strings.stroke].function!(this: this, arguments: [path.jsValue]) - } + // XXX: member 'stream' is ignored - @inlinable func clip(fillRule: CanvasFillRule? = nil) { + @inlinable public func text() -> JSPromise { let this = jsObject - _ = this[Strings.clip].function!(this: this, arguments: [fillRule?.jsValue ?? .undefined]) + return this[Strings.text].function!(this: this, arguments: []).fromJSValue()! } - @inlinable func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func text() async throws -> String { let this = jsObject - _ = this[Strings.clip].function!(this: this, arguments: [path.jsValue, fillRule?.jsValue ?? .undefined]) + let _promise: JSPromise = this[Strings.text].function!(this: this, arguments: []).fromJSValue()! + return try await _promise.value.fromJSValue()! } - @inlinable func isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { + @inlinable public func arrayBuffer() -> JSPromise { let this = jsObject - return this[Strings.isPointInPath].function!(this: this, arguments: [x.jsValue, y.jsValue, fillRule?.jsValue ?? .undefined]).fromJSValue()! + return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! } - @inlinable func isPointInPath(path: Path2D, x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func arrayBuffer() async throws -> ArrayBuffer { let this = jsObject - return this[Strings.isPointInPath].function!(this: this, arguments: [path.jsValue, x.jsValue, y.jsValue, fillRule?.jsValue ?? .undefined]).fromJSValue()! + let _promise: JSPromise = this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! + return try await _promise.value.fromJSValue()! } +} - @inlinable func isPointInStroke(x: Double, y: Double) -> Bool { - let this = jsObject - return this[Strings.isPointInStroke].function!(this: this, arguments: [x.jsValue, y.jsValue]).fromJSValue()! +public class BlobEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BlobEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + _timecode = ReadonlyAttribute(jsObject: jsObject, name: Strings.timecode) + super.init(unsafelyWrapping: jsObject) } - @inlinable func isPointInStroke(path: Path2D, x: Double, y: Double) -> Bool { - let this = jsObject - return this[Strings.isPointInStroke].function!(this: this, arguments: [path.jsValue, x.jsValue, y.jsValue]).fromJSValue()! + @inlinable public convenience init(type: String, eventInitDict: BlobEventInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict.jsValue])) } -} -public enum CanvasFillRule: JSString, JSValueCompatible { - case nonzero = "nonzero" - case evenodd = "evenodd" + @ReadonlyAttribute + public var data: Blob - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + @ReadonlyAttribute + public var timecode: DOMHighResTimeStamp +} + +public class BlobEventInit: BridgedDictionary { + public convenience init(data: Blob, timecode: DOMHighResTimeStamp) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.data] = data.jsValue + object[Strings.timecode] = timecode.jsValue + self.init(unsafelyWrapping: object) } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + public required init(unsafelyWrapping object: JSObject) { + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + _timecode = ReadWriteAttribute(jsObject: object, name: Strings.timecode) + super.init(unsafelyWrapping: object) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } + @ReadWriteAttribute + public var data: Blob + + @ReadWriteAttribute + public var timecode: DOMHighResTimeStamp } -public protocol CanvasFillStrokeStyles: JSBridgedClass {} -public extension CanvasFillStrokeStyles { - @inlinable var strokeStyle: CanvasGradient_or_CanvasPattern_or_String { - get { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] = newValue } +public class BlobPropertyBag: BridgedDictionary { + public convenience init(type: String, endings: EndingType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue + object[Strings.endings] = endings.jsValue + self.init(unsafelyWrapping: object) } - @inlinable var fillStyle: CanvasGradient_or_CanvasPattern_or_String { - get { ReadWriteAttribute[Strings.fillStyle, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.fillStyle, in: jsObject] = newValue } + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _endings = ReadWriteAttribute(jsObject: object, name: Strings.endings) + super.init(unsafelyWrapping: object) } - @inlinable func createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double) -> CanvasGradient { + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var endings: EndingType +} + +public protocol Body: JSBridgedClass {} +public extension Body { + // XXX: attribute 'body' is ignored + + @inlinable var bodyUsed: Bool { ReadonlyAttribute[Strings.bodyUsed, in: jsObject] } + + @inlinable func arrayBuffer() -> JSPromise { let this = jsObject - return this[Strings.createLinearGradient].function!(this: this, arguments: [x0.jsValue, y0.jsValue, x1.jsValue, y1.jsValue]).fromJSValue()! + return this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! } - @inlinable func createRadialGradient(x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double) -> CanvasGradient { - let _arg0 = x0.jsValue - let _arg1 = y0.jsValue - let _arg2 = r0.jsValue - let _arg3 = x1.jsValue - let _arg4 = y1.jsValue - let _arg5 = r1.jsValue + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable func arrayBuffer() async throws -> ArrayBuffer { let this = jsObject - return this[Strings.createRadialGradient].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! + let _promise: JSPromise = this[Strings.arrayBuffer].function!(this: this, arguments: []).fromJSValue()! + return try await _promise.value.fromJSValue()! } - @inlinable func createConicGradient(startAngle: Double, x: Double, y: Double) -> CanvasGradient { + @inlinable func blob() -> JSPromise { let this = jsObject - return this[Strings.createConicGradient].function!(this: this, arguments: [startAngle.jsValue, x.jsValue, y.jsValue]).fromJSValue()! + return this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! } - @inlinable func createPattern(image: CanvasImageSource, repetition: String) -> CanvasPattern? { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable func blob() async throws -> Blob { let this = jsObject - return this[Strings.createPattern].function!(this: this, arguments: [image.jsValue, repetition.jsValue]).fromJSValue()! + let _promise: JSPromise = this[Strings.blob].function!(this: this, arguments: []).fromJSValue()! + return try await _promise.value.fromJSValue()! } -} -public class CanvasFilter: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasFilter].function! } + @inlinable func formData() -> JSPromise { + let this = jsObject + return this[Strings.formData].function!(this: this, arguments: []).fromJSValue()! + } - public let jsObject: JSObject + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable func formData() async throws -> FormData { + let this = jsObject + let _promise: JSPromise = this[Strings.formData].function!(this: this, arguments: []).fromJSValue()! + return try await _promise.value.fromJSValue()! + } - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject + @inlinable func json() -> JSPromise { + let this = jsObject + return this[Strings.json].function!(this: this, arguments: []).fromJSValue()! } - @inlinable public convenience init(filters: CanvasFilterInput_or_seq_of_CanvasFilterInput? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [filters?.jsValue ?? .undefined])) + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable func json() async throws -> JSValue { + let this = jsObject + let _promise: JSPromise = this[Strings.json].function!(this: this, arguments: []).fromJSValue()! + return try await _promise.value.fromJSValue()! } -} -public protocol CanvasFilters: JSBridgedClass {} -public extension CanvasFilters { - @inlinable var filter: CanvasFilter_or_String { - get { ReadWriteAttribute[Strings.filter, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.filter, in: jsObject] = newValue } + @inlinable func text() -> JSPromise { + let this = jsObject + return this[Strings.text].function!(this: this, arguments: []).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable func text() async throws -> String { + let this = jsObject + let _promise: JSPromise = this[Strings.text].function!(this: this, arguments: []).fromJSValue()! + return try await _promise.value.fromJSValue()! } } -public enum CanvasFontKerning: JSString, JSValueCompatible { - case auto = "auto" - case normal = "normal" - case none = "none" +public class BroadcastChannel: EventTarget { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.BroadcastChannel].function! } - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + public required init(unsafelyWrapping jsObject: JSObject) { + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + _onmessage = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessage) + _onmessageerror = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onmessageerror) + super.init(unsafelyWrapping: jsObject) } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable public convenience init(name: String) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [name.jsValue])) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} - -public enum CanvasFontStretch: JSString, JSValueCompatible { - case ultraCondensed = "ultra-condensed" - case extraCondensed = "extra-condensed" - case condensed = "condensed" - case semiCondensed = "semi-condensed" - case normal = "normal" - case semiExpanded = "semi-expanded" - case expanded = "expanded" - case extraExpanded = "extra-expanded" - case ultraExpanded = "ultra-expanded" + @ReadonlyAttribute + public var name: String - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + @inlinable public func postMessage(message: JSValue) { + let this = jsObject + _ = this[Strings.postMessage].function!(this: this, arguments: [message.jsValue]) } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } + @ClosureAttribute1Optional + public var onmessage: EventHandler + + @ClosureAttribute1Optional + public var onmessageerror: EventHandler } -public enum CanvasFontVariantCaps: JSString, JSValueCompatible { - case normal = "normal" - case smallCaps = "small-caps" - case allSmallCaps = "all-small-caps" - case petiteCaps = "petite-caps" - case allPetiteCaps = "all-petite-caps" - case unicase = "unicase" - case titlingCaps = "titling-caps" +public class ByteLengthQueuingStrategy: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ByteLengthQueuingStrategy].function! } - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: Strings.highWaterMark) + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) + self.jsObject = jsObject } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable public convenience init(init: QueuingStrategyInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } + @ReadonlyAttribute + public var highWaterMark: Double + + @ReadonlyAttribute + public var size: JSFunction } -public class CanvasGradient: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasGradient].function! } +public class CDATASection: Text { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CDATASection].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + +public class Cache: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Cache].function! } public let jsObject: JSObject @@ -1521,384 +1483,342 @@ public class CanvasGradient: JSBridgedClass { self.jsObject = jsObject } - @inlinable public func addColorStop(offset: Double, color: String) { + @inlinable public func match(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { let this = jsObject - _ = this[Strings.addColorStop].function!(this: this, arguments: [offset.jsValue, color.jsValue]) + return this[Strings.match].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } -} -public protocol CanvasImageData: JSBridgedClass {} -public extension CanvasImageData { - @inlinable func createImageData(sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func match(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> Response? { let this = jsObject - return this[Strings.createImageData].function!(this: this, arguments: [sw.jsValue, sh.jsValue, settings?.jsValue ?? .undefined]).fromJSValue()! + let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } - @inlinable func createImageData(imagedata: ImageData) -> ImageData { + @inlinable public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { let this = jsObject - return this[Strings.createImageData].function!(this: this, arguments: [imagedata.jsValue]).fromJSValue()! + return this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! } - @inlinable func getImageData(sx: Int32, sy: Int32, sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func matchAll(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [Response] { let this = jsObject - return this[Strings.getImageData].function!(this: this, arguments: [sx.jsValue, sy.jsValue, sw.jsValue, sh.jsValue, settings?.jsValue ?? .undefined]).fromJSValue()! + let _promise: JSPromise = this[Strings.matchAll].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } - @inlinable func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { + @inlinable public func add(request: RequestInfo) -> JSPromise { let this = jsObject - _ = this[Strings.putImageData].function!(this: this, arguments: [imagedata.jsValue, dx.jsValue, dy.jsValue]) + return this[Strings.add].function!(this: this, arguments: [request.jsValue]).fromJSValue()! } - @inlinable func putImageData(imagedata: ImageData, dx: Int32, dy: Int32, dirtyX: Int32, dirtyY: Int32, dirtyWidth: Int32, dirtyHeight: Int32) { - let _arg0 = imagedata.jsValue - let _arg1 = dx.jsValue - let _arg2 = dy.jsValue - let _arg3 = dirtyX.jsValue - let _arg4 = dirtyY.jsValue - let _arg5 = dirtyWidth.jsValue - let _arg6 = dirtyHeight.jsValue + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func add(request: RequestInfo) async throws { let this = jsObject - _ = this[Strings.putImageData].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) + let _promise: JSPromise = this[Strings.add].function!(this: this, arguments: [request.jsValue]).fromJSValue()! + _ = try await _promise.value } -} -public protocol CanvasImageSmoothing: JSBridgedClass {} -public extension CanvasImageSmoothing { - @inlinable var imageSmoothingEnabled: Bool { - get { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] = newValue } + @inlinable public func addAll(requests: [RequestInfo]) -> JSPromise { + let this = jsObject + return this[Strings.addAll].function!(this: this, arguments: [requests.jsValue]).fromJSValue()! } - @inlinable var imageSmoothingQuality: ImageSmoothingQuality { - get { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] = newValue } - } -} - -public enum CanvasLineCap: JSString, JSValueCompatible { - case butt = "butt" - case round = "round" - case square = "square" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} - -public enum CanvasLineJoin: JSString, JSValueCompatible { - case round = "round" - case bevel = "bevel" - case miter = "miter" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} - -public protocol CanvasPath: JSBridgedClass {} -public extension CanvasPath { - @inlinable func closePath() { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func addAll(requests: [RequestInfo]) async throws { let this = jsObject - _ = this[Strings.closePath].function!(this: this, arguments: []) + let _promise: JSPromise = this[Strings.addAll].function!(this: this, arguments: [requests.jsValue]).fromJSValue()! + _ = try await _promise.value } - @inlinable func moveTo(x: Double, y: Double) { + @inlinable public func put(request: RequestInfo, response: Response) -> JSPromise { let this = jsObject - _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) + return this[Strings.put].function!(this: this, arguments: [request.jsValue, response.jsValue]).fromJSValue()! } - @inlinable func lineTo(x: Double, y: Double) { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func put(request: RequestInfo, response: Response) async throws { let this = jsObject - _ = this[Strings.lineTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) + let _promise: JSPromise = this[Strings.put].function!(this: this, arguments: [request.jsValue, response.jsValue]).fromJSValue()! + _ = try await _promise.value } - @inlinable func quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double) { + @inlinable public func delete(request: RequestInfo, options: CacheQueryOptions? = nil) -> JSPromise { let this = jsObject - _ = this[Strings.quadraticCurveTo].function!(this: this, arguments: [cpx.jsValue, cpy.jsValue, x.jsValue, y.jsValue]) + return this[Strings.delete].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } - @inlinable func bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double) { - let _arg0 = cp1x.jsValue - let _arg1 = cp1y.jsValue - let _arg2 = cp2x.jsValue - let _arg3 = cp2y.jsValue - let _arg4 = x.jsValue - let _arg5 = y.jsValue + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func delete(request: RequestInfo, options: CacheQueryOptions? = nil) async throws -> Bool { let this = jsObject - _ = this[Strings.bezierCurveTo].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } - @inlinable func arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double) { + @inlinable public func keys(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) -> JSPromise { let this = jsObject - _ = this[Strings.arcTo].function!(this: this, arguments: [x1.jsValue, y1.jsValue, x2.jsValue, y2.jsValue, radius.jsValue]) + return this[Strings.keys].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! } - @inlinable func rect(x: Double, y: Double, w: Double, h: Double) { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func keys(request: RequestInfo? = nil, options: CacheQueryOptions? = nil) async throws -> [Request] { let this = jsObject - _ = this[Strings.rect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) + let _promise: JSPromise = this[Strings.keys].function!(this: this, arguments: [request?.jsValue ?? .undefined, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } +} - @inlinable func roundRect(x: Double, y: Double, w: Double, h: Double, radii: DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double? = nil) { - let this = jsObject - _ = this[Strings.roundRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue, radii?.jsValue ?? .undefined]) +public class CacheQueryOptions: BridgedDictionary { + public convenience init(ignoreSearch: Bool, ignoreMethod: Bool, ignoreVary: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.ignoreSearch] = ignoreSearch.jsValue + object[Strings.ignoreMethod] = ignoreMethod.jsValue + object[Strings.ignoreVary] = ignoreVary.jsValue + self.init(unsafelyWrapping: object) } - @inlinable func arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { - let _arg0 = x.jsValue - let _arg1 = y.jsValue - let _arg2 = radius.jsValue - let _arg3 = startAngle.jsValue - let _arg4 = endAngle.jsValue - let _arg5 = counterclockwise?.jsValue ?? .undefined - let this = jsObject - _ = this[Strings.arc].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + public required init(unsafelyWrapping object: JSObject) { + _ignoreSearch = ReadWriteAttribute(jsObject: object, name: Strings.ignoreSearch) + _ignoreMethod = ReadWriteAttribute(jsObject: object, name: Strings.ignoreMethod) + _ignoreVary = ReadWriteAttribute(jsObject: object, name: Strings.ignoreVary) + super.init(unsafelyWrapping: object) } - @inlinable func ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { - let _arg0 = x.jsValue - let _arg1 = y.jsValue - let _arg2 = radiusX.jsValue - let _arg3 = radiusY.jsValue - let _arg4 = rotation.jsValue - let _arg5 = startAngle.jsValue - let _arg6 = endAngle.jsValue - let _arg7 = counterclockwise?.jsValue ?? .undefined - let this = jsObject - _ = this[Strings.ellipse].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) - } -} + @ReadWriteAttribute + public var ignoreSearch: Bool -public protocol CanvasPathDrawingStyles: JSBridgedClass {} -public extension CanvasPathDrawingStyles { - @inlinable var lineWidth: Double { - get { ReadWriteAttribute[Strings.lineWidth, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.lineWidth, in: jsObject] = newValue } - } + @ReadWriteAttribute + public var ignoreMethod: Bool - @inlinable var lineCap: CanvasLineCap { - get { ReadWriteAttribute[Strings.lineCap, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.lineCap, in: jsObject] = newValue } - } + @ReadWriteAttribute + public var ignoreVary: Bool +} - @inlinable var lineJoin: CanvasLineJoin { - get { ReadWriteAttribute[Strings.lineJoin, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.lineJoin, in: jsObject] = newValue } - } +public class CacheStorage: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CacheStorage].function! } - @inlinable var miterLimit: Double { - get { ReadWriteAttribute[Strings.miterLimit, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.miterLimit, in: jsObject] = newValue } + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject } - @inlinable func setLineDash(segments: [Double]) { + @inlinable public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) -> JSPromise { let this = jsObject - _ = this[Strings.setLineDash].function!(this: this, arguments: [segments.jsValue]) + return this[Strings.match].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! } - @inlinable func getLineDash() -> [Double] { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func match(request: RequestInfo, options: MultiCacheQueryOptions? = nil) async throws -> Response? { let this = jsObject - return this[Strings.getLineDash].function!(this: this, arguments: []).fromJSValue()! + let _promise: JSPromise = this[Strings.match].function!(this: this, arguments: [request.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! } - @inlinable var lineDashOffset: Double { - get { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] = newValue } + @inlinable public func has(cacheName: String) -> JSPromise { + let this = jsObject + return this[Strings.has].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! } -} -public class CanvasPattern: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasPattern].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func has(cacheName: String) async throws -> Bool { + let this = jsObject + let _promise: JSPromise = this[Strings.has].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } - @inlinable public func setTransform(transform: DOMMatrix2DInit? = nil) { + @inlinable public func open(cacheName: String) -> JSPromise { let this = jsObject - _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue ?? .undefined]) + return this[Strings.open].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! } -} -public protocol CanvasRect: JSBridgedClass {} -public extension CanvasRect { - @inlinable func clearRect(x: Double, y: Double, w: Double, h: Double) { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func open(cacheName: String) async throws -> Cache { let this = jsObject - _ = this[Strings.clearRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) + let _promise: JSPromise = this[Strings.open].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } - @inlinable func fillRect(x: Double, y: Double, w: Double, h: Double) { + @inlinable public func delete(cacheName: String) -> JSPromise { let this = jsObject - _ = this[Strings.fillRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) + return this[Strings.delete].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! } - @inlinable func strokeRect(x: Double, y: Double, w: Double, h: Double) { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func delete(cacheName: String) async throws -> Bool { let this = jsObject - _ = this[Strings.strokeRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) + let _promise: JSPromise = this[Strings.delete].function!(this: this, arguments: [cacheName.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } -} - -public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasRenderingContext2D].function! } - - public let jsObject: JSObject - public required init(unsafelyWrapping jsObject: JSObject) { - _canvas = ReadonlyAttribute(jsObject: jsObject, name: Strings.canvas) - self.jsObject = jsObject + @inlinable public func keys() -> JSPromise { + let this = jsObject + return this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! } - @ReadonlyAttribute - public var canvas: HTMLCanvasElement - - @inlinable public func getContextAttributes() -> CanvasRenderingContext2DSettings { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func keys() async throws -> [String] { let this = jsObject - return this[Strings.getContextAttributes].function!(this: this, arguments: []).fromJSValue()! + let _promise: JSPromise = this[Strings.keys].function!(this: this, arguments: []).fromJSValue()! + return try await _promise.value.fromJSValue()! } } -public class CanvasRenderingContext2DSettings: BridgedDictionary { - public convenience init(alpha: Bool, desynchronized: Bool, colorSpace: PredefinedColorSpace, willReadFrequently: Bool) { +public class CameraDevicePermissionDescriptor: BridgedDictionary { + public convenience init(panTiltZoom: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue - object[Strings.desynchronized] = desynchronized.jsValue - object[Strings.colorSpace] = colorSpace.jsValue - object[Strings.willReadFrequently] = willReadFrequently.jsValue + object[Strings.panTiltZoom] = panTiltZoom.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - _desynchronized = ReadWriteAttribute(jsObject: object, name: Strings.desynchronized) - _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) - _willReadFrequently = ReadWriteAttribute(jsObject: object, name: Strings.willReadFrequently) + _panTiltZoom = ReadWriteAttribute(jsObject: object, name: Strings.panTiltZoom) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var alpha: Bool + public var panTiltZoom: Bool +} - @ReadWriteAttribute - public var desynchronized: Bool +public enum CanPlayTypeResult: JSString, JSValueCompatible { + case _empty = "" + case maybe = "maybe" + case probably = "probably" - @ReadWriteAttribute - public var colorSpace: PredefinedColorSpace + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } - @ReadWriteAttribute - public var willReadFrequently: Bool + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public protocol CanvasShadowStyles: JSBridgedClass {} -public extension CanvasShadowStyles { - @inlinable var shadowOffsetX: Double { - get { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] = newValue } +public protocol CanvasCompositing: JSBridgedClass {} +public extension CanvasCompositing { + @inlinable var globalAlpha: Double { + get { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.globalAlpha, in: jsObject] = newValue } } - @inlinable var shadowOffsetY: Double { - get { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] = newValue } + @inlinable var globalCompositeOperation: String { + get { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.globalCompositeOperation, in: jsObject] = newValue } } +} - @inlinable var shadowBlur: Double { - get { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] = newValue } +public enum CanvasDirection: JSString, JSValueCompatible { + case ltr = "ltr" + case rtl = "rtl" + case inherit = "inherit" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil } - @inlinable var shadowColor: String { - get { ReadWriteAttribute[Strings.shadowColor, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.shadowColor, in: jsObject] = newValue } + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public protocol CanvasState: JSBridgedClass {} -public extension CanvasState { - @inlinable func save() { +public protocol CanvasDrawImage: JSBridgedClass {} +public extension CanvasDrawImage { + @inlinable func drawImage(image: CanvasImageSource, dx: Double, dy: Double) { let this = jsObject - _ = this[Strings.save].function!(this: this, arguments: []) + _ = this[Strings.drawImage].function!(this: this, arguments: [image.jsValue, dx.jsValue, dy.jsValue]) } - @inlinable func restore() { + @inlinable func drawImage(image: CanvasImageSource, dx: Double, dy: Double, dw: Double, dh: Double) { let this = jsObject - _ = this[Strings.restore].function!(this: this, arguments: []) + _ = this[Strings.drawImage].function!(this: this, arguments: [image.jsValue, dx.jsValue, dy.jsValue, dw.jsValue, dh.jsValue]) } - @inlinable func reset() { + @inlinable func drawImage(image: CanvasImageSource, sx: Double, sy: Double, sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double) { + let _arg0 = image.jsValue + let _arg1 = sx.jsValue + let _arg2 = sy.jsValue + let _arg3 = sw.jsValue + let _arg4 = sh.jsValue + let _arg5 = dx.jsValue + let _arg6 = dy.jsValue + let _arg7 = dw.jsValue + let _arg8 = dh.jsValue let this = jsObject - _ = this[Strings.reset].function!(this: this, arguments: []) + _ = this[Strings.drawImage].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) } +} - @inlinable func isContextLost() -> Bool { +public protocol CanvasDrawPath: JSBridgedClass {} +public extension CanvasDrawPath { + @inlinable func beginPath() { let this = jsObject - return this[Strings.isContextLost].function!(this: this, arguments: []).fromJSValue()! + _ = this[Strings.beginPath].function!(this: this, arguments: []) } -} -public protocol CanvasText: JSBridgedClass {} -public extension CanvasText { - @inlinable func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { + @inlinable func fill(fillRule: CanvasFillRule? = nil) { let this = jsObject - _ = this[Strings.fillText].function!(this: this, arguments: [text.jsValue, x.jsValue, y.jsValue, maxWidth?.jsValue ?? .undefined]) + _ = this[Strings.fill].function!(this: this, arguments: [fillRule?.jsValue ?? .undefined]) } - @inlinable func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { + @inlinable func fill(path: Path2D, fillRule: CanvasFillRule? = nil) { let this = jsObject - _ = this[Strings.strokeText].function!(this: this, arguments: [text.jsValue, x.jsValue, y.jsValue, maxWidth?.jsValue ?? .undefined]) + _ = this[Strings.fill].function!(this: this, arguments: [path.jsValue, fillRule?.jsValue ?? .undefined]) } - @inlinable func measureText(text: String) -> TextMetrics { + @inlinable func stroke() { let this = jsObject - return this[Strings.measureText].function!(this: this, arguments: [text.jsValue]).fromJSValue()! + _ = this[Strings.stroke].function!(this: this, arguments: []) } -} -public enum CanvasTextAlign: JSString, JSValueCompatible { - case start = "start" - case end = "end" - case left = "left" - case right = "right" - case center = "center" + @inlinable func stroke(path: Path2D) { + let this = jsObject + _ = this[Strings.stroke].function!(this: this, arguments: [path.jsValue]) + } - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + @inlinable func clip(fillRule: CanvasFillRule? = nil) { + let this = jsObject + _ = this[Strings.clip].function!(this: this, arguments: [fillRule?.jsValue ?? .undefined]) } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable func clip(path: Path2D, fillRule: CanvasFillRule? = nil) { + let this = jsObject + _ = this[Strings.clip].function!(this: this, arguments: [path.jsValue, fillRule?.jsValue ?? .undefined]) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } + @inlinable func isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { + let this = jsObject + return this[Strings.isPointInPath].function!(this: this, arguments: [x.jsValue, y.jsValue, fillRule?.jsValue ?? .undefined]).fromJSValue()! + } + + @inlinable func isPointInPath(path: Path2D, x: Double, y: Double, fillRule: CanvasFillRule? = nil) -> Bool { + let this = jsObject + return this[Strings.isPointInPath].function!(this: this, arguments: [path.jsValue, x.jsValue, y.jsValue, fillRule?.jsValue ?? .undefined]).fromJSValue()! + } + + @inlinable func isPointInStroke(x: Double, y: Double) -> Bool { + let this = jsObject + return this[Strings.isPointInStroke].function!(this: this, arguments: [x.jsValue, y.jsValue]).fromJSValue()! + } + + @inlinable func isPointInStroke(path: Path2D, x: Double, y: Double) -> Bool { + let this = jsObject + return this[Strings.isPointInStroke].function!(this: this, arguments: [path.jsValue, x.jsValue, y.jsValue]).fromJSValue()! + } } -public enum CanvasTextBaseline: JSString, JSValueCompatible { - case top = "top" - case hanging = "hanging" - case middle = "middle" - case alphabetic = "alphabetic" - case ideographic = "ideographic" - case bottom = "bottom" +public enum CanvasFillRule: JSString, JSValueCompatible { + case nonzero = "nonzero" + case evenodd = "evenodd" @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -1914,64 +1834,71 @@ public enum CanvasTextBaseline: JSString, JSValueCompatible { @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public protocol CanvasTextDrawingStyles: JSBridgedClass {} -public extension CanvasTextDrawingStyles { - @inlinable var font: String { - get { ReadWriteAttribute[Strings.font, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.font, in: jsObject] = newValue } +public protocol CanvasFillStrokeStyles: JSBridgedClass {} +public extension CanvasFillStrokeStyles { + @inlinable var strokeStyle: CanvasGradient_or_CanvasPattern_or_String { + get { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.strokeStyle, in: jsObject] = newValue } } - @inlinable var textAlign: CanvasTextAlign { - get { ReadWriteAttribute[Strings.textAlign, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.textAlign, in: jsObject] = newValue } + @inlinable var fillStyle: CanvasGradient_or_CanvasPattern_or_String { + get { ReadWriteAttribute[Strings.fillStyle, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.fillStyle, in: jsObject] = newValue } } - @inlinable var textBaseline: CanvasTextBaseline { - get { ReadWriteAttribute[Strings.textBaseline, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.textBaseline, in: jsObject] = newValue } + @inlinable func createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double) -> CanvasGradient { + let this = jsObject + return this[Strings.createLinearGradient].function!(this: this, arguments: [x0.jsValue, y0.jsValue, x1.jsValue, y1.jsValue]).fromJSValue()! } - @inlinable var direction: CanvasDirection { - get { ReadWriteAttribute[Strings.direction, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.direction, in: jsObject] = newValue } + @inlinable func createRadialGradient(x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double) -> CanvasGradient { + let _arg0 = x0.jsValue + let _arg1 = y0.jsValue + let _arg2 = r0.jsValue + let _arg3 = x1.jsValue + let _arg4 = y1.jsValue + let _arg5 = r1.jsValue + let this = jsObject + return this[Strings.createRadialGradient].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]).fromJSValue()! } - @inlinable var letterSpacing: String { - get { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] = newValue } + @inlinable func createConicGradient(startAngle: Double, x: Double, y: Double) -> CanvasGradient { + let this = jsObject + return this[Strings.createConicGradient].function!(this: this, arguments: [startAngle.jsValue, x.jsValue, y.jsValue]).fromJSValue()! } - @inlinable var fontKerning: CanvasFontKerning { - get { ReadWriteAttribute[Strings.fontKerning, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.fontKerning, in: jsObject] = newValue } + @inlinable func createPattern(image: CanvasImageSource, repetition: String) -> CanvasPattern? { + let this = jsObject + return this[Strings.createPattern].function!(this: this, arguments: [image.jsValue, repetition.jsValue]).fromJSValue()! } +} - @inlinable var fontStretch: CanvasFontStretch { - get { ReadWriteAttribute[Strings.fontStretch, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.fontStretch, in: jsObject] = newValue } - } +public class CanvasFilter: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasFilter].function! } - @inlinable var fontVariantCaps: CanvasFontVariantCaps { - get { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] = newValue } + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject } - @inlinable var textRendering: CanvasTextRendering { - get { ReadWriteAttribute[Strings.textRendering, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.textRendering, in: jsObject] = newValue } + @inlinable public convenience init(filters: CanvasFilterInput_or_seq_of_CanvasFilterInput? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [filters?.jsValue ?? .undefined])) } +} - @inlinable var wordSpacing: String { - get { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] = newValue } +public protocol CanvasFilters: JSBridgedClass {} +public extension CanvasFilters { + @inlinable var filter: CanvasFilter_or_String { + get { ReadWriteAttribute[Strings.filter, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.filter, in: jsObject] = newValue } } } -public enum CanvasTextRendering: JSString, JSValueCompatible { +public enum CanvasFontKerning: JSString, JSValueCompatible { case auto = "auto" - case optimizeSpeed = "optimizeSpeed" - case optimizeLegibility = "optimizeLegibility" - case geometricPrecision = "geometricPrecision" + case normal = "normal" + case none = "none" @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -1987,174 +1914,121 @@ public enum CanvasTextRendering: JSString, JSValueCompatible { @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public protocol CanvasTransform: JSBridgedClass {} -public extension CanvasTransform { - @inlinable func scale(x: Double, y: Double) { - let this = jsObject - _ = this[Strings.scale].function!(this: this, arguments: [x.jsValue, y.jsValue]) - } +public enum CanvasFontStretch: JSString, JSValueCompatible { + case ultraCondensed = "ultra-condensed" + case extraCondensed = "extra-condensed" + case condensed = "condensed" + case semiCondensed = "semi-condensed" + case normal = "normal" + case semiExpanded = "semi-expanded" + case expanded = "expanded" + case extraExpanded = "extra-expanded" + case ultraExpanded = "ultra-expanded" - @inlinable func rotate(angle: Double) { - let this = jsObject - _ = this[Strings.rotate].function!(this: this, arguments: [angle.jsValue]) + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil } - @inlinable func translate(x: Double, y: Double) { - let this = jsObject - _ = this[Strings.translate].function!(this: this, arguments: [x.jsValue, y.jsValue]) + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) } - @inlinable func transform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { - let _arg0 = a.jsValue - let _arg1 = b.jsValue - let _arg2 = c.jsValue - let _arg3 = d.jsValue - let _arg4 = e.jsValue - let _arg5 = f.jsValue - let this = jsObject - _ = this[Strings.transform].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } - - @inlinable func getTransform() -> DOMMatrix { - let this = jsObject - return this[Strings.getTransform].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func setTransform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { - let _arg0 = a.jsValue - let _arg1 = b.jsValue - let _arg2 = c.jsValue - let _arg3 = d.jsValue - let _arg4 = e.jsValue - let _arg5 = f.jsValue - let this = jsObject - _ = this[Strings.setTransform].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } - - @inlinable func setTransform(transform: DOMMatrix2DInit? = nil) { - let this = jsObject - _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue ?? .undefined]) - } - - @inlinable func resetTransform() { - let this = jsObject - _ = this[Strings.resetTransform].function!(this: this, arguments: []) - } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public protocol CanvasUserInterface: JSBridgedClass {} -public extension CanvasUserInterface { - @inlinable func drawFocusIfNeeded(element: Element) { - let this = jsObject - _ = this[Strings.drawFocusIfNeeded].function!(this: this, arguments: [element.jsValue]) - } +public enum CanvasFontVariantCaps: JSString, JSValueCompatible { + case normal = "normal" + case smallCaps = "small-caps" + case allSmallCaps = "all-small-caps" + case petiteCaps = "petite-caps" + case allPetiteCaps = "all-petite-caps" + case unicase = "unicase" + case titlingCaps = "titling-caps" - @inlinable func drawFocusIfNeeded(path: Path2D, element: Element) { - let this = jsObject - _ = this[Strings.drawFocusIfNeeded].function!(this: this, arguments: [path.jsValue, element.jsValue]) + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil } - @inlinable func scrollPathIntoView() { - let this = jsObject - _ = this[Strings.scrollPathIntoView].function!(this: this, arguments: []) + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) } - @inlinable func scrollPathIntoView(path: Path2D) { - let this = jsObject - _ = this[Strings.scrollPathIntoView].function!(this: this, arguments: [path.jsValue]) - } + @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CharacterData].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - super.init(unsafelyWrapping: jsObject) - } - - @ReadWriteAttribute - public var data: String - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public func substringData(offset: UInt32, count: UInt32) -> String { - let this = jsObject - return this[Strings.substringData].function!(this: this, arguments: [offset.jsValue, count.jsValue]).fromJSValue()! - } +public class CanvasGradient: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasGradient].function! } - @inlinable public func appendData(data: String) { - let this = jsObject - _ = this[Strings.appendData].function!(this: this, arguments: [data.jsValue]) - } + public let jsObject: JSObject - @inlinable public func insertData(offset: UInt32, data: String) { - let this = jsObject - _ = this[Strings.insertData].function!(this: this, arguments: [offset.jsValue, data.jsValue]) + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject } - @inlinable public func deleteData(offset: UInt32, count: UInt32) { + @inlinable public func addColorStop(offset: Double, color: String) { let this = jsObject - _ = this[Strings.deleteData].function!(this: this, arguments: [offset.jsValue, count.jsValue]) + _ = this[Strings.addColorStop].function!(this: this, arguments: [offset.jsValue, color.jsValue]) } +} - @inlinable public func replaceData(offset: UInt32, count: UInt32, data: String) { +public protocol CanvasImageData: JSBridgedClass {} +public extension CanvasImageData { + @inlinable func createImageData(sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { let this = jsObject - _ = this[Strings.replaceData].function!(this: this, arguments: [offset.jsValue, count.jsValue, data.jsValue]) + return this[Strings.createImageData].function!(this: this, arguments: [sw.jsValue, sh.jsValue, settings?.jsValue ?? .undefined]).fromJSValue()! } -} -public protocol ChildNode: JSBridgedClass {} -public extension ChildNode { - @inlinable func before(nodes: Node_or_String...) { + @inlinable func createImageData(imagedata: ImageData) -> ImageData { let this = jsObject - _ = this[Strings.before].function!(this: this, arguments: nodes.map(\.jsValue)) + return this[Strings.createImageData].function!(this: this, arguments: [imagedata.jsValue]).fromJSValue()! } - @inlinable func after(nodes: Node_or_String...) { + @inlinable func getImageData(sx: Int32, sy: Int32, sw: Int32, sh: Int32, settings: ImageDataSettings? = nil) -> ImageData { let this = jsObject - _ = this[Strings.after].function!(this: this, arguments: nodes.map(\.jsValue)) + return this[Strings.getImageData].function!(this: this, arguments: [sx.jsValue, sy.jsValue, sw.jsValue, sh.jsValue, settings?.jsValue ?? .undefined]).fromJSValue()! } - @inlinable func replaceWith(nodes: Node_or_String...) { + @inlinable func putImageData(imagedata: ImageData, dx: Int32, dy: Int32) { let this = jsObject - _ = this[Strings.replaceWith].function!(this: this, arguments: nodes.map(\.jsValue)) + _ = this[Strings.putImageData].function!(this: this, arguments: [imagedata.jsValue, dx.jsValue, dy.jsValue]) } - @inlinable func remove() { + @inlinable func putImageData(imagedata: ImageData, dx: Int32, dy: Int32, dirtyX: Int32, dirtyY: Int32, dirtyWidth: Int32, dirtyHeight: Int32) { + let _arg0 = imagedata.jsValue + let _arg1 = dx.jsValue + let _arg2 = dy.jsValue + let _arg3 = dirtyX.jsValue + let _arg4 = dirtyY.jsValue + let _arg5 = dirtyWidth.jsValue + let _arg6 = dirtyHeight.jsValue let this = jsObject - _ = this[Strings.remove].function!(this: this, arguments: []) + _ = this[Strings.putImageData].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) } } -public class ClientQueryOptions: BridgedDictionary { - public convenience init(includeUncontrolled: Bool, type: ClientType) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.includeUncontrolled] = includeUncontrolled.jsValue - object[Strings.type] = type.jsValue - self.init(unsafelyWrapping: object) +public protocol CanvasImageSmoothing: JSBridgedClass {} +public extension CanvasImageSmoothing { + @inlinable var imageSmoothingEnabled: Bool { + get { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.imageSmoothingEnabled, in: jsObject] = newValue } } - public required init(unsafelyWrapping object: JSObject) { - _includeUncontrolled = ReadWriteAttribute(jsObject: object, name: Strings.includeUncontrolled) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - super.init(unsafelyWrapping: object) + @inlinable var imageSmoothingQuality: ImageSmoothingQuality { + get { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.imageSmoothingQuality, in: jsObject] = newValue } } - - @ReadWriteAttribute - public var includeUncontrolled: Bool - - @ReadWriteAttribute - public var type: ClientType } -public enum ClientType: JSString, JSValueCompatible { - case window = "window" - case worker = "worker" - case sharedworker = "sharedworker" - case all = "all" +public enum CanvasLineCap: JSString, JSValueCompatible { + case butt = "butt" + case round = "round" + case square = "square" @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -2170,9 +2044,10 @@ public enum ClientType: JSString, JSValueCompatible { @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public enum ColorSpaceConversion: JSString, JSValueCompatible { - case none = "none" - case `default` = "default" +public enum CanvasLineJoin: JSString, JSValueCompatible { + case round = "round" + case bevel = "bevel" + case miter = "miter" @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -2188,265 +2063,859 @@ public enum ColorSpaceConversion: JSString, JSValueCompatible { @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public class Comment: CharacterData { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Comment].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) +public protocol CanvasPath: JSBridgedClass {} +public extension CanvasPath { + @inlinable func closePath() { + let this = jsObject + _ = this[Strings.closePath].function!(this: this, arguments: []) } - @inlinable public convenience init(data: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [data?.jsValue ?? .undefined])) + @inlinable func moveTo(x: Double, y: Double) { + let this = jsObject + _ = this[Strings.moveTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) } -} - -public enum CompositeOperation: JSString, JSValueCompatible { - case replace = "replace" - case add = "add" - case accumulate = "accumulate" - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + @inlinable func lineTo(x: Double, y: Double) { + let this = jsObject + _ = this[Strings.lineTo].function!(this: this, arguments: [x.jsValue, y.jsValue]) } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable func quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double) { + let this = jsObject + _ = this[Strings.quadraticCurveTo].function!(this: this, arguments: [cpx.jsValue, cpy.jsValue, x.jsValue, y.jsValue]) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} - -public enum CompositeOperationOrAuto: JSString, JSValueCompatible { - case replace = "replace" - case add = "add" - case accumulate = "accumulate" - case auto = "auto" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + @inlinable func bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double) { + let _arg0 = cp1x.jsValue + let _arg1 = cp1y.jsValue + let _arg2 = cp2x.jsValue + let _arg3 = cp2y.jsValue + let _arg4 = x.jsValue + let _arg5 = y.jsValue + let this = jsObject + _ = this[Strings.bezierCurveTo].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable func arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double) { + let this = jsObject + _ = this[Strings.arcTo].function!(this: this, arguments: [x1.jsValue, y1.jsValue, x2.jsValue, y2.jsValue, radius.jsValue]) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} - -public class CompositionEvent: UIEvent { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CompositionEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) - super.init(unsafelyWrapping: jsObject) + @inlinable func rect(x: Double, y: Double, w: Double, h: Double) { + let this = jsObject + _ = this[Strings.rect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) } - @inlinable public convenience init(type: String, eventInitDict: CompositionEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) + @inlinable func roundRect(x: Double, y: Double, w: Double, h: Double, radii: DOMPointInit_or_Double_or_seq_of_DOMPointInit_or_Double? = nil) { + let this = jsObject + _ = this[Strings.roundRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue, radii?.jsValue ?? .undefined]) } - @ReadonlyAttribute - public var data: String + @inlinable func arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { + let _arg0 = x.jsValue + let _arg1 = y.jsValue + let _arg2 = radius.jsValue + let _arg3 = startAngle.jsValue + let _arg4 = endAngle.jsValue + let _arg5 = counterclockwise?.jsValue ?? .undefined + let this = jsObject + _ = this[Strings.arc].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } - @inlinable public func initCompositionEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: WindowProxy? = nil, dataArg: String? = nil) { + @inlinable func ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Bool? = nil) { + let _arg0 = x.jsValue + let _arg1 = y.jsValue + let _arg2 = radiusX.jsValue + let _arg3 = radiusY.jsValue + let _arg4 = rotation.jsValue + let _arg5 = startAngle.jsValue + let _arg6 = endAngle.jsValue + let _arg7 = counterclockwise?.jsValue ?? .undefined let this = jsObject - _ = this[Strings.initCompositionEvent].function!(this: this, arguments: [typeArg.jsValue, bubblesArg?.jsValue ?? .undefined, cancelableArg?.jsValue ?? .undefined, viewArg?.jsValue ?? .undefined, dataArg?.jsValue ?? .undefined]) + _ = this[Strings.ellipse].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) } } -public class CompositionEventInit: BridgedDictionary { - public convenience init(data: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.data] = data.jsValue - self.init(unsafelyWrapping: object) +public protocol CanvasPathDrawingStyles: JSBridgedClass {} +public extension CanvasPathDrawingStyles { + @inlinable var lineWidth: Double { + get { ReadWriteAttribute[Strings.lineWidth, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.lineWidth, in: jsObject] = newValue } } - public required init(unsafelyWrapping object: JSObject) { - _data = ReadWriteAttribute(jsObject: object, name: Strings.data) - super.init(unsafelyWrapping: object) + @inlinable var lineCap: CanvasLineCap { + get { ReadWriteAttribute[Strings.lineCap, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.lineCap, in: jsObject] = newValue } } - @ReadWriteAttribute - public var data: String -} + @inlinable var lineJoin: CanvasLineJoin { + get { ReadWriteAttribute[Strings.lineJoin, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.lineJoin, in: jsObject] = newValue } + } -public class ComputedEffectTiming: BridgedDictionary { - public convenience init(progress: Double?, currentIteration: Double?) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.progress] = progress.jsValue - object[Strings.currentIteration] = currentIteration.jsValue - self.init(unsafelyWrapping: object) + @inlinable var miterLimit: Double { + get { ReadWriteAttribute[Strings.miterLimit, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.miterLimit, in: jsObject] = newValue } } - public required init(unsafelyWrapping object: JSObject) { - _progress = ReadWriteAttribute(jsObject: object, name: Strings.progress) - _currentIteration = ReadWriteAttribute(jsObject: object, name: Strings.currentIteration) - super.init(unsafelyWrapping: object) + @inlinable func setLineDash(segments: [Double]) { + let this = jsObject + _ = this[Strings.setLineDash].function!(this: this, arguments: [segments.jsValue]) } - @ReadWriteAttribute - public var progress: Double? + @inlinable func getLineDash() -> [Double] { + let this = jsObject + return this[Strings.getLineDash].function!(this: this, arguments: []).fromJSValue()! + } - @ReadWriteAttribute - public var currentIteration: Double? + @inlinable var lineDashOffset: Double { + get { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.lineDashOffset, in: jsObject] = newValue } + } } -public class ConstrainBooleanParameters: BridgedDictionary { - public convenience init(exact: Bool, ideal: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.exact] = exact.jsValue - object[Strings.ideal] = ideal.jsValue - self.init(unsafelyWrapping: object) - } +public class CanvasPattern: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasPattern].function! } - public required init(unsafelyWrapping object: JSObject) { - _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) - _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) - super.init(unsafelyWrapping: object) - } + public let jsObject: JSObject - @ReadWriteAttribute - public var exact: Bool + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } - @ReadWriteAttribute - public var ideal: Bool + @inlinable public func setTransform(transform: DOMMatrix2DInit? = nil) { + let this = jsObject + _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue ?? .undefined]) + } } -public class ConstrainDOMStringParameters: BridgedDictionary { - public convenience init(exact: String_or_seq_of_String, ideal: String_or_seq_of_String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.exact] = exact.jsValue - object[Strings.ideal] = ideal.jsValue - self.init(unsafelyWrapping: object) +public protocol CanvasRect: JSBridgedClass {} +public extension CanvasRect { + @inlinable func clearRect(x: Double, y: Double, w: Double, h: Double) { + let this = jsObject + _ = this[Strings.clearRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) } - public required init(unsafelyWrapping object: JSObject) { - _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) - _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) - super.init(unsafelyWrapping: object) + @inlinable func fillRect(x: Double, y: Double, w: Double, h: Double) { + let this = jsObject + _ = this[Strings.fillRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) } - @ReadWriteAttribute - public var exact: String_or_seq_of_String - - @ReadWriteAttribute - public var ideal: String_or_seq_of_String + @inlinable func strokeRect(x: Double, y: Double, w: Double, h: Double) { + let this = jsObject + _ = this[Strings.strokeRect].function!(this: this, arguments: [x.jsValue, y.jsValue, w.jsValue, h.jsValue]) + } } -public class ConstrainDoubleRange: BridgedDictionary { - public convenience init(exact: Double, ideal: Double) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.exact] = exact.jsValue - object[Strings.ideal] = ideal.jsValue - self.init(unsafelyWrapping: object) - } +public class CanvasRenderingContext2D: JSBridgedClass, CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CanvasRenderingContext2D].function! } - public required init(unsafelyWrapping object: JSObject) { - _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) - _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) - super.init(unsafelyWrapping: object) + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _canvas = ReadonlyAttribute(jsObject: jsObject, name: Strings.canvas) + self.jsObject = jsObject } - @ReadWriteAttribute - public var exact: Double + @ReadonlyAttribute + public var canvas: HTMLCanvasElement - @ReadWriteAttribute - public var ideal: Double + @inlinable public func getContextAttributes() -> CanvasRenderingContext2DSettings { + let this = jsObject + return this[Strings.getContextAttributes].function!(this: this, arguments: []).fromJSValue()! + } } -public class ConstrainULongRange: BridgedDictionary { - public convenience init(exact: UInt32, ideal: UInt32) { +public class CanvasRenderingContext2DSettings: BridgedDictionary { + public convenience init(alpha: Bool, desynchronized: Bool, colorSpace: PredefinedColorSpace, willReadFrequently: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.exact] = exact.jsValue - object[Strings.ideal] = ideal.jsValue + object[Strings.alpha] = alpha.jsValue + object[Strings.desynchronized] = desynchronized.jsValue + object[Strings.colorSpace] = colorSpace.jsValue + object[Strings.willReadFrequently] = willReadFrequently.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) - _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _desynchronized = ReadWriteAttribute(jsObject: object, name: Strings.desynchronized) + _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) + _willReadFrequently = ReadWriteAttribute(jsObject: object, name: Strings.willReadFrequently) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var exact: UInt32 + public var alpha: Bool @ReadWriteAttribute - public var ideal: UInt32 -} + public var desynchronized: Bool -public class CountQueuingStrategy: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CountQueuingStrategy].function! } + @ReadWriteAttribute + public var colorSpace: PredefinedColorSpace - public let jsObject: JSObject + @ReadWriteAttribute + public var willReadFrequently: Bool +} - public required init(unsafelyWrapping jsObject: JSObject) { - _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: Strings.highWaterMark) - _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) - self.jsObject = jsObject +public protocol CanvasShadowStyles: JSBridgedClass {} +public extension CanvasShadowStyles { + @inlinable var shadowOffsetX: Double { + get { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.shadowOffsetX, in: jsObject] = newValue } } - @inlinable public convenience init(init: QueuingStrategyInit) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + @inlinable var shadowOffsetY: Double { + get { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.shadowOffsetY, in: jsObject] = newValue } } - @ReadonlyAttribute - public var highWaterMark: Double + @inlinable var shadowBlur: Double { + get { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.shadowBlur, in: jsObject] = newValue } + } - @ReadonlyAttribute - public var size: JSFunction + @inlinable var shadowColor: String { + get { ReadWriteAttribute[Strings.shadowColor, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.shadowColor, in: jsObject] = newValue } + } } -public class CustomElementRegistry: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CustomElementRegistry].function! } - - public let jsObject: JSObject +public protocol CanvasState: JSBridgedClass {} +public extension CanvasState { + @inlinable func save() { + let this = jsObject + _ = this[Strings.save].function!(this: this, arguments: []) + } - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject + @inlinable func restore() { + let this = jsObject + _ = this[Strings.restore].function!(this: this, arguments: []) } - @inlinable public func define(name: String, constructor: CustomElementConstructor, options: ElementDefinitionOptions? = nil) { + @inlinable func reset() { let this = jsObject - _ = this[Strings.define].function!(this: this, arguments: [name.jsValue, constructor.jsValue, options?.jsValue ?? .undefined]) + _ = this[Strings.reset].function!(this: this, arguments: []) } - @inlinable public func get(name: String) -> CustomElementConstructor? { + @inlinable func isContextLost() -> Bool { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + return this[Strings.isContextLost].function!(this: this, arguments: []).fromJSValue()! } +} - @inlinable public func whenDefined(name: String) -> JSPromise { +public protocol CanvasText: JSBridgedClass {} +public extension CanvasText { + @inlinable func fillText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { let this = jsObject - return this[Strings.whenDefined].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + _ = this[Strings.fillText].function!(this: this, arguments: [text.jsValue, x.jsValue, y.jsValue, maxWidth?.jsValue ?? .undefined]) } - @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - @inlinable public func whenDefined(name: String) async throws -> CustomElementConstructor { + @inlinable func strokeText(text: String, x: Double, y: Double, maxWidth: Double? = nil) { let this = jsObject - let _promise: JSPromise = this[Strings.whenDefined].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - return try await _promise.value.fromJSValue()! + _ = this[Strings.strokeText].function!(this: this, arguments: [text.jsValue, x.jsValue, y.jsValue, maxWidth?.jsValue ?? .undefined]) } - @inlinable public func upgrade(root: Node) { + @inlinable func measureText(text: String) -> TextMetrics { let this = jsObject - _ = this[Strings.upgrade].function!(this: this, arguments: [root.jsValue]) + return this[Strings.measureText].function!(this: this, arguments: [text.jsValue]).fromJSValue()! } } -public class CustomEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CustomEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) - super.init(unsafelyWrapping: jsObject) - } +public enum CanvasTextAlign: JSString, JSValueCompatible { + case start = "start" + case end = "end" + case left = "left" + case right = "right" + case center = "center" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public enum CanvasTextBaseline: JSString, JSValueCompatible { + case top = "top" + case hanging = "hanging" + case middle = "middle" + case alphabetic = "alphabetic" + case ideographic = "ideographic" + case bottom = "bottom" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public protocol CanvasTextDrawingStyles: JSBridgedClass {} +public extension CanvasTextDrawingStyles { + @inlinable var font: String { + get { ReadWriteAttribute[Strings.font, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.font, in: jsObject] = newValue } + } + + @inlinable var textAlign: CanvasTextAlign { + get { ReadWriteAttribute[Strings.textAlign, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.textAlign, in: jsObject] = newValue } + } + + @inlinable var textBaseline: CanvasTextBaseline { + get { ReadWriteAttribute[Strings.textBaseline, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.textBaseline, in: jsObject] = newValue } + } + + @inlinable var direction: CanvasDirection { + get { ReadWriteAttribute[Strings.direction, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.direction, in: jsObject] = newValue } + } + + @inlinable var letterSpacing: String { + get { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.letterSpacing, in: jsObject] = newValue } + } + + @inlinable var fontKerning: CanvasFontKerning { + get { ReadWriteAttribute[Strings.fontKerning, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.fontKerning, in: jsObject] = newValue } + } + + @inlinable var fontStretch: CanvasFontStretch { + get { ReadWriteAttribute[Strings.fontStretch, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.fontStretch, in: jsObject] = newValue } + } + + @inlinable var fontVariantCaps: CanvasFontVariantCaps { + get { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.fontVariantCaps, in: jsObject] = newValue } + } + + @inlinable var textRendering: CanvasTextRendering { + get { ReadWriteAttribute[Strings.textRendering, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.textRendering, in: jsObject] = newValue } + } + + @inlinable var wordSpacing: String { + get { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.wordSpacing, in: jsObject] = newValue } + } +} + +public enum CanvasTextRendering: JSString, JSValueCompatible { + case auto = "auto" + case optimizeSpeed = "optimizeSpeed" + case optimizeLegibility = "optimizeLegibility" + case geometricPrecision = "geometricPrecision" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public protocol CanvasTransform: JSBridgedClass {} +public extension CanvasTransform { + @inlinable func scale(x: Double, y: Double) { + let this = jsObject + _ = this[Strings.scale].function!(this: this, arguments: [x.jsValue, y.jsValue]) + } + + @inlinable func rotate(angle: Double) { + let this = jsObject + _ = this[Strings.rotate].function!(this: this, arguments: [angle.jsValue]) + } + + @inlinable func translate(x: Double, y: Double) { + let this = jsObject + _ = this[Strings.translate].function!(this: this, arguments: [x.jsValue, y.jsValue]) + } + + @inlinable func transform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { + let _arg0 = a.jsValue + let _arg1 = b.jsValue + let _arg2 = c.jsValue + let _arg3 = d.jsValue + let _arg4 = e.jsValue + let _arg5 = f.jsValue + let this = jsObject + _ = this[Strings.transform].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } + + @inlinable func getTransform() -> DOMMatrix { + let this = jsObject + return this[Strings.getTransform].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func setTransform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double) { + let _arg0 = a.jsValue + let _arg1 = b.jsValue + let _arg2 = c.jsValue + let _arg3 = d.jsValue + let _arg4 = e.jsValue + let _arg5 = f.jsValue + let this = jsObject + _ = this[Strings.setTransform].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } + + @inlinable func setTransform(transform: DOMMatrix2DInit? = nil) { + let this = jsObject + _ = this[Strings.setTransform].function!(this: this, arguments: [transform?.jsValue ?? .undefined]) + } + + @inlinable func resetTransform() { + let this = jsObject + _ = this[Strings.resetTransform].function!(this: this, arguments: []) + } +} + +public protocol CanvasUserInterface: JSBridgedClass {} +public extension CanvasUserInterface { + @inlinable func drawFocusIfNeeded(element: Element) { + let this = jsObject + _ = this[Strings.drawFocusIfNeeded].function!(this: this, arguments: [element.jsValue]) + } + + @inlinable func drawFocusIfNeeded(path: Path2D, element: Element) { + let this = jsObject + _ = this[Strings.drawFocusIfNeeded].function!(this: this, arguments: [path.jsValue, element.jsValue]) + } + + @inlinable func scrollPathIntoView() { + let this = jsObject + _ = this[Strings.scrollPathIntoView].function!(this: this, arguments: []) + } + + @inlinable func scrollPathIntoView(path: Path2D) { + let this = jsObject + _ = this[Strings.scrollPathIntoView].function!(this: this, arguments: [path.jsValue]) + } +} + +public class CharacterData: Node, NonDocumentTypeChildNode, ChildNode { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CharacterData].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadWriteAttribute(jsObject: jsObject, name: Strings.data) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + super.init(unsafelyWrapping: jsObject) + } + + @ReadWriteAttribute + public var data: String + + @ReadonlyAttribute + public var length: UInt32 + + @inlinable public func substringData(offset: UInt32, count: UInt32) -> String { + let this = jsObject + return this[Strings.substringData].function!(this: this, arguments: [offset.jsValue, count.jsValue]).fromJSValue()! + } + + @inlinable public func appendData(data: String) { + let this = jsObject + _ = this[Strings.appendData].function!(this: this, arguments: [data.jsValue]) + } + + @inlinable public func insertData(offset: UInt32, data: String) { + let this = jsObject + _ = this[Strings.insertData].function!(this: this, arguments: [offset.jsValue, data.jsValue]) + } + + @inlinable public func deleteData(offset: UInt32, count: UInt32) { + let this = jsObject + _ = this[Strings.deleteData].function!(this: this, arguments: [offset.jsValue, count.jsValue]) + } + + @inlinable public func replaceData(offset: UInt32, count: UInt32, data: String) { + let this = jsObject + _ = this[Strings.replaceData].function!(this: this, arguments: [offset.jsValue, count.jsValue, data.jsValue]) + } +} + +public protocol ChildNode: JSBridgedClass {} +public extension ChildNode { + @inlinable func before(nodes: Node_or_String...) { + let this = jsObject + _ = this[Strings.before].function!(this: this, arguments: nodes.map(\.jsValue)) + } + + @inlinable func after(nodes: Node_or_String...) { + let this = jsObject + _ = this[Strings.after].function!(this: this, arguments: nodes.map(\.jsValue)) + } + + @inlinable func replaceWith(nodes: Node_or_String...) { + let this = jsObject + _ = this[Strings.replaceWith].function!(this: this, arguments: nodes.map(\.jsValue)) + } + + @inlinable func remove() { + let this = jsObject + _ = this[Strings.remove].function!(this: this, arguments: []) + } +} + +public class ClientQueryOptions: BridgedDictionary { + public convenience init(includeUncontrolled: Bool, type: ClientType) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.includeUncontrolled] = includeUncontrolled.jsValue + object[Strings.type] = type.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _includeUncontrolled = ReadWriteAttribute(jsObject: object, name: Strings.includeUncontrolled) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var includeUncontrolled: Bool + + @ReadWriteAttribute + public var type: ClientType +} + +public enum ClientType: JSString, JSValueCompatible { + case window = "window" + case worker = "worker" + case sharedworker = "sharedworker" + case all = "all" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public enum CodecState: JSString, JSValueCompatible { + case unconfigured = "unconfigured" + case configured = "configured" + case closed = "closed" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public enum ColorSpaceConversion: JSString, JSValueCompatible { + case none = "none" + case `default` = "default" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class Comment: CharacterData { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Comment].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(data: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data?.jsValue ?? .undefined])) + } +} + +public enum CompositeOperation: JSString, JSValueCompatible { + case replace = "replace" + case add = "add" + case accumulate = "accumulate" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public enum CompositeOperationOrAuto: JSString, JSValueCompatible { + case replace = "replace" + case add = "add" + case accumulate = "accumulate" + case auto = "auto" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class CompositionEvent: UIEvent { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CompositionEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _data = ReadonlyAttribute(jsObject: jsObject, name: Strings.data) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(type: String, eventInitDict: CompositionEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) + } + + @ReadonlyAttribute + public var data: String + + @inlinable public func initCompositionEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: WindowProxy? = nil, dataArg: String? = nil) { + let this = jsObject + _ = this[Strings.initCompositionEvent].function!(this: this, arguments: [typeArg.jsValue, bubblesArg?.jsValue ?? .undefined, cancelableArg?.jsValue ?? .undefined, viewArg?.jsValue ?? .undefined, dataArg?.jsValue ?? .undefined]) + } +} + +public class CompositionEventInit: BridgedDictionary { + public convenience init(data: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.data] = data.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var data: String +} + +public class ComputedEffectTiming: BridgedDictionary { + public convenience init(progress: Double?, currentIteration: Double?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.progress] = progress.jsValue + object[Strings.currentIteration] = currentIteration.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _progress = ReadWriteAttribute(jsObject: object, name: Strings.progress) + _currentIteration = ReadWriteAttribute(jsObject: object, name: Strings.currentIteration) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var progress: Double? + + @ReadWriteAttribute + public var currentIteration: Double? +} + +public class ConstrainBooleanParameters: BridgedDictionary { + public convenience init(exact: Bool, ideal: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) + _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var exact: Bool + + @ReadWriteAttribute + public var ideal: Bool +} + +public class ConstrainDOMStringParameters: BridgedDictionary { + public convenience init(exact: String_or_seq_of_String, ideal: String_or_seq_of_String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) + _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var exact: String_or_seq_of_String + + @ReadWriteAttribute + public var ideal: String_or_seq_of_String +} + +public class ConstrainDoubleRange: BridgedDictionary { + public convenience init(exact: Double, ideal: Double) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) + _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var exact: Double + + @ReadWriteAttribute + public var ideal: Double +} + +public class ConstrainULongRange: BridgedDictionary { + public convenience init(exact: UInt32, ideal: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.exact] = exact.jsValue + object[Strings.ideal] = ideal.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _exact = ReadWriteAttribute(jsObject: object, name: Strings.exact) + _ideal = ReadWriteAttribute(jsObject: object, name: Strings.ideal) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var exact: UInt32 + + @ReadWriteAttribute + public var ideal: UInt32 +} + +public class CountQueuingStrategy: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CountQueuingStrategy].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _highWaterMark = ReadonlyAttribute(jsObject: jsObject, name: Strings.highWaterMark) + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: QueuingStrategyInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var highWaterMark: Double + + @ReadonlyAttribute + public var size: JSFunction +} + +public class CustomElementRegistry: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.CustomElementRegistry].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + @inlinable public func define(name: String, constructor: CustomElementConstructor, options: ElementDefinitionOptions? = nil) { + let this = jsObject + _ = this[Strings.define].function!(this: this, arguments: [name.jsValue, constructor.jsValue, options?.jsValue ?? .undefined]) + } + + @inlinable public func get(name: String) -> CustomElementConstructor? { + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + } + + @inlinable public func whenDefined(name: String) -> JSPromise { + let this = jsObject + return this[Strings.whenDefined].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func whenDefined(name: String) async throws -> CustomElementConstructor { + let this = jsObject + let _promise: JSPromise = this[Strings.whenDefined].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } + + @inlinable public func upgrade(root: Node) { + let this = jsObject + _ = this[Strings.upgrade].function!(this: this, arguments: [root.jsValue]) + } +} + +public class CustomEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.CustomEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) + super.init(unsafelyWrapping: jsObject) + } @inlinable public convenience init(type: String, eventInitDict: CustomEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) @@ -4557,98 +5026,308 @@ public extension ElementContentEditable { nonmutating set { ReadWriteAttribute[Strings.enterKeyHint, in: jsObject] = newValue } } - @inlinable var isContentEditable: Bool { ReadonlyAttribute[Strings.isContentEditable, in: jsObject] } + @inlinable var isContentEditable: Bool { ReadonlyAttribute[Strings.isContentEditable, in: jsObject] } + + @inlinable var inputMode: String { + get { ReadWriteAttribute[Strings.inputMode, in: jsObject] } + nonmutating set { ReadWriteAttribute[Strings.inputMode, in: jsObject] = newValue } + } +} + +public class ElementCreationOptions: BridgedDictionary { + public convenience init(is: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.is] = `is`.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _is = ReadWriteAttribute(jsObject: object, name: Strings.is) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var `is`: String +} + +public class ElementDefinitionOptions: BridgedDictionary { + public convenience init(extends: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.extends] = extends.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _extends = ReadWriteAttribute(jsObject: object, name: Strings.extends) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var extends: String +} + +public class ElementInternals: JSBridgedClass, ARIAMixin { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ElementInternals].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.shadowRoot) + _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) + _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.willValidate) + _validity = ReadonlyAttribute(jsObject: jsObject, name: Strings.validity) + _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Strings.validationMessage) + _labels = ReadonlyAttribute(jsObject: jsObject, name: Strings.labels) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var shadowRoot: ShadowRoot? + + @inlinable public func setFormValue(value: File_or_FormData_or_String?, state: File_or_FormData_or_String? = nil) { + let this = jsObject + _ = this[Strings.setFormValue].function!(this: this, arguments: [value.jsValue, state?.jsValue ?? .undefined]) + } + + @ReadonlyAttribute + public var form: HTMLFormElement? + + @inlinable public func setValidity(flags: ValidityStateFlags? = nil, message: String? = nil, anchor: HTMLElement? = nil) { + let this = jsObject + _ = this[Strings.setValidity].function!(this: this, arguments: [flags?.jsValue ?? .undefined, message?.jsValue ?? .undefined, anchor?.jsValue ?? .undefined]) + } + + @ReadonlyAttribute + public var willValidate: Bool + + @ReadonlyAttribute + public var validity: ValidityState + + @ReadonlyAttribute + public var validationMessage: String + + @inlinable public func checkValidity() -> Bool { + let this = jsObject + return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable public func reportValidity() -> Bool { + let this = jsObject + return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! + } + + @ReadonlyAttribute + public var labels: NodeList +} + +public class EncodedAudioChunk: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EncodedAudioChunk].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _byteLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.byteLength) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: EncodedAudioChunkInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var type: EncodedAudioChunkType + + @ReadonlyAttribute + public var timestamp: Int64 + + @ReadonlyAttribute + public var duration: UInt64? - @inlinable var inputMode: String { - get { ReadWriteAttribute[Strings.inputMode, in: jsObject] } - nonmutating set { ReadWriteAttribute[Strings.inputMode, in: jsObject] = newValue } + @ReadonlyAttribute + public var byteLength: UInt32 + + @inlinable public func copyTo(destination: BufferSource) { + let this = jsObject + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue]) } } -public class ElementCreationOptions: BridgedDictionary { - public convenience init(is: String) { +public class EncodedAudioChunkInit: BridgedDictionary { + public convenience init(type: EncodedAudioChunkType, timestamp: Int64, duration: UInt64, data: BufferSource) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.is] = `is`.jsValue + object[Strings.type] = type.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.data] = data.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _is = ReadWriteAttribute(jsObject: object, name: Strings.is) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var `is`: String + public var type: EncodedAudioChunkType + + @ReadWriteAttribute + public var timestamp: Int64 + + @ReadWriteAttribute + public var duration: UInt64 + + @ReadWriteAttribute + public var data: BufferSource } -public class ElementDefinitionOptions: BridgedDictionary { - public convenience init(extends: String) { +public class EncodedAudioChunkMetadata: BridgedDictionary { + public convenience init(decoderConfig: AudioDecoderConfig) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.extends] = extends.jsValue + object[Strings.decoderConfig] = decoderConfig.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _extends = ReadWriteAttribute(jsObject: object, name: Strings.extends) + _decoderConfig = ReadWriteAttribute(jsObject: object, name: Strings.decoderConfig) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var extends: String + public var decoderConfig: AudioDecoderConfig } -public class ElementInternals: JSBridgedClass, ARIAMixin { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ElementInternals].function! } +public enum EncodedAudioChunkType: JSString, JSValueCompatible { + case key = "key" + case delta = "delta" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class EncodedVideoChunk: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.EncodedVideoChunk].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _shadowRoot = ReadonlyAttribute(jsObject: jsObject, name: Strings.shadowRoot) - _form = ReadonlyAttribute(jsObject: jsObject, name: Strings.form) - _willValidate = ReadonlyAttribute(jsObject: jsObject, name: Strings.willValidate) - _validity = ReadonlyAttribute(jsObject: jsObject, name: Strings.validity) - _validationMessage = ReadonlyAttribute(jsObject: jsObject, name: Strings.validationMessage) - _labels = ReadonlyAttribute(jsObject: jsObject, name: Strings.labels) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _byteLength = ReadonlyAttribute(jsObject: jsObject, name: Strings.byteLength) self.jsObject = jsObject } - @ReadonlyAttribute - public var shadowRoot: ShadowRoot? - - @inlinable public func setFormValue(value: File_or_FormData_or_String?, state: File_or_FormData_or_String? = nil) { - let this = jsObject - _ = this[Strings.setFormValue].function!(this: this, arguments: [value.jsValue, state?.jsValue ?? .undefined]) + @inlinable public convenience init(init: EncodedVideoChunkInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } @ReadonlyAttribute - public var form: HTMLFormElement? - - @inlinable public func setValidity(flags: ValidityStateFlags? = nil, message: String? = nil, anchor: HTMLElement? = nil) { - let this = jsObject - _ = this[Strings.setValidity].function!(this: this, arguments: [flags?.jsValue ?? .undefined, message?.jsValue ?? .undefined, anchor?.jsValue ?? .undefined]) - } + public var type: EncodedVideoChunkType @ReadonlyAttribute - public var willValidate: Bool + public var timestamp: Int64 @ReadonlyAttribute - public var validity: ValidityState + public var duration: UInt64? @ReadonlyAttribute - public var validationMessage: String + public var byteLength: UInt32 - @inlinable public func checkValidity() -> Bool { + @inlinable public func copyTo(destination: BufferSource) { let this = jsObject - return this[Strings.checkValidity].function!(this: this, arguments: []).fromJSValue()! + _ = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue]) } +} - @inlinable public func reportValidity() -> Bool { - let this = jsObject - return this[Strings.reportValidity].function!(this: this, arguments: []).fromJSValue()! +public class EncodedVideoChunkInit: BridgedDictionary { + public convenience init(type: EncodedVideoChunkType, timestamp: Int64, duration: UInt64, data: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.data] = data.jsValue + self.init(unsafelyWrapping: object) } - @ReadonlyAttribute - public var labels: NodeList + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: EncodedVideoChunkType + + @ReadWriteAttribute + public var timestamp: Int64 + + @ReadWriteAttribute + public var duration: UInt64 + + @ReadWriteAttribute + public var data: BufferSource +} + +public class EncodedVideoChunkMetadata: BridgedDictionary { + public convenience init(decoderConfig: VideoDecoderConfig, svc: SvcOutputMetadata, alphaSideData: BufferSource) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.decoderConfig] = decoderConfig.jsValue + object[Strings.svc] = svc.jsValue + object[Strings.alphaSideData] = alphaSideData.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _decoderConfig = ReadWriteAttribute(jsObject: object, name: Strings.decoderConfig) + _svc = ReadWriteAttribute(jsObject: object, name: Strings.svc) + _alphaSideData = ReadWriteAttribute(jsObject: object, name: Strings.alphaSideData) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var decoderConfig: VideoDecoderConfig + + @ReadWriteAttribute + public var svc: SvcOutputMetadata + + @ReadWriteAttribute + public var alphaSideData: BufferSource +} + +public enum EncodedVideoChunkType: JSString, JSValueCompatible { + case key = "key" + case delta = "delta" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } } public enum EndingType: JSString, JSValueCompatible { @@ -9183,6 +9862,25 @@ public class HTMLVideoElement: HTMLMediaElement { public var playsInline: Bool } +public enum HardwareAcceleration: JSString, JSValueCompatible { + case noPreference = "no-preference" + case preferHardware = "prefer-hardware" + case preferSoftware = "prefer-software" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + public class HashChangeEvent: Event { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.HashChangeEvent].function! } @@ -9455,13 +10153,165 @@ public class ImageDataSettings: BridgedDictionary { self.init(unsafelyWrapping: object) } - public required init(unsafelyWrapping object: JSObject) { - _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) - super.init(unsafelyWrapping: object) - } + public required init(unsafelyWrapping object: JSObject) { + _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var colorSpace: PredefinedColorSpace +} + +public class ImageDecodeOptions: BridgedDictionary { + public convenience init(frameIndex: UInt32, completeFramesOnly: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.frameIndex] = frameIndex.jsValue + object[Strings.completeFramesOnly] = completeFramesOnly.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _frameIndex = ReadWriteAttribute(jsObject: object, name: Strings.frameIndex) + _completeFramesOnly = ReadWriteAttribute(jsObject: object, name: Strings.completeFramesOnly) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var frameIndex: UInt32 + + @ReadWriteAttribute + public var completeFramesOnly: Bool +} + +public class ImageDecodeResult: BridgedDictionary { + public convenience init(image: VideoFrame, complete: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.image] = image.jsValue + object[Strings.complete] = complete.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _image = ReadWriteAttribute(jsObject: object, name: Strings.image) + _complete = ReadWriteAttribute(jsObject: object, name: Strings.complete) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var image: VideoFrame + + @ReadWriteAttribute + public var complete: Bool +} + +public class ImageDecoder: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageDecoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _complete = ReadonlyAttribute(jsObject: jsObject, name: Strings.complete) + _completed = ReadonlyAttribute(jsObject: jsObject, name: Strings.completed) + _tracks = ReadonlyAttribute(jsObject: jsObject, name: Strings.tracks) + self.jsObject = jsObject + } + + @inlinable public convenience init(init: ImageDecoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) + } + + @ReadonlyAttribute + public var type: String + + @ReadonlyAttribute + public var complete: Bool + + @ReadonlyAttribute + public var completed: JSPromise + + @ReadonlyAttribute + public var tracks: ImageTrackList + + @inlinable public func decode(options: ImageDecodeOptions? = nil) -> JSPromise { + let this = jsObject + return this[Strings.decode].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func decode(options: ImageDecodeOptions? = nil) async throws -> ImageDecodeResult { + let this = jsObject + let _promise: JSPromise = this[Strings.decode].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } + + @inlinable public func reset() { + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) + } + + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } + + @inlinable public static func isTypeSupported(type: String) -> JSPromise { + let this = constructor + return this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public static func isTypeSupported(type: String) async throws -> Bool { + let this = constructor + let _promise: JSPromise = this[Strings.isTypeSupported].function!(this: this, arguments: [type.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } +} + +public class ImageDecoderInit: BridgedDictionary { + public convenience init(type: String, data: ImageBufferSource, premultiplyAlpha: PremultiplyAlpha, colorSpaceConversion: ColorSpaceConversion, desiredWidth: UInt32, desiredHeight: UInt32, preferAnimation: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.type] = type.jsValue + object[Strings.data] = data.jsValue + object[Strings.premultiplyAlpha] = premultiplyAlpha.jsValue + object[Strings.colorSpaceConversion] = colorSpaceConversion.jsValue + object[Strings.desiredWidth] = desiredWidth.jsValue + object[Strings.desiredHeight] = desiredHeight.jsValue + object[Strings.preferAnimation] = preferAnimation.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _data = ReadWriteAttribute(jsObject: object, name: Strings.data) + _premultiplyAlpha = ReadWriteAttribute(jsObject: object, name: Strings.premultiplyAlpha) + _colorSpaceConversion = ReadWriteAttribute(jsObject: object, name: Strings.colorSpaceConversion) + _desiredWidth = ReadWriteAttribute(jsObject: object, name: Strings.desiredWidth) + _desiredHeight = ReadWriteAttribute(jsObject: object, name: Strings.desiredHeight) + _preferAnimation = ReadWriteAttribute(jsObject: object, name: Strings.preferAnimation) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var type: String + + @ReadWriteAttribute + public var data: ImageBufferSource + + @ReadWriteAttribute + public var premultiplyAlpha: PremultiplyAlpha + + @ReadWriteAttribute + public var colorSpaceConversion: ColorSpaceConversion + + @ReadWriteAttribute + public var desiredWidth: UInt32 @ReadWriteAttribute - public var colorSpace: PredefinedColorSpace + public var desiredHeight: UInt32 + + @ReadWriteAttribute + public var preferAnimation: Bool } public class ImageEncodeOptions: BridgedDictionary { @@ -9522,6 +10372,64 @@ public enum ImageSmoothingQuality: JSString, JSValueCompatible { @inlinable public var jsValue: JSValue { rawValue.jsValue } } +public class ImageTrack: EventTarget { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.ImageTrack].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _animated = ReadonlyAttribute(jsObject: jsObject, name: Strings.animated) + _frameCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.frameCount) + _repetitionCount = ReadonlyAttribute(jsObject: jsObject, name: Strings.repetitionCount) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) + _selected = ReadWriteAttribute(jsObject: jsObject, name: Strings.selected) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var animated: Bool + + @ReadonlyAttribute + public var frameCount: UInt32 + + @ReadonlyAttribute + public var repetitionCount: Float + + @ClosureAttribute1Optional + public var onchange: EventHandler + + @ReadWriteAttribute + public var selected: Bool +} + +public class ImageTrackList: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ImageTrackList].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready) + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedIndex) + _selectedTrack = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedTrack) + self.jsObject = jsObject + } + + @inlinable public subscript(key: Int) -> ImageTrack { + jsObject[key].fromJSValue()! + } + + @ReadonlyAttribute + public var ready: JSPromise + + @ReadonlyAttribute + public var length: UInt32 + + @ReadonlyAttribute + public var selectedIndex: Int32 + + @ReadonlyAttribute + public var selectedTrack: ImageTrack? +} + public class InputDeviceInfo: MediaDeviceInfo { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.InputDeviceInfo].function! } @@ -9795,6 +10703,24 @@ public class KeyframeEffectOptions: BridgedDictionary { public var pseudoElement: String? } +public enum LatencyMode: JSString, JSValueCompatible { + case quality = "quality" + case realtime = "realtime" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + public class Location: JSBridgedClass { @inlinable public class var constructor: JSFunction { JSObject.global[Strings.Location].function! } @@ -11959,6 +12885,27 @@ public class Performance: EventTarget { } } +public class PlaneLayout: BridgedDictionary { + public convenience init(offset: UInt32, stride: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.offset] = offset.jsValue + object[Strings.stride] = stride.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _offset = ReadWriteAttribute(jsObject: object, name: Strings.offset) + _stride = ReadWriteAttribute(jsObject: object, name: Strings.stride) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var offset: UInt32 + + @ReadWriteAttribute + public var stride: UInt32 +} + public enum PlaybackDirection: JSString, JSValueCompatible { case normal = "normal" case reverse = "reverse" @@ -13796,6 +14743,22 @@ public class SubmitEventInit: BridgedDictionary { public var submitter: HTMLElement? } +public class SvcOutputMetadata: BridgedDictionary { + public convenience init(temporalLayerId: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.temporalLayerId] = temporalLayerId.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _temporalLayerId = ReadWriteAttribute(jsObject: object, name: Strings.temporalLayerId) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var temporalLayerId: UInt32 +} + public class Text: CharacterData, Slottable { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.Text].function! } @@ -14054,670 +15017,1372 @@ public enum TextTrackMode: JSString, JSValueCompatible { return nil } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class TimeRanges: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TimeRanges].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var length: UInt32 + + @inlinable public func start(index: UInt32) -> Double { + let this = jsObject + return this[Strings.start].function!(this: this, arguments: [index.jsValue]).fromJSValue()! + } + + @inlinable public func end(index: UInt32) -> Double { + let this = jsObject + return this[Strings.end].function!(this: this, arguments: [index.jsValue]).fromJSValue()! + } +} + +public enum TimelinePhase: JSString, JSValueCompatible { + case inactive = "inactive" + case before = "before" + case active = "active" + case after = "after" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class TrackEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TrackEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(type: String, eventInitDict: TrackEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) + } + + @ReadonlyAttribute + public var track: AudioTrack_or_TextTrack_or_VideoTrack? +} + +public class TrackEventInit: BridgedDictionary { + public convenience init(track: AudioTrack_or_TextTrack_or_VideoTrack?) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.track] = track.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _track = ReadWriteAttribute(jsObject: object, name: Strings.track) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var track: AudioTrack_or_TextTrack_or_VideoTrack? +} + +public class TransformStream: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TransformStream].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _readable = ReadonlyAttribute(jsObject: jsObject, name: Strings.readable) + _writable = ReadonlyAttribute(jsObject: jsObject, name: Strings.writable) + self.jsObject = jsObject + } + + @inlinable public convenience init(transformer: JSObject? = nil, writableStrategy: QueuingStrategy? = nil, readableStrategy: QueuingStrategy? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [transformer?.jsValue ?? .undefined, writableStrategy?.jsValue ?? .undefined, readableStrategy?.jsValue ?? .undefined])) + } + + @ReadonlyAttribute + public var readable: ReadableStream + + @ReadonlyAttribute + public var writable: WritableStream +} + +public class TransformStreamDefaultController: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TransformStreamDefaultController].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.desiredSize) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var desiredSize: Double? + + @inlinable public func enqueue(chunk: JSValue? = nil) { + let this = jsObject + _ = this[Strings.enqueue].function!(this: this, arguments: [chunk?.jsValue ?? .undefined]) + } + + @inlinable public func error(reason: JSValue? = nil) { + let this = jsObject + _ = this[Strings.error].function!(this: this, arguments: [reason?.jsValue ?? .undefined]) + } + + @inlinable public func terminate() { + let this = jsObject + _ = this[Strings.terminate].function!(this: this, arguments: []) + } +} + +public class Transformer: BridgedDictionary { + public convenience init(start: @escaping TransformerStartCallback, transform: @escaping TransformerTransformCallback, flush: @escaping TransformerFlushCallback, readableType: JSValue, writableType: JSValue) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute1[Strings.start, in: object] = start + ClosureAttribute2[Strings.transform, in: object] = transform + ClosureAttribute1[Strings.flush, in: object] = flush + object[Strings.readableType] = readableType.jsValue + object[Strings.writableType] = writableType.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _start = ClosureAttribute1(jsObject: object, name: Strings.start) + _transform = ClosureAttribute2(jsObject: object, name: Strings.transform) + _flush = ClosureAttribute1(jsObject: object, name: Strings.flush) + _readableType = ReadWriteAttribute(jsObject: object, name: Strings.readableType) + _writableType = ReadWriteAttribute(jsObject: object, name: Strings.writableType) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute1 + public var start: TransformerStartCallback + + @ClosureAttribute2 + public var transform: TransformerTransformCallback + + @ClosureAttribute1 + public var flush: TransformerFlushCallback + + @ReadWriteAttribute + public var readableType: JSValue - @inlinable public var jsValue: JSValue { rawValue.jsValue } + @ReadWriteAttribute + public var writableType: JSValue } -public class TimeRanges: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TimeRanges].function! } +public class TreeWalker: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TreeWalker].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _root = ReadonlyAttribute(jsObject: jsObject, name: Strings.root) + _whatToShow = ReadonlyAttribute(jsObject: jsObject, name: Strings.whatToShow) + _currentNode = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentNode) self.jsObject = jsObject } @ReadonlyAttribute - public var length: UInt32 + public var root: Node - @inlinable public func start(index: UInt32) -> Double { + @ReadonlyAttribute + public var whatToShow: UInt32 + + // XXX: member 'filter' is ignored + + @ReadWriteAttribute + public var currentNode: Node + + @inlinable public func parentNode() -> Node? { let this = jsObject - return this[Strings.start].function!(this: this, arguments: [index.jsValue]).fromJSValue()! + return this[Strings.parentNode].function!(this: this, arguments: []).fromJSValue()! } - @inlinable public func end(index: UInt32) -> Double { + @inlinable public func firstChild() -> Node? { let this = jsObject - return this[Strings.end].function!(this: this, arguments: [index.jsValue]).fromJSValue()! + return this[Strings.firstChild].function!(this: this, arguments: []).fromJSValue()! } -} -public enum TimelinePhase: JSString, JSValueCompatible { - case inactive = "inactive" - case before = "before" - case active = "active" - case after = "after" + @inlinable public func lastChild() -> Node? { + let this = jsObject + return this[Strings.lastChild].function!(this: this, arguments: []).fromJSValue()! + } - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + @inlinable public func previousSibling() -> Node? { + let this = jsObject + return this[Strings.previousSibling].function!(this: this, arguments: []).fromJSValue()! } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable public func nextSibling() -> Node? { + let this = jsObject + return this[Strings.nextSibling].function!(this: this, arguments: []).fromJSValue()! } - @inlinable public var jsValue: JSValue { rawValue.jsValue } + @inlinable public func previousNode() -> Node? { + let this = jsObject + return this[Strings.previousNode].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable public func nextNode() -> Node? { + let this = jsObject + return this[Strings.nextNode].function!(this: this, arguments: []).fromJSValue()! + } } -public class TrackEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.TrackEvent].function! } +public typealias CanvasFilterInput = [String: JSValue] + +public typealias EventHandler = EventHandlerNonNull? +public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? +public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? + +public typealias DOMHighResTimeStamp = Double +public typealias EpochTimeStamp = UInt64 + +public typealias DOMTimeStamp = UInt64 + +public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void +public typealias BlobCallback = (Blob?) -> Void +public typealias FunctionStringCallback = (String) -> Void +public typealias EventHandlerNonNull = (Event) -> JSValue +public typealias OnErrorEventHandlerNonNull = (Event_or_String, String, UInt32, UInt32, JSValue) -> JSValue +public typealias OnBeforeUnloadEventHandlerNonNull = (Event) -> String? +public typealias FrameRequestCallback = (DOMHighResTimeStamp) -> Void +public typealias VoidFunction = () -> Void +public typealias UnderlyingSourceStartCallback = (ReadableStreamController) -> JSValue +public typealias UnderlyingSourcePullCallback = (ReadableStreamController) -> JSPromise +public typealias UnderlyingSourceCancelCallback = (JSValue) -> JSPromise +public typealias UnderlyingSinkStartCallback = (WritableStreamDefaultController) -> JSValue +public typealias UnderlyingSinkWriteCallback = (JSValue, WritableStreamDefaultController) -> JSPromise +public typealias UnderlyingSinkCloseCallback = () -> JSPromise +public typealias UnderlyingSinkAbortCallback = (JSValue) -> JSPromise +public typealias TransformerStartCallback = (TransformStreamDefaultController) -> JSValue +public typealias TransformerFlushCallback = (TransformStreamDefaultController) -> JSPromise +public typealias TransformerTransformCallback = (JSValue, TransformStreamDefaultController) -> JSPromise +public typealias QueuingStrategySize = (JSValue) -> Double +public typealias NavigatorUserMediaSuccessCallback = (MediaStream) -> Void +public typealias NavigatorUserMediaErrorCallback = (DOMException) -> Void +public typealias AudioDataOutputCallback = (AudioData) -> Void +public typealias VideoFrameOutputCallback = (VideoFrame) -> Void +public typealias EncodedAudioChunkOutputCallback = (EncodedAudioChunk, EncodedAudioChunkMetadata) -> Void +public typealias EncodedVideoChunkOutputCallback = (EncodedVideoChunk, EncodedVideoChunkMetadata) -> Void +public typealias WebCodecsErrorCallback = (DOMException) -> Void +public class UIEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.UIEvent].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _track = ReadonlyAttribute(jsObject: jsObject, name: Strings.track) + _view = ReadonlyAttribute(jsObject: jsObject, name: Strings.view) + _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) + _which = ReadonlyAttribute(jsObject: jsObject, name: Strings.which) super.init(unsafelyWrapping: jsObject) } - @inlinable public convenience init(type: String, eventInitDict: TrackEventInit? = nil) { + @inlinable public convenience init(type: String, eventInitDict: UIEventInit? = nil) { self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) } @ReadonlyAttribute - public var track: AudioTrack_or_TextTrack_or_VideoTrack? + public var view: Window? + + @ReadonlyAttribute + public var detail: Int32 + + @inlinable public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil) { + let this = jsObject + _ = this[Strings.initUIEvent].function!(this: this, arguments: [typeArg.jsValue, bubblesArg?.jsValue ?? .undefined, cancelableArg?.jsValue ?? .undefined, viewArg?.jsValue ?? .undefined, detailArg?.jsValue ?? .undefined]) + } + + @ReadonlyAttribute + public var which: UInt32 } -public class TrackEventInit: BridgedDictionary { - public convenience init(track: AudioTrack_or_TextTrack_or_VideoTrack?) { +public class UIEventInit: BridgedDictionary { + public convenience init(view: Window?, detail: Int32, which: UInt32) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.track] = track.jsValue + object[Strings.view] = view.jsValue + object[Strings.detail] = detail.jsValue + object[Strings.which] = which.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _track = ReadWriteAttribute(jsObject: object, name: Strings.track) + _view = ReadWriteAttribute(jsObject: object, name: Strings.view) + _detail = ReadWriteAttribute(jsObject: object, name: Strings.detail) + _which = ReadWriteAttribute(jsObject: object, name: Strings.which) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var track: AudioTrack_or_TextTrack_or_VideoTrack? + public var view: Window? + + @ReadWriteAttribute + public var detail: Int32 + + @ReadWriteAttribute + public var which: UInt32 } -public class TransformStream: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TransformStream].function! } +public class ULongRange: BridgedDictionary { + public convenience init(max: UInt32, min: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.max] = max.jsValue + object[Strings.min] = min.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _max = ReadWriteAttribute(jsObject: object, name: Strings.max) + _min = ReadWriteAttribute(jsObject: object, name: Strings.min) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var max: UInt32 + + @ReadWriteAttribute + public var min: UInt32 +} + +public class URL: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.URL].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _readable = ReadonlyAttribute(jsObject: jsObject, name: Strings.readable) - _writable = ReadonlyAttribute(jsObject: jsObject, name: Strings.writable) + _href = ReadWriteAttribute(jsObject: jsObject, name: Strings.href) + _origin = ReadonlyAttribute(jsObject: jsObject, name: Strings.origin) + _protocol = ReadWriteAttribute(jsObject: jsObject, name: Strings.protocol) + _username = ReadWriteAttribute(jsObject: jsObject, name: Strings.username) + _password = ReadWriteAttribute(jsObject: jsObject, name: Strings.password) + _host = ReadWriteAttribute(jsObject: jsObject, name: Strings.host) + _hostname = ReadWriteAttribute(jsObject: jsObject, name: Strings.hostname) + _port = ReadWriteAttribute(jsObject: jsObject, name: Strings.port) + _pathname = ReadWriteAttribute(jsObject: jsObject, name: Strings.pathname) + _search = ReadWriteAttribute(jsObject: jsObject, name: Strings.search) + _searchParams = ReadonlyAttribute(jsObject: jsObject, name: Strings.searchParams) + _hash = ReadWriteAttribute(jsObject: jsObject, name: Strings.hash) self.jsObject = jsObject } - @inlinable public convenience init(transformer: JSObject? = nil, writableStrategy: QueuingStrategy? = nil, readableStrategy: QueuingStrategy? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [transformer?.jsValue ?? .undefined, writableStrategy?.jsValue ?? .undefined, readableStrategy?.jsValue ?? .undefined])) + @inlinable public static func createObjectURL(obj: Blob_or_MediaSource) -> String { + let this = constructor + return this[Strings.createObjectURL].function!(this: this, arguments: [obj.jsValue]).fromJSValue()! + } + + @inlinable public static func revokeObjectURL(url: String) { + let this = constructor + _ = this[Strings.revokeObjectURL].function!(this: this, arguments: [url.jsValue]) } + @inlinable public convenience init(url: String, base: String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue, base?.jsValue ?? .undefined])) + } + + @ReadWriteAttribute + public var href: String + @ReadonlyAttribute - public var readable: ReadableStream + public var origin: String + + @ReadWriteAttribute + public var `protocol`: String + + @ReadWriteAttribute + public var username: String + + @ReadWriteAttribute + public var password: String + + @ReadWriteAttribute + public var host: String + + @ReadWriteAttribute + public var hostname: String + + @ReadWriteAttribute + public var port: String + + @ReadWriteAttribute + public var pathname: String + + @ReadWriteAttribute + public var search: String @ReadonlyAttribute - public var writable: WritableStream + public var searchParams: URLSearchParams + + @ReadWriteAttribute + public var hash: String + + @inlinable public func toJSON() -> String { + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! + } } -public class TransformStreamDefaultController: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TransformStreamDefaultController].function! } +public class URLSearchParams: JSBridgedClass, Sequence { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.URLSearchParams].function! } public let jsObject: JSObject - public required init(unsafelyWrapping jsObject: JSObject) { - _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.desiredSize) - self.jsObject = jsObject + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } + + @inlinable public convenience init(init: String_or_record_String_to_String_or_seq_of_seq_of_String? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) + } + + @inlinable public func append(name: String, value: String) { + let this = jsObject + _ = this[Strings.append].function!(this: this, arguments: [name.jsValue, value.jsValue]) + } + + @inlinable public func delete(name: String) { + let this = jsObject + _ = this[Strings.delete].function!(this: this, arguments: [name.jsValue]) + } + + @inlinable public func get(name: String) -> String? { + let this = jsObject + return this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } - @ReadonlyAttribute - public var desiredSize: Double? + @inlinable public func getAll(name: String) -> [String] { + let this = jsObject + return this[Strings.getAll].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + } - @inlinable public func enqueue(chunk: JSValue? = nil) { + @inlinable public func has(name: String) -> Bool { let this = jsObject - _ = this[Strings.enqueue].function!(this: this, arguments: [chunk?.jsValue ?? .undefined]) + return this[Strings.has].function!(this: this, arguments: [name.jsValue]).fromJSValue()! } - @inlinable public func error(reason: JSValue? = nil) { + @inlinable public func set(name: String, value: String) { let this = jsObject - _ = this[Strings.error].function!(this: this, arguments: [reason?.jsValue ?? .undefined]) + _ = this[Strings.set].function!(this: this, arguments: [name.jsValue, value.jsValue]) } - @inlinable public func terminate() { + @inlinable public func sort() { let this = jsObject - _ = this[Strings.terminate].function!(this: this, arguments: []) + _ = this[Strings.sort].function!(this: this, arguments: []) + } + + public typealias Element = String + public func makeIterator() -> ValueIterableIterator { + ValueIterableIterator(sequence: self) + } + + @inlinable public var description: String { + jsObject[Strings.toString]!().fromJSValue()! } } -public class Transformer: BridgedDictionary { - public convenience init(start: @escaping TransformerStartCallback, transform: @escaping TransformerTransformCallback, flush: @escaping TransformerFlushCallback, readableType: JSValue, writableType: JSValue) { +public class UnderlyingSink: BridgedDictionary { + public convenience init(start: @escaping UnderlyingSinkStartCallback, write: @escaping UnderlyingSinkWriteCallback, close: @escaping UnderlyingSinkCloseCallback, abort: @escaping UnderlyingSinkAbortCallback, type: JSValue) { let object = JSObject.global[Strings.Object].function!.new() ClosureAttribute1[Strings.start, in: object] = start - ClosureAttribute2[Strings.transform, in: object] = transform - ClosureAttribute1[Strings.flush, in: object] = flush - object[Strings.readableType] = readableType.jsValue - object[Strings.writableType] = writableType.jsValue + ClosureAttribute2[Strings.write, in: object] = write + ClosureAttribute0[Strings.close, in: object] = close + ClosureAttribute1[Strings.abort, in: object] = abort + object[Strings.type] = type.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { _start = ClosureAttribute1(jsObject: object, name: Strings.start) - _transform = ClosureAttribute2(jsObject: object, name: Strings.transform) - _flush = ClosureAttribute1(jsObject: object, name: Strings.flush) - _readableType = ReadWriteAttribute(jsObject: object, name: Strings.readableType) - _writableType = ReadWriteAttribute(jsObject: object, name: Strings.writableType) + _write = ClosureAttribute2(jsObject: object, name: Strings.write) + _close = ClosureAttribute0(jsObject: object, name: Strings.close) + _abort = ClosureAttribute1(jsObject: object, name: Strings.abort) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) super.init(unsafelyWrapping: object) } @ClosureAttribute1 - public var start: TransformerStartCallback + public var start: UnderlyingSinkStartCallback @ClosureAttribute2 - public var transform: TransformerTransformCallback + public var write: UnderlyingSinkWriteCallback + + @ClosureAttribute0 + public var close: UnderlyingSinkCloseCallback @ClosureAttribute1 - public var flush: TransformerFlushCallback + public var abort: UnderlyingSinkAbortCallback @ReadWriteAttribute - public var readableType: JSValue + public var type: JSValue +} + +public class UnderlyingSource: BridgedDictionary { + public convenience init(start: @escaping UnderlyingSourceStartCallback, pull: @escaping UnderlyingSourcePullCallback, cancel: @escaping UnderlyingSourceCancelCallback, type: ReadableStreamType, autoAllocateChunkSize: UInt64) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute1[Strings.start, in: object] = start + ClosureAttribute1[Strings.pull, in: object] = pull + ClosureAttribute1[Strings.cancel, in: object] = cancel + object[Strings.type] = type.jsValue + object[Strings.autoAllocateChunkSize] = autoAllocateChunkSize.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _start = ClosureAttribute1(jsObject: object, name: Strings.start) + _pull = ClosureAttribute1(jsObject: object, name: Strings.pull) + _cancel = ClosureAttribute1(jsObject: object, name: Strings.cancel) + _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _autoAllocateChunkSize = ReadWriteAttribute(jsObject: object, name: Strings.autoAllocateChunkSize) + super.init(unsafelyWrapping: object) + } + + @ClosureAttribute1 + public var start: UnderlyingSourceStartCallback + + @ClosureAttribute1 + public var pull: UnderlyingSourcePullCallback + + @ClosureAttribute1 + public var cancel: UnderlyingSourceCancelCallback @ReadWriteAttribute - public var writableType: JSValue + public var type: ReadableStreamType + + @ReadWriteAttribute + public var autoAllocateChunkSize: UInt64 } -public class TreeWalker: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.TreeWalker].function! } +public class ValidityState: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ValidityState].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _root = ReadonlyAttribute(jsObject: jsObject, name: Strings.root) - _whatToShow = ReadonlyAttribute(jsObject: jsObject, name: Strings.whatToShow) - _currentNode = ReadWriteAttribute(jsObject: jsObject, name: Strings.currentNode) + _valueMissing = ReadonlyAttribute(jsObject: jsObject, name: Strings.valueMissing) + _typeMismatch = ReadonlyAttribute(jsObject: jsObject, name: Strings.typeMismatch) + _patternMismatch = ReadonlyAttribute(jsObject: jsObject, name: Strings.patternMismatch) + _tooLong = ReadonlyAttribute(jsObject: jsObject, name: Strings.tooLong) + _tooShort = ReadonlyAttribute(jsObject: jsObject, name: Strings.tooShort) + _rangeUnderflow = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeUnderflow) + _rangeOverflow = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeOverflow) + _stepMismatch = ReadonlyAttribute(jsObject: jsObject, name: Strings.stepMismatch) + _badInput = ReadonlyAttribute(jsObject: jsObject, name: Strings.badInput) + _customError = ReadonlyAttribute(jsObject: jsObject, name: Strings.customError) + _valid = ReadonlyAttribute(jsObject: jsObject, name: Strings.valid) self.jsObject = jsObject } @ReadonlyAttribute - public var root: Node + public var valueMissing: Bool @ReadonlyAttribute - public var whatToShow: UInt32 + public var typeMismatch: Bool - // XXX: member 'filter' is ignored + @ReadonlyAttribute + public var patternMismatch: Bool - @ReadWriteAttribute - public var currentNode: Node + @ReadonlyAttribute + public var tooLong: Bool - @inlinable public func parentNode() -> Node? { - let this = jsObject - return this[Strings.parentNode].function!(this: this, arguments: []).fromJSValue()! - } + @ReadonlyAttribute + public var tooShort: Bool - @inlinable public func firstChild() -> Node? { - let this = jsObject - return this[Strings.firstChild].function!(this: this, arguments: []).fromJSValue()! - } + @ReadonlyAttribute + public var rangeUnderflow: Bool - @inlinable public func lastChild() -> Node? { - let this = jsObject - return this[Strings.lastChild].function!(this: this, arguments: []).fromJSValue()! - } + @ReadonlyAttribute + public var rangeOverflow: Bool - @inlinable public func previousSibling() -> Node? { - let this = jsObject - return this[Strings.previousSibling].function!(this: this, arguments: []).fromJSValue()! - } + @ReadonlyAttribute + public var stepMismatch: Bool - @inlinable public func nextSibling() -> Node? { - let this = jsObject - return this[Strings.nextSibling].function!(this: this, arguments: []).fromJSValue()! - } + @ReadonlyAttribute + public var badInput: Bool - @inlinable public func previousNode() -> Node? { - let this = jsObject - return this[Strings.previousNode].function!(this: this, arguments: []).fromJSValue()! + @ReadonlyAttribute + public var customError: Bool + + @ReadonlyAttribute + public var valid: Bool +} + +public class ValidityStateFlags: BridgedDictionary { + public convenience init(valueMissing: Bool, typeMismatch: Bool, patternMismatch: Bool, tooLong: Bool, tooShort: Bool, rangeUnderflow: Bool, rangeOverflow: Bool, stepMismatch: Bool, badInput: Bool, customError: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.valueMissing] = valueMissing.jsValue + object[Strings.typeMismatch] = typeMismatch.jsValue + object[Strings.patternMismatch] = patternMismatch.jsValue + object[Strings.tooLong] = tooLong.jsValue + object[Strings.tooShort] = tooShort.jsValue + object[Strings.rangeUnderflow] = rangeUnderflow.jsValue + object[Strings.rangeOverflow] = rangeOverflow.jsValue + object[Strings.stepMismatch] = stepMismatch.jsValue + object[Strings.badInput] = badInput.jsValue + object[Strings.customError] = customError.jsValue + self.init(unsafelyWrapping: object) } - @inlinable public func nextNode() -> Node? { - let this = jsObject - return this[Strings.nextNode].function!(this: this, arguments: []).fromJSValue()! + public required init(unsafelyWrapping object: JSObject) { + _valueMissing = ReadWriteAttribute(jsObject: object, name: Strings.valueMissing) + _typeMismatch = ReadWriteAttribute(jsObject: object, name: Strings.typeMismatch) + _patternMismatch = ReadWriteAttribute(jsObject: object, name: Strings.patternMismatch) + _tooLong = ReadWriteAttribute(jsObject: object, name: Strings.tooLong) + _tooShort = ReadWriteAttribute(jsObject: object, name: Strings.tooShort) + _rangeUnderflow = ReadWriteAttribute(jsObject: object, name: Strings.rangeUnderflow) + _rangeOverflow = ReadWriteAttribute(jsObject: object, name: Strings.rangeOverflow) + _stepMismatch = ReadWriteAttribute(jsObject: object, name: Strings.stepMismatch) + _badInput = ReadWriteAttribute(jsObject: object, name: Strings.badInput) + _customError = ReadWriteAttribute(jsObject: object, name: Strings.customError) + super.init(unsafelyWrapping: object) } -} -public typealias CanvasFilterInput = [String: JSValue] + @ReadWriteAttribute + public var valueMissing: Bool -public typealias EventHandler = EventHandlerNonNull? -public typealias OnErrorEventHandler = OnErrorEventHandlerNonNull? -public typealias OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull? + @ReadWriteAttribute + public var typeMismatch: Bool -public typealias DOMHighResTimeStamp = Double -public typealias EpochTimeStamp = UInt64 + @ReadWriteAttribute + public var patternMismatch: Bool -public typealias DOMTimeStamp = UInt64 + @ReadWriteAttribute + public var tooLong: Bool -public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void -public typealias BlobCallback = (Blob?) -> Void -public typealias FunctionStringCallback = (String) -> Void -public typealias EventHandlerNonNull = (Event) -> JSValue -public typealias OnErrorEventHandlerNonNull = (Event_or_String, String, UInt32, UInt32, JSValue) -> JSValue -public typealias OnBeforeUnloadEventHandlerNonNull = (Event) -> String? -public typealias FrameRequestCallback = (DOMHighResTimeStamp) -> Void -public typealias VoidFunction = () -> Void -public typealias UnderlyingSourceStartCallback = (ReadableStreamController) -> JSValue -public typealias UnderlyingSourcePullCallback = (ReadableStreamController) -> JSPromise -public typealias UnderlyingSourceCancelCallback = (JSValue) -> JSPromise -public typealias UnderlyingSinkStartCallback = (WritableStreamDefaultController) -> JSValue -public typealias UnderlyingSinkWriteCallback = (JSValue, WritableStreamDefaultController) -> JSPromise -public typealias UnderlyingSinkCloseCallback = () -> JSPromise -public typealias UnderlyingSinkAbortCallback = (JSValue) -> JSPromise -public typealias TransformerStartCallback = (TransformStreamDefaultController) -> JSValue -public typealias TransformerFlushCallback = (TransformStreamDefaultController) -> JSPromise -public typealias TransformerTransformCallback = (JSValue, TransformStreamDefaultController) -> JSPromise -public typealias QueuingStrategySize = (JSValue) -> Double -public typealias NavigatorUserMediaSuccessCallback = (MediaStream) -> Void -public typealias NavigatorUserMediaErrorCallback = (DOMException) -> Void -public class UIEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.UIEvent].function! } + @ReadWriteAttribute + public var tooShort: Bool + + @ReadWriteAttribute + public var rangeUnderflow: Bool + + @ReadWriteAttribute + public var rangeOverflow: Bool + + @ReadWriteAttribute + public var stepMismatch: Bool + + @ReadWriteAttribute + public var badInput: Bool + + @ReadWriteAttribute + public var customError: Bool +} + +public enum VideoColorPrimaries: JSString, JSValueCompatible { + case bt709 = "bt709" + case bt470bg = "bt470bg" + case smpte170m = "smpte170m" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class VideoColorSpace: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoColorSpace].function! } + + public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _view = ReadonlyAttribute(jsObject: jsObject, name: Strings.view) - _detail = ReadonlyAttribute(jsObject: jsObject, name: Strings.detail) - _which = ReadonlyAttribute(jsObject: jsObject, name: Strings.which) - super.init(unsafelyWrapping: jsObject) + _primaries = ReadonlyAttribute(jsObject: jsObject, name: Strings.primaries) + _transfer = ReadonlyAttribute(jsObject: jsObject, name: Strings.transfer) + _matrix = ReadonlyAttribute(jsObject: jsObject, name: Strings.matrix) + _fullRange = ReadonlyAttribute(jsObject: jsObject, name: Strings.fullRange) + self.jsObject = jsObject } - @inlinable public convenience init(type: String, eventInitDict: UIEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInitDict?.jsValue ?? .undefined])) + @inlinable public convenience init(init: VideoColorSpaceInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) } @ReadonlyAttribute - public var view: Window? + public var primaries: VideoColorPrimaries? @ReadonlyAttribute - public var detail: Int32 + public var transfer: VideoTransferCharacteristics? - @inlinable public func initUIEvent(typeArg: String, bubblesArg: Bool? = nil, cancelableArg: Bool? = nil, viewArg: Window? = nil, detailArg: Int32? = nil) { - let this = jsObject - _ = this[Strings.initUIEvent].function!(this: this, arguments: [typeArg.jsValue, bubblesArg?.jsValue ?? .undefined, cancelableArg?.jsValue ?? .undefined, viewArg?.jsValue ?? .undefined, detailArg?.jsValue ?? .undefined]) - } + @ReadonlyAttribute + public var matrix: VideoMatrixCoefficients? @ReadonlyAttribute - public var which: UInt32 + public var fullRange: Bool? + + @inlinable public func toJSON() -> VideoColorSpaceInit { + let this = jsObject + return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! + } } -public class UIEventInit: BridgedDictionary { - public convenience init(view: Window?, detail: Int32, which: UInt32) { +public class VideoColorSpaceInit: BridgedDictionary { + public convenience init(primaries: VideoColorPrimaries, transfer: VideoTransferCharacteristics, matrix: VideoMatrixCoefficients, fullRange: Bool) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.view] = view.jsValue - object[Strings.detail] = detail.jsValue - object[Strings.which] = which.jsValue + object[Strings.primaries] = primaries.jsValue + object[Strings.transfer] = transfer.jsValue + object[Strings.matrix] = matrix.jsValue + object[Strings.fullRange] = fullRange.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _view = ReadWriteAttribute(jsObject: object, name: Strings.view) - _detail = ReadWriteAttribute(jsObject: object, name: Strings.detail) - _which = ReadWriteAttribute(jsObject: object, name: Strings.which) + _primaries = ReadWriteAttribute(jsObject: object, name: Strings.primaries) + _transfer = ReadWriteAttribute(jsObject: object, name: Strings.transfer) + _matrix = ReadWriteAttribute(jsObject: object, name: Strings.matrix) + _fullRange = ReadWriteAttribute(jsObject: object, name: Strings.fullRange) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var view: Window? + public var primaries: VideoColorPrimaries @ReadWriteAttribute - public var detail: Int32 + public var transfer: VideoTransferCharacteristics @ReadWriteAttribute - public var which: UInt32 + public var matrix: VideoMatrixCoefficients + + @ReadWriteAttribute + public var fullRange: Bool } -public class ULongRange: BridgedDictionary { - public convenience init(max: UInt32, min: UInt32) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.max] = max.jsValue - object[Strings.min] = min.jsValue - self.init(unsafelyWrapping: object) +public class VideoDecoder: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoDecoder].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _decodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.decodeQueueSize) + self.jsObject = jsObject } - public required init(unsafelyWrapping object: JSObject) { - _max = ReadWriteAttribute(jsObject: object, name: Strings.max) - _min = ReadWriteAttribute(jsObject: object, name: Strings.min) - super.init(unsafelyWrapping: object) + @inlinable public convenience init(init: VideoDecoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } - @ReadWriteAttribute - public var max: UInt32 + @ReadonlyAttribute + public var state: CodecState - @ReadWriteAttribute - public var min: UInt32 -} + @ReadonlyAttribute + public var decodeQueueSize: UInt32 -public class URL: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.URL].function! } + @inlinable public func configure(config: VideoDecoderConfig) { + let this = jsObject + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) + } - public let jsObject: JSObject + @inlinable public func decode(chunk: EncodedVideoChunk) { + let this = jsObject + _ = this[Strings.decode].function!(this: this, arguments: [chunk.jsValue]) + } - public required init(unsafelyWrapping jsObject: JSObject) { - _href = ReadWriteAttribute(jsObject: jsObject, name: Strings.href) - _origin = ReadonlyAttribute(jsObject: jsObject, name: Strings.origin) - _protocol = ReadWriteAttribute(jsObject: jsObject, name: Strings.protocol) - _username = ReadWriteAttribute(jsObject: jsObject, name: Strings.username) - _password = ReadWriteAttribute(jsObject: jsObject, name: Strings.password) - _host = ReadWriteAttribute(jsObject: jsObject, name: Strings.host) - _hostname = ReadWriteAttribute(jsObject: jsObject, name: Strings.hostname) - _port = ReadWriteAttribute(jsObject: jsObject, name: Strings.port) - _pathname = ReadWriteAttribute(jsObject: jsObject, name: Strings.pathname) - _search = ReadWriteAttribute(jsObject: jsObject, name: Strings.search) - _searchParams = ReadonlyAttribute(jsObject: jsObject, name: Strings.searchParams) - _hash = ReadWriteAttribute(jsObject: jsObject, name: Strings.hash) - self.jsObject = jsObject + @inlinable public func flush() -> JSPromise { + let this = jsObject + return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! } - @inlinable public static func createObjectURL(obj: Blob_or_MediaSource) -> String { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func flush() async throws { + let this = jsObject + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + _ = try await _promise.value + } + + @inlinable public func reset() { + let this = jsObject + _ = this[Strings.reset].function!(this: this, arguments: []) + } + + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } + + @inlinable public static func isConfigSupported(config: VideoDecoderConfig) -> JSPromise { let this = constructor - return this[Strings.createObjectURL].function!(this: this, arguments: [obj.jsValue]).fromJSValue()! + return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! } - @inlinable public static func revokeObjectURL(url: String) { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public static func isConfigSupported(config: VideoDecoderConfig) async throws -> VideoDecoderSupport { let this = constructor - _ = this[Strings.revokeObjectURL].function!(this: this, arguments: [url.jsValue]) + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } +} - @inlinable public convenience init(url: String, base: String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [url.jsValue, base?.jsValue ?? .undefined])) +public class VideoDecoderConfig: BridgedDictionary { + public convenience init(codec: String, description: BufferSource, codedWidth: UInt32, codedHeight: UInt32, displayAspectWidth: UInt32, displayAspectHeight: UInt32, colorSpace: VideoColorSpaceInit, hardwareAcceleration: HardwareAcceleration, optimizeForLatency: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.codec] = codec.jsValue + object[Strings.description] = description.jsValue + object[Strings.codedWidth] = codedWidth.jsValue + object[Strings.codedHeight] = codedHeight.jsValue + object[Strings.displayAspectWidth] = displayAspectWidth.jsValue + object[Strings.displayAspectHeight] = displayAspectHeight.jsValue + object[Strings.colorSpace] = colorSpace.jsValue + object[Strings.hardwareAcceleration] = hardwareAcceleration.jsValue + object[Strings.optimizeForLatency] = optimizeForLatency.jsValue + self.init(unsafelyWrapping: object) } - @ReadWriteAttribute - public var href: String + public required init(unsafelyWrapping object: JSObject) { + _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) + _description = ReadWriteAttribute(jsObject: object, name: Strings.description) + _codedWidth = ReadWriteAttribute(jsObject: object, name: Strings.codedWidth) + _codedHeight = ReadWriteAttribute(jsObject: object, name: Strings.codedHeight) + _displayAspectWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayAspectWidth) + _displayAspectHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayAspectHeight) + _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) + _hardwareAcceleration = ReadWriteAttribute(jsObject: object, name: Strings.hardwareAcceleration) + _optimizeForLatency = ReadWriteAttribute(jsObject: object, name: Strings.optimizeForLatency) + super.init(unsafelyWrapping: object) + } - @ReadonlyAttribute - public var origin: String + @ReadWriteAttribute + public var codec: String @ReadWriteAttribute - public var `protocol`: String + public var description: BufferSource @ReadWriteAttribute - public var username: String + public var codedWidth: UInt32 @ReadWriteAttribute - public var password: String + public var codedHeight: UInt32 @ReadWriteAttribute - public var host: String + public var displayAspectWidth: UInt32 @ReadWriteAttribute - public var hostname: String + public var displayAspectHeight: UInt32 @ReadWriteAttribute - public var port: String + public var colorSpace: VideoColorSpaceInit @ReadWriteAttribute - public var pathname: String + public var hardwareAcceleration: HardwareAcceleration @ReadWriteAttribute - public var search: String + public var optimizeForLatency: Bool +} - @ReadonlyAttribute - public var searchParams: URLSearchParams +public class VideoDecoderInit: BridgedDictionary { + public convenience init(output: @escaping VideoFrameOutputCallback, error: @escaping WebCodecsErrorCallback) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute1Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) + } - @ReadWriteAttribute - public var hash: String + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute1Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } - @inlinable public func toJSON() -> String { - let this = jsObject - return this[Strings.toJSON].function!(this: this, arguments: []).fromJSValue()! + @ClosureAttribute1Void + public var output: VideoFrameOutputCallback + + @ClosureAttribute1Void + public var error: WebCodecsErrorCallback +} + +public class VideoDecoderSupport: BridgedDictionary { + public convenience init(supported: Bool, config: VideoDecoderConfig) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) + _config = ReadWriteAttribute(jsObject: object, name: Strings.config) + super.init(unsafelyWrapping: object) } + + @ReadWriteAttribute + public var supported: Bool + + @ReadWriteAttribute + public var config: VideoDecoderConfig } -public class URLSearchParams: JSBridgedClass, Sequence { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.URLSearchParams].function! } +public class VideoEncoder: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoEncoder].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { + _state = ReadonlyAttribute(jsObject: jsObject, name: Strings.state) + _encodeQueueSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.encodeQueueSize) self.jsObject = jsObject } - @inlinable public convenience init(init: String_or_record_String_to_String_or_seq_of_seq_of_String? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`?.jsValue ?? .undefined])) + @inlinable public convenience init(init: VideoEncoderInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [`init`.jsValue])) } - @inlinable public func append(name: String, value: String) { - let this = jsObject - _ = this[Strings.append].function!(this: this, arguments: [name.jsValue, value.jsValue]) - } + @ReadonlyAttribute + public var state: CodecState - @inlinable public func delete(name: String) { + @ReadonlyAttribute + public var encodeQueueSize: UInt32 + + @inlinable public func configure(config: VideoEncoderConfig) { let this = jsObject - _ = this[Strings.delete].function!(this: this, arguments: [name.jsValue]) + _ = this[Strings.configure].function!(this: this, arguments: [config.jsValue]) } - @inlinable public func get(name: String) -> String? { + @inlinable public func encode(frame: VideoFrame, options: VideoEncoderEncodeOptions? = nil) { let this = jsObject - return this[Strings.get].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + _ = this[Strings.encode].function!(this: this, arguments: [frame.jsValue, options?.jsValue ?? .undefined]) } - @inlinable public func getAll(name: String) -> [String] { + @inlinable public func flush() -> JSPromise { let this = jsObject - return this[Strings.getAll].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + return this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! } - @inlinable public func has(name: String) -> Bool { + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func flush() async throws { let this = jsObject - return this[Strings.has].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + let _promise: JSPromise = this[Strings.flush].function!(this: this, arguments: []).fromJSValue()! + _ = try await _promise.value } - @inlinable public func set(name: String, value: String) { + @inlinable public func reset() { let this = jsObject - _ = this[Strings.set].function!(this: this, arguments: [name.jsValue, value.jsValue]) + _ = this[Strings.reset].function!(this: this, arguments: []) } - @inlinable public func sort() { + @inlinable public func close() { let this = jsObject - _ = this[Strings.sort].function!(this: this, arguments: []) + _ = this[Strings.close].function!(this: this, arguments: []) } - public typealias Element = String - public func makeIterator() -> ValueIterableIterator { - ValueIterableIterator(sequence: self) + @inlinable public static func isConfigSupported(config: VideoEncoderConfig) -> JSPromise { + let this = constructor + return this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! } - @inlinable public var description: String { - jsObject[Strings.toString]!().fromJSValue()! + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public static func isConfigSupported(config: VideoEncoderConfig) async throws -> VideoEncoderSupport { + let this = constructor + let _promise: JSPromise = this[Strings.isConfigSupported].function!(this: this, arguments: [config.jsValue]).fromJSValue()! + return try await _promise.value.fromJSValue()! } } -public class UnderlyingSink: BridgedDictionary { - public convenience init(start: @escaping UnderlyingSinkStartCallback, write: @escaping UnderlyingSinkWriteCallback, close: @escaping UnderlyingSinkCloseCallback, abort: @escaping UnderlyingSinkAbortCallback, type: JSValue) { +public class VideoEncoderConfig: BridgedDictionary { + public convenience init(codec: String, width: UInt32, height: UInt32, displayWidth: UInt32, displayHeight: UInt32, bitrate: UInt64, framerate: Double, hardwareAcceleration: HardwareAcceleration, alpha: AlphaOption, scalabilityMode: String, bitrateMode: BitrateMode, latencyMode: LatencyMode) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute1[Strings.start, in: object] = start - ClosureAttribute2[Strings.write, in: object] = write - ClosureAttribute0[Strings.close, in: object] = close - ClosureAttribute1[Strings.abort, in: object] = abort - object[Strings.type] = type.jsValue + object[Strings.codec] = codec.jsValue + object[Strings.width] = width.jsValue + object[Strings.height] = height.jsValue + object[Strings.displayWidth] = displayWidth.jsValue + object[Strings.displayHeight] = displayHeight.jsValue + object[Strings.bitrate] = bitrate.jsValue + object[Strings.framerate] = framerate.jsValue + object[Strings.hardwareAcceleration] = hardwareAcceleration.jsValue + object[Strings.alpha] = alpha.jsValue + object[Strings.scalabilityMode] = scalabilityMode.jsValue + object[Strings.bitrateMode] = bitrateMode.jsValue + object[Strings.latencyMode] = latencyMode.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _codec = ReadWriteAttribute(jsObject: object, name: Strings.codec) + _width = ReadWriteAttribute(jsObject: object, name: Strings.width) + _height = ReadWriteAttribute(jsObject: object, name: Strings.height) + _displayWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayWidth) + _displayHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayHeight) + _bitrate = ReadWriteAttribute(jsObject: object, name: Strings.bitrate) + _framerate = ReadWriteAttribute(jsObject: object, name: Strings.framerate) + _hardwareAcceleration = ReadWriteAttribute(jsObject: object, name: Strings.hardwareAcceleration) + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _scalabilityMode = ReadWriteAttribute(jsObject: object, name: Strings.scalabilityMode) + _bitrateMode = ReadWriteAttribute(jsObject: object, name: Strings.bitrateMode) + _latencyMode = ReadWriteAttribute(jsObject: object, name: Strings.latencyMode) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var codec: String + + @ReadWriteAttribute + public var width: UInt32 + + @ReadWriteAttribute + public var height: UInt32 + + @ReadWriteAttribute + public var displayWidth: UInt32 + + @ReadWriteAttribute + public var displayHeight: UInt32 + + @ReadWriteAttribute + public var bitrate: UInt64 + + @ReadWriteAttribute + public var framerate: Double + + @ReadWriteAttribute + public var hardwareAcceleration: HardwareAcceleration + + @ReadWriteAttribute + public var alpha: AlphaOption + + @ReadWriteAttribute + public var scalabilityMode: String + + @ReadWriteAttribute + public var bitrateMode: BitrateMode + + @ReadWriteAttribute + public var latencyMode: LatencyMode +} + +public class VideoEncoderEncodeOptions: BridgedDictionary { + public convenience init(keyFrame: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.keyFrame] = keyFrame.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _start = ClosureAttribute1(jsObject: object, name: Strings.start) - _write = ClosureAttribute2(jsObject: object, name: Strings.write) - _close = ClosureAttribute0(jsObject: object, name: Strings.close) - _abort = ClosureAttribute1(jsObject: object, name: Strings.abort) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) + _keyFrame = ReadWriteAttribute(jsObject: object, name: Strings.keyFrame) super.init(unsafelyWrapping: object) } - @ClosureAttribute1 - public var start: UnderlyingSinkStartCallback + @ReadWriteAttribute + public var keyFrame: Bool +} - @ClosureAttribute2 - public var write: UnderlyingSinkWriteCallback +public class VideoEncoderInit: BridgedDictionary { + public convenience init(output: @escaping EncodedVideoChunkOutputCallback, error: @escaping WebCodecsErrorCallback) { + let object = JSObject.global[Strings.Object].function!.new() + ClosureAttribute2Void[Strings.output, in: object] = output + ClosureAttribute1Void[Strings.error, in: object] = error + self.init(unsafelyWrapping: object) + } - @ClosureAttribute0 - public var close: UnderlyingSinkCloseCallback + public required init(unsafelyWrapping object: JSObject) { + _output = ClosureAttribute2Void(jsObject: object, name: Strings.output) + _error = ClosureAttribute1Void(jsObject: object, name: Strings.error) + super.init(unsafelyWrapping: object) + } - @ClosureAttribute1 - public var abort: UnderlyingSinkAbortCallback + @ClosureAttribute2Void + public var output: EncodedVideoChunkOutputCallback - @ReadWriteAttribute - public var type: JSValue + @ClosureAttribute1Void + public var error: WebCodecsErrorCallback } -public class UnderlyingSource: BridgedDictionary { - public convenience init(start: @escaping UnderlyingSourceStartCallback, pull: @escaping UnderlyingSourcePullCallback, cancel: @escaping UnderlyingSourceCancelCallback, type: ReadableStreamType, autoAllocateChunkSize: UInt64) { +public class VideoEncoderSupport: BridgedDictionary { + public convenience init(supported: Bool, config: VideoEncoderConfig) { let object = JSObject.global[Strings.Object].function!.new() - ClosureAttribute1[Strings.start, in: object] = start - ClosureAttribute1[Strings.pull, in: object] = pull - ClosureAttribute1[Strings.cancel, in: object] = cancel - object[Strings.type] = type.jsValue - object[Strings.autoAllocateChunkSize] = autoAllocateChunkSize.jsValue + object[Strings.supported] = supported.jsValue + object[Strings.config] = config.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _start = ClosureAttribute1(jsObject: object, name: Strings.start) - _pull = ClosureAttribute1(jsObject: object, name: Strings.pull) - _cancel = ClosureAttribute1(jsObject: object, name: Strings.cancel) - _type = ReadWriteAttribute(jsObject: object, name: Strings.type) - _autoAllocateChunkSize = ReadWriteAttribute(jsObject: object, name: Strings.autoAllocateChunkSize) + _supported = ReadWriteAttribute(jsObject: object, name: Strings.supported) + _config = ReadWriteAttribute(jsObject: object, name: Strings.config) super.init(unsafelyWrapping: object) } - @ClosureAttribute1 - public var start: UnderlyingSourceStartCallback + @ReadWriteAttribute + public var supported: Bool - @ClosureAttribute1 - public var pull: UnderlyingSourcePullCallback + @ReadWriteAttribute + public var config: VideoEncoderConfig +} - @ClosureAttribute1 - public var cancel: UnderlyingSourceCancelCallback +public enum VideoFacingModeEnum: JSString, JSValueCompatible { + case user = "user" + case environment = "environment" + case left = "left" + case right = "right" - @ReadWriteAttribute - public var type: ReadableStreamType + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } - @ReadWriteAttribute - public var autoAllocateChunkSize: UInt64 + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } } -public class ValidityState: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ValidityState].function! } +public class VideoFrame: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoFrame].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _valueMissing = ReadonlyAttribute(jsObject: jsObject, name: Strings.valueMissing) - _typeMismatch = ReadonlyAttribute(jsObject: jsObject, name: Strings.typeMismatch) - _patternMismatch = ReadonlyAttribute(jsObject: jsObject, name: Strings.patternMismatch) - _tooLong = ReadonlyAttribute(jsObject: jsObject, name: Strings.tooLong) - _tooShort = ReadonlyAttribute(jsObject: jsObject, name: Strings.tooShort) - _rangeUnderflow = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeUnderflow) - _rangeOverflow = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeOverflow) - _stepMismatch = ReadonlyAttribute(jsObject: jsObject, name: Strings.stepMismatch) - _badInput = ReadonlyAttribute(jsObject: jsObject, name: Strings.badInput) - _customError = ReadonlyAttribute(jsObject: jsObject, name: Strings.customError) - _valid = ReadonlyAttribute(jsObject: jsObject, name: Strings.valid) + _format = ReadonlyAttribute(jsObject: jsObject, name: Strings.format) + _codedWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.codedWidth) + _codedHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.codedHeight) + _codedRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.codedRect) + _visibleRect = ReadonlyAttribute(jsObject: jsObject, name: Strings.visibleRect) + _displayWidth = ReadonlyAttribute(jsObject: jsObject, name: Strings.displayWidth) + _displayHeight = ReadonlyAttribute(jsObject: jsObject, name: Strings.displayHeight) + _duration = ReadonlyAttribute(jsObject: jsObject, name: Strings.duration) + _timestamp = ReadonlyAttribute(jsObject: jsObject, name: Strings.timestamp) + _colorSpace = ReadonlyAttribute(jsObject: jsObject, name: Strings.colorSpace) self.jsObject = jsObject } - @ReadonlyAttribute - public var valueMissing: Bool + @inlinable public convenience init(image: CanvasImageSource, init: VideoFrameInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [image.jsValue, `init`?.jsValue ?? .undefined])) + } + + @inlinable public convenience init(data: BufferSource, init: VideoFrameBufferInit) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [data.jsValue, `init`.jsValue])) + } @ReadonlyAttribute - public var typeMismatch: Bool + public var format: VideoPixelFormat? @ReadonlyAttribute - public var patternMismatch: Bool + public var codedWidth: UInt32 @ReadonlyAttribute - public var tooLong: Bool + public var codedHeight: UInt32 @ReadonlyAttribute - public var tooShort: Bool + public var codedRect: DOMRectReadOnly? @ReadonlyAttribute - public var rangeUnderflow: Bool + public var visibleRect: DOMRectReadOnly? @ReadonlyAttribute - public var rangeOverflow: Bool + public var displayWidth: UInt32 @ReadonlyAttribute - public var stepMismatch: Bool + public var displayHeight: UInt32 @ReadonlyAttribute - public var badInput: Bool + public var duration: UInt64? @ReadonlyAttribute - public var customError: Bool + public var timestamp: Int64? @ReadonlyAttribute - public var valid: Bool + public var colorSpace: VideoColorSpace + + @inlinable public func allocationSize(options: VideoFrameCopyToOptions? = nil) -> UInt32 { + let this = jsObject + return this[Strings.allocationSize].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()! + } + + @inlinable public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) -> JSPromise { + let this = jsObject + return this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + } + + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @inlinable public func copyTo(destination: BufferSource, options: VideoFrameCopyToOptions? = nil) async throws -> [PlaneLayout] { + let this = jsObject + let _promise: JSPromise = this[Strings.copyTo].function!(this: this, arguments: [destination.jsValue, options?.jsValue ?? .undefined]).fromJSValue()! + return try await _promise.value.fromJSValue()! + } + + @inlinable public func clone() -> Self { + let this = jsObject + return this[Strings.clone].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable public func close() { + let this = jsObject + _ = this[Strings.close].function!(this: this, arguments: []) + } } -public class ValidityStateFlags: BridgedDictionary { - public convenience init(valueMissing: Bool, typeMismatch: Bool, patternMismatch: Bool, tooLong: Bool, tooShort: Bool, rangeUnderflow: Bool, rangeOverflow: Bool, stepMismatch: Bool, badInput: Bool, customError: Bool) { +public class VideoFrameBufferInit: BridgedDictionary { + public convenience init(format: VideoPixelFormat, codedWidth: UInt32, codedHeight: UInt32, timestamp: Int64, duration: UInt64, layout: [PlaneLayout], visibleRect: DOMRectInit, displayWidth: UInt32, displayHeight: UInt32, colorSpace: VideoColorSpaceInit) { let object = JSObject.global[Strings.Object].function!.new() - object[Strings.valueMissing] = valueMissing.jsValue - object[Strings.typeMismatch] = typeMismatch.jsValue - object[Strings.patternMismatch] = patternMismatch.jsValue - object[Strings.tooLong] = tooLong.jsValue - object[Strings.tooShort] = tooShort.jsValue - object[Strings.rangeUnderflow] = rangeUnderflow.jsValue - object[Strings.rangeOverflow] = rangeOverflow.jsValue - object[Strings.stepMismatch] = stepMismatch.jsValue - object[Strings.badInput] = badInput.jsValue - object[Strings.customError] = customError.jsValue + object[Strings.format] = format.jsValue + object[Strings.codedWidth] = codedWidth.jsValue + object[Strings.codedHeight] = codedHeight.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.duration] = duration.jsValue + object[Strings.layout] = layout.jsValue + object[Strings.visibleRect] = visibleRect.jsValue + object[Strings.displayWidth] = displayWidth.jsValue + object[Strings.displayHeight] = displayHeight.jsValue + object[Strings.colorSpace] = colorSpace.jsValue self.init(unsafelyWrapping: object) } public required init(unsafelyWrapping object: JSObject) { - _valueMissing = ReadWriteAttribute(jsObject: object, name: Strings.valueMissing) - _typeMismatch = ReadWriteAttribute(jsObject: object, name: Strings.typeMismatch) - _patternMismatch = ReadWriteAttribute(jsObject: object, name: Strings.patternMismatch) - _tooLong = ReadWriteAttribute(jsObject: object, name: Strings.tooLong) - _tooShort = ReadWriteAttribute(jsObject: object, name: Strings.tooShort) - _rangeUnderflow = ReadWriteAttribute(jsObject: object, name: Strings.rangeUnderflow) - _rangeOverflow = ReadWriteAttribute(jsObject: object, name: Strings.rangeOverflow) - _stepMismatch = ReadWriteAttribute(jsObject: object, name: Strings.stepMismatch) - _badInput = ReadWriteAttribute(jsObject: object, name: Strings.badInput) - _customError = ReadWriteAttribute(jsObject: object, name: Strings.customError) + _format = ReadWriteAttribute(jsObject: object, name: Strings.format) + _codedWidth = ReadWriteAttribute(jsObject: object, name: Strings.codedWidth) + _codedHeight = ReadWriteAttribute(jsObject: object, name: Strings.codedHeight) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + _visibleRect = ReadWriteAttribute(jsObject: object, name: Strings.visibleRect) + _displayWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayWidth) + _displayHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayHeight) + _colorSpace = ReadWriteAttribute(jsObject: object, name: Strings.colorSpace) super.init(unsafelyWrapping: object) } @ReadWriteAttribute - public var valueMissing: Bool + public var format: VideoPixelFormat @ReadWriteAttribute - public var typeMismatch: Bool + public var codedWidth: UInt32 @ReadWriteAttribute - public var patternMismatch: Bool + public var codedHeight: UInt32 @ReadWriteAttribute - public var tooLong: Bool + public var timestamp: Int64 @ReadWriteAttribute - public var tooShort: Bool + public var duration: UInt64 @ReadWriteAttribute - public var rangeUnderflow: Bool + public var layout: [PlaneLayout] @ReadWriteAttribute - public var rangeOverflow: Bool + public var visibleRect: DOMRectInit @ReadWriteAttribute - public var stepMismatch: Bool + public var displayWidth: UInt32 @ReadWriteAttribute - public var badInput: Bool + public var displayHeight: UInt32 @ReadWriteAttribute - public var customError: Bool + public var colorSpace: VideoColorSpaceInit } -public enum VideoFacingModeEnum: JSString, JSValueCompatible { - case user = "user" - case environment = "environment" - case left = "left" - case right = "right" +public class VideoFrameCopyToOptions: BridgedDictionary { + public convenience init(rect: DOMRectInit, layout: [PlaneLayout]) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.rect] = rect.jsValue + object[Strings.layout] = layout.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _rect = ReadWriteAttribute(jsObject: object, name: Strings.rect) + _layout = ReadWriteAttribute(jsObject: object, name: Strings.layout) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var rect: DOMRectInit + + @ReadWriteAttribute + public var layout: [PlaneLayout] +} + +public class VideoFrameInit: BridgedDictionary { + public convenience init(duration: UInt64, timestamp: Int64, alpha: AlphaOption, visibleRect: DOMRectInit, displayWidth: UInt32, displayHeight: UInt32) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.duration] = duration.jsValue + object[Strings.timestamp] = timestamp.jsValue + object[Strings.alpha] = alpha.jsValue + object[Strings.visibleRect] = visibleRect.jsValue + object[Strings.displayWidth] = displayWidth.jsValue + object[Strings.displayHeight] = displayHeight.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _duration = ReadWriteAttribute(jsObject: object, name: Strings.duration) + _timestamp = ReadWriteAttribute(jsObject: object, name: Strings.timestamp) + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _visibleRect = ReadWriteAttribute(jsObject: object, name: Strings.visibleRect) + _displayWidth = ReadWriteAttribute(jsObject: object, name: Strings.displayWidth) + _displayHeight = ReadWriteAttribute(jsObject: object, name: Strings.displayHeight) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var duration: UInt64 + + @ReadWriteAttribute + public var timestamp: Int64 + + @ReadWriteAttribute + public var alpha: AlphaOption + + @ReadWriteAttribute + public var visibleRect: DOMRectInit + + @ReadWriteAttribute + public var displayWidth: UInt32 + + @ReadWriteAttribute + public var displayHeight: UInt32 +} + +public enum VideoMatrixCoefficients: JSString, JSValueCompatible { + case rgb = "rgb" + case bt709 = "bt709" + case bt470bg = "bt470bg" + case smpte170m = "smpte170m" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public enum VideoPixelFormat: JSString, JSValueCompatible { + case i420 = "I420" + case i420A = "I420A" + case i422 = "I422" + case i444 = "I444" + case nV12 = "NV12" + case rGBA = "RGBA" + case rGBX = "RGBX" + case bGRA = "BGRA" + case bGRX = "BGRX" @inlinable public static func construct(from jsValue: JSValue) -> Self? { if let string = jsValue.jsString { @@ -14818,6 +16483,25 @@ public class VideoTrackList: EventTarget { public var onremovetrack: EventHandler } +public enum VideoTransferCharacteristics: JSString, JSValueCompatible { + case bt709 = "bt709" + case smpte170m = "smpte170m" + case iec6196621 = "iec61966-2-1" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + public class WheelEvent: MouseEvent { @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WheelEvent].function! } @@ -16437,6 +18121,9 @@ public enum console { @usableFromInline static let AnimationEffect: JSString = "AnimationEffect" @usableFromInline static let AnimationTimeline: JSString = "AnimationTimeline" @usableFromInline static let Attr: JSString = "Attr" + @usableFromInline static let AudioData: JSString = "AudioData" + @usableFromInline static let AudioDecoder: JSString = "AudioDecoder" + @usableFromInline static let AudioEncoder: JSString = "AudioEncoder" @usableFromInline static let AudioTrack: JSString = "AudioTrack" @usableFromInline static let AudioTrackList: JSString = "AudioTrackList" @usableFromInline static let BarProp: JSString = "BarProp" @@ -16482,6 +18169,8 @@ public enum console { @usableFromInline static let DragEvent: JSString = "DragEvent" @usableFromInline static let Element: JSString = "Element" @usableFromInline static let ElementInternals: JSString = "ElementInternals" + @usableFromInline static let EncodedAudioChunk: JSString = "EncodedAudioChunk" + @usableFromInline static let EncodedVideoChunk: JSString = "EncodedVideoChunk" @usableFromInline static let ErrorEvent: JSString = "ErrorEvent" @usableFromInline static let Event: JSString = "Event" @usableFromInline static let EventSource: JSString = "EventSource" @@ -16574,6 +18263,9 @@ public enum console { @usableFromInline static let ImageBitmap: JSString = "ImageBitmap" @usableFromInline static let ImageBitmapRenderingContext: JSString = "ImageBitmapRenderingContext" @usableFromInline static let ImageData: JSString = "ImageData" + @usableFromInline static let ImageDecoder: JSString = "ImageDecoder" + @usableFromInline static let ImageTrack: JSString = "ImageTrack" + @usableFromInline static let ImageTrackList: JSString = "ImageTrackList" @usableFromInline static let InputDeviceInfo: JSString = "InputDeviceInfo" @usableFromInline static let InputEvent: JSString = "InputEvent" @usableFromInline static let IsSearchProviderInstalled: JSString = "IsSearchProviderInstalled" @@ -16650,6 +18342,10 @@ public enum console { @usableFromInline static let URL: JSString = "URL" @usableFromInline static let URLSearchParams: JSString = "URLSearchParams" @usableFromInline static let ValidityState: JSString = "ValidityState" + @usableFromInline static let VideoColorSpace: JSString = "VideoColorSpace" + @usableFromInline static let VideoDecoder: JSString = "VideoDecoder" + @usableFromInline static let VideoEncoder: JSString = "VideoEncoder" + @usableFromInline static let VideoFrame: JSString = "VideoFrame" @usableFromInline static let VideoTrack: JSString = "VideoTrack" @usableFromInline static let VideoTrackList: JSString = "VideoTrackList" @usableFromInline static let WheelEvent: JSString = "WheelEvent" @@ -16700,15 +18396,18 @@ public enum console { @usableFromInline static let align: JSString = "align" @usableFromInline static let alinkColor: JSString = "alinkColor" @usableFromInline static let all: JSString = "all" + @usableFromInline static let allocationSize: JSString = "allocationSize" @usableFromInline static let allow: JSString = "allow" @usableFromInline static let allowFullscreen: JSString = "allowFullscreen" @usableFromInline static let alpha: JSString = "alpha" + @usableFromInline static let alphaSideData: JSString = "alphaSideData" @usableFromInline static let alphabeticBaseline: JSString = "alphabeticBaseline" @usableFromInline static let alt: JSString = "alt" @usableFromInline static let altKey: JSString = "altKey" @usableFromInline static let ancestorOrigins: JSString = "ancestorOrigins" @usableFromInline static let anchors: JSString = "anchors" @usableFromInline static let animate: JSString = "animate" + @usableFromInline static let animated: JSString = "animated" @usableFromInline static let appCodeName: JSString = "appCodeName" @usableFromInline static let appName: JSString = "appName" @usableFromInline static let appVersion: JSString = "appVersion" @@ -16801,6 +18500,8 @@ public enum console { @usableFromInline static let behavior: JSString = "behavior" @usableFromInline static let bezierCurveTo: JSString = "bezierCurveTo" @usableFromInline static let bgColor: JSString = "bgColor" + @usableFromInline static let bitrate: JSString = "bitrate" + @usableFromInline static let bitrateMode: JSString = "bitrateMode" @usableFromInline static let bitsPerSecond: JSString = "bitsPerSecond" @usableFromInline static let blob: JSString = "blob" @usableFromInline static let blocking: JSString = "blocking" @@ -16816,6 +18517,7 @@ public enum console { @usableFromInline static let button: JSString = "button" @usableFromInline static let buttons: JSString = "buttons" @usableFromInline static let byobRequest: JSString = "byobRequest" + @usableFromInline static let byteLength: JSString = "byteLength" @usableFromInline static let c: JSString = "c" @usableFromInline static let cache: JSString = "cache" @usableFromInline static let cacheName: JSString = "cacheName" @@ -16873,6 +18575,10 @@ public enum console { @usableFromInline static let code: JSString = "code" @usableFromInline static let codeBase: JSString = "codeBase" @usableFromInline static let codeType: JSString = "codeType" + @usableFromInline static let codec: JSString = "codec" + @usableFromInline static let codedHeight: JSString = "codedHeight" + @usableFromInline static let codedRect: JSString = "codedRect" + @usableFromInline static let codedWidth: JSString = "codedWidth" @usableFromInline static let colSpan: JSString = "colSpan" @usableFromInline static let collapse: JSString = "collapse" @usableFromInline static let collapsed: JSString = "collapsed" @@ -16890,10 +18596,14 @@ public enum console { @usableFromInline static let comparePoint: JSString = "comparePoint" @usableFromInline static let compatMode: JSString = "compatMode" @usableFromInline static let complete: JSString = "complete" + @usableFromInline static let completeFramesOnly: JSString = "completeFramesOnly" + @usableFromInline static let completed: JSString = "completed" @usableFromInline static let composed: JSString = "composed" @usableFromInline static let composedPath: JSString = "composedPath" @usableFromInline static let composite: JSString = "composite" @usableFromInline static let computedOffset: JSString = "computedOffset" + @usableFromInline static let config: JSString = "config" + @usableFromInline static let configure: JSString = "configure" @usableFromInline static let confirm: JSString = "confirm" @usableFromInline static let console: JSString = "console" @usableFromInline static let constraint: JSString = "constraint" @@ -16910,6 +18620,7 @@ public enum console { @usableFromInline static let cookie: JSString = "cookie" @usableFromInline static let cookieEnabled: JSString = "cookieEnabled" @usableFromInline static let coords: JSString = "coords" + @usableFromInline static let copyTo: JSString = "copyTo" @usableFromInline static let count: JSString = "count" @usableFromInline static let countReset: JSString = "countReset" @usableFromInline static let createAttribute: JSString = "createAttribute" @@ -16958,6 +18669,8 @@ public enum console { @usableFromInline static let debug: JSString = "debug" @usableFromInline static let declare: JSString = "declare" @usableFromInline static let decode: JSString = "decode" + @usableFromInline static let decodeQueueSize: JSString = "decodeQueueSize" + @usableFromInline static let decoderConfig: JSString = "decoderConfig" @usableFromInline static let decoding: JSString = "decoding" @usableFromInline static let `default`: JSString = "default" @usableFromInline static let defaultChecked: JSString = "defaultChecked" @@ -16985,7 +18698,9 @@ public enum console { @usableFromInline static let deltaZ: JSString = "deltaZ" @usableFromInline static let description: JSString = "description" @usableFromInline static let designMode: JSString = "designMode" + @usableFromInline static let desiredHeight: JSString = "desiredHeight" @usableFromInline static let desiredSize: JSString = "desiredSize" + @usableFromInline static let desiredWidth: JSString = "desiredWidth" @usableFromInline static let destination: JSString = "destination" @usableFromInline static let desynchronized: JSString = "desynchronized" @usableFromInline static let detach: JSString = "detach" @@ -16999,6 +18714,10 @@ public enum console { @usableFromInline static let disabled: JSString = "disabled" @usableFromInline static let disconnect: JSString = "disconnect" @usableFromInline static let dispatchEvent: JSString = "dispatchEvent" + @usableFromInline static let displayAspectHeight: JSString = "displayAspectHeight" + @usableFromInline static let displayAspectWidth: JSString = "displayAspectWidth" + @usableFromInline static let displayHeight: JSString = "displayHeight" + @usableFromInline static let displayWidth: JSString = "displayWidth" @usableFromInline static let doctype: JSString = "doctype" @usableFromInline static let document: JSString = "document" @usableFromInline static let documentElement: JSString = "documentElement" @@ -17024,6 +18743,8 @@ public enum console { @usableFromInline static let enable: JSString = "enable" @usableFromInline static let enabled: JSString = "enabled" @usableFromInline static let enabledPlugin: JSString = "enabledPlugin" + @usableFromInline static let encode: JSString = "encode" + @usableFromInline static let encodeQueueSize: JSString = "encodeQueueSize" @usableFromInline static let encoding: JSString = "encoding" @usableFromInline static let enctype: JSString = "enctype" @usableFromInline static let end: JSString = "end" @@ -17080,12 +18801,17 @@ public enum console { @usableFromInline static let formMethod: JSString = "formMethod" @usableFromInline static let formNoValidate: JSString = "formNoValidate" @usableFromInline static let formTarget: JSString = "formTarget" + @usableFromInline static let format: JSString = "format" @usableFromInline static let forms: JSString = "forms" @usableFromInline static let forward: JSString = "forward" @usableFromInline static let frame: JSString = "frame" @usableFromInline static let frameBorder: JSString = "frameBorder" + @usableFromInline static let frameCount: JSString = "frameCount" @usableFromInline static let frameElement: JSString = "frameElement" + @usableFromInline static let frameIndex: JSString = "frameIndex" + @usableFromInline static let frameOffset: JSString = "frameOffset" @usableFromInline static let frameRate: JSString = "frameRate" + @usableFromInline static let framerate: JSString = "framerate" @usableFromInline static let frames: JSString = "frames" @usableFromInline static let fromFloat32Array: JSString = "fromFloat32Array" @usableFromInline static let fromFloat64Array: JSString = "fromFloat64Array" @@ -17093,6 +18819,7 @@ public enum console { @usableFromInline static let fromPoint: JSString = "fromPoint" @usableFromInline static let fromQuad: JSString = "fromQuad" @usableFromInline static let fromRect: JSString = "fromRect" + @usableFromInline static let fullRange: JSString = "fullRange" @usableFromInline static let get: JSString = "get" @usableFromInline static let getAll: JSString = "getAll" @usableFromInline static let getAllResponseHeaders: JSString = "getAllResponseHeaders" @@ -17149,6 +18876,7 @@ public enum console { @usableFromInline static let groupId: JSString = "groupId" @usableFromInline static let handled: JSString = "handled" @usableFromInline static let hangingBaseline: JSString = "hangingBaseline" + @usableFromInline static let hardwareAcceleration: JSString = "hardwareAcceleration" @usableFromInline static let hardwareConcurrency: JSString = "hardwareConcurrency" @usableFromInline static let has: JSString = "has" @usableFromInline static let hasAttribute: JSString = "hasAttribute" @@ -17179,6 +18907,7 @@ public enum console { @usableFromInline static let ignoreMethod: JSString = "ignoreMethod" @usableFromInline static let ignoreSearch: JSString = "ignoreSearch" @usableFromInline static let ignoreVary: JSString = "ignoreVary" + @usableFromInline static let image: JSString = "image" @usableFromInline static let imageOrientation: JSString = "imageOrientation" @usableFromInline static let imageSizes: JSString = "imageSizes" @usableFromInline static let imageSmoothingEnabled: JSString = "imageSmoothingEnabled" @@ -17223,6 +18952,7 @@ public enum console { @usableFromInline static let `is`: JSString = "is" @usableFromInline static let is2D: JSString = "is2D" @usableFromInline static let isComposing: JSString = "isComposing" + @usableFromInline static let isConfigSupported: JSString = "isConfigSupported" @usableFromInline static let isConnected: JSString = "isConnected" @usableFromInline static let isContentEditable: JSString = "isContentEditable" @usableFromInline static let isContextLost: JSString = "isContextLost" @@ -17249,6 +18979,7 @@ public enum console { @usableFromInline static let keepalive: JSString = "keepalive" @usableFromInline static let key: JSString = "key" @usableFromInline static let keyCode: JSString = "keyCode" + @usableFromInline static let keyFrame: JSString = "keyFrame" @usableFromInline static let keys: JSString = "keys" @usableFromInline static let kind: JSString = "kind" @usableFromInline static let label: JSString = "label" @@ -17261,6 +18992,8 @@ public enum console { @usableFromInline static let lastEventId: JSString = "lastEventId" @usableFromInline static let lastModified: JSString = "lastModified" @usableFromInline static let latency: JSString = "latency" + @usableFromInline static let latencyMode: JSString = "latencyMode" + @usableFromInline static let layout: JSString = "layout" @usableFromInline static let left: JSString = "left" @usableFromInline static let length: JSString = "length" @usableFromInline static let lengthComputable: JSString = "lengthComputable" @@ -17311,6 +19044,7 @@ public enum console { @usableFromInline static let match: JSString = "match" @usableFromInline static let matchAll: JSString = "matchAll" @usableFromInline static let matches: JSString = "matches" + @usableFromInline static let matrix: JSString = "matrix" @usableFromInline static let matrixTransform: JSString = "matrixTransform" @usableFromInline static let max: JSString = "max" @usableFromInline static let maxLength: JSString = "maxLength" @@ -17368,6 +19102,8 @@ public enum console { @usableFromInline static let nonce: JSString = "nonce" @usableFromInline static let normalize: JSString = "normalize" @usableFromInline static let now: JSString = "now" + @usableFromInline static let numberOfChannels: JSString = "numberOfChannels" + @usableFromInline static let numberOfFrames: JSString = "numberOfFrames" @usableFromInline static let numberValue: JSString = "numberValue" @usableFromInline static let observe: JSString = "observe" @usableFromInline static let offset: JSString = "offset" @@ -17486,6 +19222,7 @@ public enum console { @usableFromInline static let onwheel: JSString = "onwheel" @usableFromInline static let open: JSString = "open" @usableFromInline static let opener: JSString = "opener" + @usableFromInline static let optimizeForLatency: JSString = "optimizeForLatency" @usableFromInline static let optimum: JSString = "optimum" @usableFromInline static let options: JSString = "options" @usableFromInline static let origin: JSString = "origin" @@ -17493,6 +19230,7 @@ public enum console { @usableFromInline static let originTime: JSString = "originTime" @usableFromInline static let oscpu: JSString = "oscpu" @usableFromInline static let outerText: JSString = "outerText" + @usableFromInline static let output: JSString = "output" @usableFromInline static let overrideMimeType: JSString = "overrideMimeType" @usableFromInline static let ownerDocument: JSString = "ownerDocument" @usableFromInline static let ownerElement: JSString = "ownerElement" @@ -17524,6 +19262,7 @@ public enum console { @usableFromInline static let pipeThrough: JSString = "pipeThrough" @usableFromInline static let pipeTo: JSString = "pipeTo" @usableFromInline static let placeholder: JSString = "placeholder" + @usableFromInline static let planeIndex: JSString = "planeIndex" @usableFromInline static let platform: JSString = "platform" @usableFromInline static let play: JSString = "play" @usableFromInline static let playState: JSString = "playState" @@ -17540,6 +19279,7 @@ public enum console { @usableFromInline static let postMessage: JSString = "postMessage" @usableFromInline static let poster: JSString = "poster" @usableFromInline static let preMultiplySelf: JSString = "preMultiplySelf" + @usableFromInline static let preferAnimation: JSString = "preferAnimation" @usableFromInline static let prefix: JSString = "prefix" @usableFromInline static let preload: JSString = "preload" @usableFromInline static let preloadResponse: JSString = "preloadResponse" @@ -17555,6 +19295,7 @@ public enum console { @usableFromInline static let previousElementSibling: JSString = "previousElementSibling" @usableFromInline static let previousNode: JSString = "previousNode" @usableFromInline static let previousSibling: JSString = "previousSibling" + @usableFromInline static let primaries: JSString = "primaries" @usableFromInline static let print: JSString = "print" @usableFromInline static let product: JSString = "product" @usableFromInline static let productSub: JSString = "productSub" @@ -17618,6 +19359,7 @@ public enum console { @usableFromInline static let removeTrack: JSString = "removeTrack" @usableFromInline static let removedNodes: JSString = "removedNodes" @usableFromInline static let `repeat`: JSString = "repeat" + @usableFromInline static let repetitionCount: JSString = "repetitionCount" @usableFromInline static let replace: JSString = "replace" @usableFromInline static let replaceChild: JSString = "replaceChild" @usableFromInline static let replaceChildren: JSString = "replaceChildren" @@ -17672,6 +19414,7 @@ public enum console { @usableFromInline static let sampleSize: JSString = "sampleSize" @usableFromInline static let sandbox: JSString = "sandbox" @usableFromInline static let save: JSString = "save" + @usableFromInline static let scalabilityMode: JSString = "scalabilityMode" @usableFromInline static let scale: JSString = "scale" @usableFromInline static let scale3d: JSString = "scale3d" @usableFromInline static let scale3dSelf: JSString = "scale3dSelf" @@ -17700,6 +19443,7 @@ public enum console { @usableFromInline static let selected: JSString = "selected" @usableFromInline static let selectedIndex: JSString = "selectedIndex" @usableFromInline static let selectedOptions: JSString = "selectedOptions" + @usableFromInline static let selectedTrack: JSString = "selectedTrack" @usableFromInline static let selectionDirection: JSString = "selectionDirection" @usableFromInline static let selectionEnd: JSString = "selectionEnd" @usableFromInline static let selectionStart: JSString = "selectionStart" @@ -17788,6 +19532,7 @@ public enum console { @usableFromInline static let stopPropagation: JSString = "stopPropagation" @usableFromInline static let storageArea: JSString = "storageArea" @usableFromInline static let stream: JSString = "stream" + @usableFromInline static let stride: JSString = "stride" @usableFromInline static let stringValue: JSString = "stringValue" @usableFromInline static let stroke: JSString = "stroke" @usableFromInline static let strokeRect: JSString = "strokeRect" @@ -17800,8 +19545,10 @@ public enum console { @usableFromInline static let subtree: JSString = "subtree" @usableFromInline static let suffixes: JSString = "suffixes" @usableFromInline static let summary: JSString = "summary" + @usableFromInline static let supported: JSString = "supported" @usableFromInline static let supports: JSString = "supports" @usableFromInline static let surroundContents: JSString = "surroundContents" + @usableFromInline static let svc: JSString = "svc" @usableFromInline static let systemId: JSString = "systemId" @usableFromInline static let tBodies: JSString = "tBodies" @usableFromInline static let tFoot: JSString = "tFoot" @@ -17814,6 +19561,7 @@ public enum console { @usableFromInline static let target: JSString = "target" @usableFromInline static let targetOrigin: JSString = "targetOrigin" @usableFromInline static let tee: JSString = "tee" + @usableFromInline static let temporalLayerId: JSString = "temporalLayerId" @usableFromInline static let terminate: JSString = "terminate" @usableFromInline static let text: JSString = "text" @usableFromInline static let textAlign: JSString = "textAlign" @@ -17831,6 +19579,7 @@ public enum console { @usableFromInline static let timecode: JSString = "timecode" @usableFromInline static let timeline: JSString = "timeline" @usableFromInline static let timeout: JSString = "timeout" + @usableFromInline static let timestamp: JSString = "timestamp" @usableFromInline static let title: JSString = "title" @usableFromInline static let toDataURL: JSString = "toDataURL" @usableFromInline static let toFloat32Array: JSString = "toFloat32Array" @@ -17846,6 +19595,7 @@ public enum console { @usableFromInline static let total: JSString = "total" @usableFromInline static let trace: JSString = "trace" @usableFromInline static let track: JSString = "track" + @usableFromInline static let tracks: JSString = "tracks" @usableFromInline static let transfer: JSString = "transfer" @usableFromInline static let transferControlToOffscreen: JSString = "transferControlToOffscreen" @usableFromInline static let transferFromImageBitmap: JSString = "transferFromImageBitmap" @@ -17893,6 +19643,7 @@ public enum console { @usableFromInline static let view: JSString = "view" @usableFromInline static let visibilityState: JSString = "visibilityState" @usableFromInline static let visible: JSString = "visible" + @usableFromInline static let visibleRect: JSString = "visibleRect" @usableFromInline static let vlinkColor: JSString = "vlinkColor" @usableFromInline static let volume: JSString = "volume" @usableFromInline static let vspace: JSString = "vspace" @@ -19320,6 +21071,48 @@ public enum ImageBitmapSource: JSValueCompatible, Any_ImageBitmapSource { } } +public protocol Any_ImageBufferSource: ConvertibleToJSValue {} +extension BufferSource: Any_ImageBufferSource {} +extension ReadableStream: Any_ImageBufferSource {} + +public enum ImageBufferSource: JSValueCompatible, Any_ImageBufferSource { + case bufferSource(BufferSource) + case readableStream(ReadableStream) + + var bufferSource: BufferSource? { + switch self { + case let .bufferSource(bufferSource): return bufferSource + default: return nil + } + } + + var readableStream: ReadableStream? { + switch self { + case let .readableStream(readableStream): return readableStream + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let bufferSource: BufferSource = value.fromJSValue() { + return .bufferSource(bufferSource) + } + if let readableStream: ReadableStream = value.fromJSValue() { + return .readableStream(readableStream) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .bufferSource(bufferSource): + return bufferSource.jsValue + case let .readableStream(readableStream): + return readableStream.jsValue + } + } +} + public protocol Any_MessageEventSource: ConvertibleToJSValue {} extension MessagePort: Any_MessageEventSource {} extension ServiceWorker: Any_MessageEventSource {} From ee0b3d028b6131393a35dd1ba3e402f6c1fd7120 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 2 May 2022 16:15:27 +0100 Subject: [PATCH 7/8] Add `webgl1` IDL spec and generated code --- Sources/DOMKit/WebIDL/Float32List.swift | 46 + Sources/DOMKit/WebIDL/Int32List.swift | 46 + Sources/DOMKit/WebIDL/TexImageSource.swift | 116 ++ Sources/DOMKit/WebIDL/WebGLActiveInfo.swift | 26 + Sources/DOMKit/WebIDL/WebGLBuffer.swift | 12 + .../WebIDL/WebGLContextAttributes.swift | 60 + Sources/DOMKit/WebIDL/WebGLContextEvent.swift | 20 + .../DOMKit/WebIDL/WebGLContextEventInit.swift | 20 + Sources/DOMKit/WebIDL/WebGLFramebuffer.swift | 12 + Sources/DOMKit/WebIDL/WebGLObject.swift | 14 + .../DOMKit/WebIDL/WebGLPowerPreference.swift | 23 + Sources/DOMKit/WebIDL/WebGLProgram.swift | 12 + Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift | 12 + .../DOMKit/WebIDL/WebGLRenderingContext.swift | 14 + .../WebIDL/WebGLRenderingContextBase.swift | 1217 +++++++++++++++++ .../WebGLRenderingContextOverloads.swift | 165 +++ Sources/DOMKit/WebIDL/WebGLShader.swift | 12 + .../WebIDL/WebGLShaderPrecisionFormat.swift | 26 + Sources/DOMKit/WebIDL/WebGLTexture.swift | 12 + .../DOMKit/WebIDL/WebGLUniformLocation.swift | 14 + parse-idl/parse-all.js | 1 + 21 files changed, 1880 insertions(+) create mode 100644 Sources/DOMKit/WebIDL/Float32List.swift create mode 100644 Sources/DOMKit/WebIDL/Int32List.swift create mode 100644 Sources/DOMKit/WebIDL/TexImageSource.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLActiveInfo.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLBuffer.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLContextAttributes.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLContextEvent.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLContextEventInit.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLFramebuffer.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLObject.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLPowerPreference.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLProgram.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLRenderingContext.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLShader.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLTexture.swift create mode 100644 Sources/DOMKit/WebIDL/WebGLUniformLocation.swift diff --git a/Sources/DOMKit/WebIDL/Float32List.swift b/Sources/DOMKit/WebIDL/Float32List.swift new file mode 100644 index 00000000..1f1e5bdb --- /dev/null +++ b/Sources/DOMKit/WebIDL/Float32List.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Float32List: ConvertibleToJSValue {} +extension Float32Array: Any_Float32List {} +extension Array: Any_Float32List where Element == GLfloat {} + +public enum Float32List: JSValueCompatible, Any_Float32List { + case float32Array(Float32Array) + case seq_of_GLfloat([GLfloat]) + + var float32Array: Float32Array? { + switch self { + case let .float32Array(float32Array): return float32Array + default: return nil + } + } + + var seq_of_GLfloat: [GLfloat]? { + switch self { + case let .seq_of_GLfloat(seq_of_GLfloat): return seq_of_GLfloat + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let float32Array: Float32Array = value.fromJSValue() { + return .float32Array(float32Array) + } + if let seq_of_GLfloat: [GLfloat] = value.fromJSValue() { + return .seq_of_GLfloat(seq_of_GLfloat) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .float32Array(float32Array): + return float32Array.jsValue + case let .seq_of_GLfloat(seq_of_GLfloat): + return seq_of_GLfloat.jsValue + } + } +} diff --git a/Sources/DOMKit/WebIDL/Int32List.swift b/Sources/DOMKit/WebIDL/Int32List.swift new file mode 100644 index 00000000..ce876a5b --- /dev/null +++ b/Sources/DOMKit/WebIDL/Int32List.swift @@ -0,0 +1,46 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_Int32List: ConvertibleToJSValue {} +extension Int32Array: Any_Int32List {} +extension Array: Any_Int32List where Element == GLint {} + +public enum Int32List: JSValueCompatible, Any_Int32List { + case int32Array(Int32Array) + case seq_of_GLint([GLint]) + + var int32Array: Int32Array? { + switch self { + case let .int32Array(int32Array): return int32Array + default: return nil + } + } + + var seq_of_GLint: [GLint]? { + switch self { + case let .seq_of_GLint(seq_of_GLint): return seq_of_GLint + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let int32Array: Int32Array = value.fromJSValue() { + return .int32Array(int32Array) + } + if let seq_of_GLint: [GLint] = value.fromJSValue() { + return .seq_of_GLint(seq_of_GLint) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .int32Array(int32Array): + return int32Array.jsValue + case let .seq_of_GLint(seq_of_GLint): + return seq_of_GLint.jsValue + } + } +} diff --git a/Sources/DOMKit/WebIDL/TexImageSource.swift b/Sources/DOMKit/WebIDL/TexImageSource.swift new file mode 100644 index 00000000..d5750fff --- /dev/null +++ b/Sources/DOMKit/WebIDL/TexImageSource.swift @@ -0,0 +1,116 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol Any_TexImageSource: ConvertibleToJSValue {} +extension HTMLCanvasElement: Any_TexImageSource {} +extension HTMLImageElement: Any_TexImageSource {} +extension HTMLVideoElement: Any_TexImageSource {} +extension ImageBitmap: Any_TexImageSource {} +extension ImageData: Any_TexImageSource {} +extension OffscreenCanvas: Any_TexImageSource {} +extension VideoFrame: Any_TexImageSource {} + +public enum TexImageSource: JSValueCompatible, Any_TexImageSource { + case htmlCanvasElement(HTMLCanvasElement) + case htmlImageElement(HTMLImageElement) + case htmlVideoElement(HTMLVideoElement) + case imageBitmap(ImageBitmap) + case imageData(ImageData) + case offscreenCanvas(OffscreenCanvas) + case videoFrame(VideoFrame) + + var htmlCanvasElement: HTMLCanvasElement? { + switch self { + case let .htmlCanvasElement(htmlCanvasElement): return htmlCanvasElement + default: return nil + } + } + + var htmlImageElement: HTMLImageElement? { + switch self { + case let .htmlImageElement(htmlImageElement): return htmlImageElement + default: return nil + } + } + + var htmlVideoElement: HTMLVideoElement? { + switch self { + case let .htmlVideoElement(htmlVideoElement): return htmlVideoElement + default: return nil + } + } + + var imageBitmap: ImageBitmap? { + switch self { + case let .imageBitmap(imageBitmap): return imageBitmap + default: return nil + } + } + + var imageData: ImageData? { + switch self { + case let .imageData(imageData): return imageData + default: return nil + } + } + + var offscreenCanvas: OffscreenCanvas? { + switch self { + case let .offscreenCanvas(offscreenCanvas): return offscreenCanvas + default: return nil + } + } + + var videoFrame: VideoFrame? { + switch self { + case let .videoFrame(videoFrame): return videoFrame + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let htmlCanvasElement: HTMLCanvasElement = value.fromJSValue() { + return .htmlCanvasElement(htmlCanvasElement) + } + if let htmlImageElement: HTMLImageElement = value.fromJSValue() { + return .htmlImageElement(htmlImageElement) + } + if let htmlVideoElement: HTMLVideoElement = value.fromJSValue() { + return .htmlVideoElement(htmlVideoElement) + } + if let imageBitmap: ImageBitmap = value.fromJSValue() { + return .imageBitmap(imageBitmap) + } + if let imageData: ImageData = value.fromJSValue() { + return .imageData(imageData) + } + if let offscreenCanvas: OffscreenCanvas = value.fromJSValue() { + return .offscreenCanvas(offscreenCanvas) + } + if let videoFrame: VideoFrame = value.fromJSValue() { + return .videoFrame(videoFrame) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .htmlCanvasElement(htmlCanvasElement): + return htmlCanvasElement.jsValue + case let .htmlImageElement(htmlImageElement): + return htmlImageElement.jsValue + case let .htmlVideoElement(htmlVideoElement): + return htmlVideoElement.jsValue + case let .imageBitmap(imageBitmap): + return imageBitmap.jsValue + case let .imageData(imageData): + return imageData.jsValue + case let .offscreenCanvas(offscreenCanvas): + return offscreenCanvas.jsValue + case let .videoFrame(videoFrame): + return videoFrame.jsValue + } + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift b/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift new file mode 100644 index 00000000..38991452 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLActiveInfo: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLActiveInfo].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var size: GLint + + @ReadonlyAttribute + public var type: GLenum + + @ReadonlyAttribute + public var name: String +} diff --git a/Sources/DOMKit/WebIDL/WebGLBuffer.swift b/Sources/DOMKit/WebIDL/WebGLBuffer.swift new file mode 100644 index 00000000..c5217eb0 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLBuffer.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLBuffer: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLBuffer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift b/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift new file mode 100644 index 00000000..28853501 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift @@ -0,0 +1,60 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLContextAttributes: BridgedDictionary { + public convenience init(alpha: Bool, depth: Bool, stencil: Bool, antialias: Bool, premultipliedAlpha: Bool, preserveDrawingBuffer: Bool, powerPreference: WebGLPowerPreference, failIfMajorPerformanceCaveat: Bool, desynchronized: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.alpha] = alpha.jsValue + object[Strings.depth] = depth.jsValue + object[Strings.stencil] = stencil.jsValue + object[Strings.antialias] = antialias.jsValue + object[Strings.premultipliedAlpha] = premultipliedAlpha.jsValue + object[Strings.preserveDrawingBuffer] = preserveDrawingBuffer.jsValue + object[Strings.powerPreference] = powerPreference.jsValue + object[Strings.failIfMajorPerformanceCaveat] = failIfMajorPerformanceCaveat.jsValue + object[Strings.desynchronized] = desynchronized.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _depth = ReadWriteAttribute(jsObject: object, name: Strings.depth) + _stencil = ReadWriteAttribute(jsObject: object, name: Strings.stencil) + _antialias = ReadWriteAttribute(jsObject: object, name: Strings.antialias) + _premultipliedAlpha = ReadWriteAttribute(jsObject: object, name: Strings.premultipliedAlpha) + _preserveDrawingBuffer = ReadWriteAttribute(jsObject: object, name: Strings.preserveDrawingBuffer) + _powerPreference = ReadWriteAttribute(jsObject: object, name: Strings.powerPreference) + _failIfMajorPerformanceCaveat = ReadWriteAttribute(jsObject: object, name: Strings.failIfMajorPerformanceCaveat) + _desynchronized = ReadWriteAttribute(jsObject: object, name: Strings.desynchronized) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var alpha: Bool + + @ReadWriteAttribute + public var depth: Bool + + @ReadWriteAttribute + public var stencil: Bool + + @ReadWriteAttribute + public var antialias: Bool + + @ReadWriteAttribute + public var premultipliedAlpha: Bool + + @ReadWriteAttribute + public var preserveDrawingBuffer: Bool + + @ReadWriteAttribute + public var powerPreference: WebGLPowerPreference + + @ReadWriteAttribute + public var failIfMajorPerformanceCaveat: Bool + + @ReadWriteAttribute + public var desynchronized: Bool +} diff --git a/Sources/DOMKit/WebIDL/WebGLContextEvent.swift b/Sources/DOMKit/WebIDL/WebGLContextEvent.swift new file mode 100644 index 00000000..20837070 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLContextEvent.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLContextEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLContextEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _statusMessage = ReadonlyAttribute(jsObject: jsObject, name: Strings.statusMessage) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(type: String, eventInit: WebGLContextEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInit?.jsValue ?? .undefined])) + } + + @ReadonlyAttribute + public var statusMessage: String +} diff --git a/Sources/DOMKit/WebIDL/WebGLContextEventInit.swift b/Sources/DOMKit/WebIDL/WebGLContextEventInit.swift new file mode 100644 index 00000000..20c0c668 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLContextEventInit.swift @@ -0,0 +1,20 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLContextEventInit: BridgedDictionary { + public convenience init(statusMessage: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.statusMessage] = statusMessage.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _statusMessage = ReadWriteAttribute(jsObject: object, name: Strings.statusMessage) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var statusMessage: String +} diff --git a/Sources/DOMKit/WebIDL/WebGLFramebuffer.swift b/Sources/DOMKit/WebIDL/WebGLFramebuffer.swift new file mode 100644 index 00000000..83d1af39 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLFramebuffer.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLFramebuffer: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLFramebuffer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLObject.swift b/Sources/DOMKit/WebIDL/WebGLObject.swift new file mode 100644 index 00000000..c50d37fc --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLObject.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLObject: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLObject].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift b/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift new file mode 100644 index 00000000..ce6b23f8 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift @@ -0,0 +1,23 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public enum WebGLPowerPreference: JSString, JSValueCompatible { + case `default` = "default" + case lowPower = "low-power" + case highPerformance = "high-performance" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} diff --git a/Sources/DOMKit/WebIDL/WebGLProgram.swift b/Sources/DOMKit/WebIDL/WebGLProgram.swift new file mode 100644 index 00000000..e38d4a93 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLProgram.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLProgram: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLProgram].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift b/Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift new file mode 100644 index 00000000..3b364894 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLRenderbuffer: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLRenderbuffer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContext.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContext.swift new file mode 100644 index 00000000..f9919cbe --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContext.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLRenderingContext: JSBridgedClass, WebGLRenderingContextBase, WebGLRenderingContextOverloads { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLRenderingContext].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift new file mode 100644 index 00000000..c0baf5db --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift @@ -0,0 +1,1217 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol WebGLRenderingContextBase: JSBridgedClass {} +public extension WebGLRenderingContextBase { + @inlinable static var DEPTH_BUFFER_BIT: GLenum { 0x0000_0100 } + + @inlinable static var STENCIL_BUFFER_BIT: GLenum { 0x0000_0400 } + + @inlinable static var COLOR_BUFFER_BIT: GLenum { 0x0000_4000 } + + @inlinable static var POINTS: GLenum { 0x0000 } + + @inlinable static var LINES: GLenum { 0x0001 } + + @inlinable static var LINE_LOOP: GLenum { 0x0002 } + + @inlinable static var LINE_STRIP: GLenum { 0x0003 } + + @inlinable static var TRIANGLES: GLenum { 0x0004 } + + @inlinable static var TRIANGLE_STRIP: GLenum { 0x0005 } + + @inlinable static var TRIANGLE_FAN: GLenum { 0x0006 } + + @inlinable static var ZERO: GLenum { 0 } + + @inlinable static var ONE: GLenum { 1 } + + @inlinable static var SRC_COLOR: GLenum { 0x0300 } + + @inlinable static var ONE_MINUS_SRC_COLOR: GLenum { 0x0301 } + + @inlinable static var SRC_ALPHA: GLenum { 0x0302 } + + @inlinable static var ONE_MINUS_SRC_ALPHA: GLenum { 0x0303 } + + @inlinable static var DST_ALPHA: GLenum { 0x0304 } + + @inlinable static var ONE_MINUS_DST_ALPHA: GLenum { 0x0305 } + + @inlinable static var DST_COLOR: GLenum { 0x0306 } + + @inlinable static var ONE_MINUS_DST_COLOR: GLenum { 0x0307 } + + @inlinable static var SRC_ALPHA_SATURATE: GLenum { 0x0308 } + + @inlinable static var FUNC_ADD: GLenum { 0x8006 } + + @inlinable static var BLEND_EQUATION: GLenum { 0x8009 } + + @inlinable static var BLEND_EQUATION_RGB: GLenum { 0x8009 } + + @inlinable static var BLEND_EQUATION_ALPHA: GLenum { 0x883D } + + @inlinable static var FUNC_SUBTRACT: GLenum { 0x800A } + + @inlinable static var FUNC_REVERSE_SUBTRACT: GLenum { 0x800B } + + @inlinable static var BLEND_DST_RGB: GLenum { 0x80C8 } + + @inlinable static var BLEND_SRC_RGB: GLenum { 0x80C9 } + + @inlinable static var BLEND_DST_ALPHA: GLenum { 0x80CA } + + @inlinable static var BLEND_SRC_ALPHA: GLenum { 0x80CB } + + @inlinable static var CONSTANT_COLOR: GLenum { 0x8001 } + + @inlinable static var ONE_MINUS_CONSTANT_COLOR: GLenum { 0x8002 } + + @inlinable static var CONSTANT_ALPHA: GLenum { 0x8003 } + + @inlinable static var ONE_MINUS_CONSTANT_ALPHA: GLenum { 0x8004 } + + @inlinable static var BLEND_COLOR: GLenum { 0x8005 } + + @inlinable static var ARRAY_BUFFER: GLenum { 0x8892 } + + @inlinable static var ELEMENT_ARRAY_BUFFER: GLenum { 0x8893 } + + @inlinable static var ARRAY_BUFFER_BINDING: GLenum { 0x8894 } + + @inlinable static var ELEMENT_ARRAY_BUFFER_BINDING: GLenum { 0x8895 } + + @inlinable static var STREAM_DRAW: GLenum { 0x88E0 } + + @inlinable static var STATIC_DRAW: GLenum { 0x88E4 } + + @inlinable static var DYNAMIC_DRAW: GLenum { 0x88E8 } + + @inlinable static var BUFFER_SIZE: GLenum { 0x8764 } + + @inlinable static var BUFFER_USAGE: GLenum { 0x8765 } + + @inlinable static var CURRENT_VERTEX_ATTRIB: GLenum { 0x8626 } + + @inlinable static var FRONT: GLenum { 0x0404 } + + @inlinable static var BACK: GLenum { 0x0405 } + + @inlinable static var FRONT_AND_BACK: GLenum { 0x0408 } + + @inlinable static var CULL_FACE: GLenum { 0x0B44 } + + @inlinable static var BLEND: GLenum { 0x0BE2 } + + @inlinable static var DITHER: GLenum { 0x0BD0 } + + @inlinable static var STENCIL_TEST: GLenum { 0x0B90 } + + @inlinable static var DEPTH_TEST: GLenum { 0x0B71 } + + @inlinable static var SCISSOR_TEST: GLenum { 0x0C11 } + + @inlinable static var POLYGON_OFFSET_FILL: GLenum { 0x8037 } + + @inlinable static var SAMPLE_ALPHA_TO_COVERAGE: GLenum { 0x809E } + + @inlinable static var SAMPLE_COVERAGE: GLenum { 0x80A0 } + + @inlinable static var NO_ERROR: GLenum { 0 } + + @inlinable static var INVALID_ENUM: GLenum { 0x0500 } + + @inlinable static var INVALID_VALUE: GLenum { 0x0501 } + + @inlinable static var INVALID_OPERATION: GLenum { 0x0502 } + + @inlinable static var OUT_OF_MEMORY: GLenum { 0x0505 } + + @inlinable static var CW: GLenum { 0x0900 } + + @inlinable static var CCW: GLenum { 0x0901 } + + @inlinable static var LINE_WIDTH: GLenum { 0x0B21 } + + @inlinable static var ALIASED_POINT_SIZE_RANGE: GLenum { 0x846D } + + @inlinable static var ALIASED_LINE_WIDTH_RANGE: GLenum { 0x846E } + + @inlinable static var CULL_FACE_MODE: GLenum { 0x0B45 } + + @inlinable static var FRONT_FACE: GLenum { 0x0B46 } + + @inlinable static var DEPTH_RANGE: GLenum { 0x0B70 } + + @inlinable static var DEPTH_WRITEMASK: GLenum { 0x0B72 } + + @inlinable static var DEPTH_CLEAR_VALUE: GLenum { 0x0B73 } + + @inlinable static var DEPTH_FUNC: GLenum { 0x0B74 } + + @inlinable static var STENCIL_CLEAR_VALUE: GLenum { 0x0B91 } + + @inlinable static var STENCIL_FUNC: GLenum { 0x0B92 } + + @inlinable static var STENCIL_FAIL: GLenum { 0x0B94 } + + @inlinable static var STENCIL_PASS_DEPTH_FAIL: GLenum { 0x0B95 } + + @inlinable static var STENCIL_PASS_DEPTH_PASS: GLenum { 0x0B96 } + + @inlinable static var STENCIL_REF: GLenum { 0x0B97 } + + @inlinable static var STENCIL_VALUE_MASK: GLenum { 0x0B93 } + + @inlinable static var STENCIL_WRITEMASK: GLenum { 0x0B98 } + + @inlinable static var STENCIL_BACK_FUNC: GLenum { 0x8800 } + + @inlinable static var STENCIL_BACK_FAIL: GLenum { 0x8801 } + + @inlinable static var STENCIL_BACK_PASS_DEPTH_FAIL: GLenum { 0x8802 } + + @inlinable static var STENCIL_BACK_PASS_DEPTH_PASS: GLenum { 0x8803 } + + @inlinable static var STENCIL_BACK_REF: GLenum { 0x8CA3 } + + @inlinable static var STENCIL_BACK_VALUE_MASK: GLenum { 0x8CA4 } + + @inlinable static var STENCIL_BACK_WRITEMASK: GLenum { 0x8CA5 } + + @inlinable static var VIEWPORT: GLenum { 0x0BA2 } + + @inlinable static var SCISSOR_BOX: GLenum { 0x0C10 } + + @inlinable static var COLOR_CLEAR_VALUE: GLenum { 0x0C22 } + + @inlinable static var COLOR_WRITEMASK: GLenum { 0x0C23 } + + @inlinable static var UNPACK_ALIGNMENT: GLenum { 0x0CF5 } + + @inlinable static var PACK_ALIGNMENT: GLenum { 0x0D05 } + + @inlinable static var MAX_TEXTURE_SIZE: GLenum { 0x0D33 } + + @inlinable static var MAX_VIEWPORT_DIMS: GLenum { 0x0D3A } + + @inlinable static var SUBPIXEL_BITS: GLenum { 0x0D50 } + + @inlinable static var RED_BITS: GLenum { 0x0D52 } + + @inlinable static var GREEN_BITS: GLenum { 0x0D53 } + + @inlinable static var BLUE_BITS: GLenum { 0x0D54 } + + @inlinable static var ALPHA_BITS: GLenum { 0x0D55 } + + @inlinable static var DEPTH_BITS: GLenum { 0x0D56 } + + @inlinable static var STENCIL_BITS: GLenum { 0x0D57 } + + @inlinable static var POLYGON_OFFSET_UNITS: GLenum { 0x2A00 } + + @inlinable static var POLYGON_OFFSET_FACTOR: GLenum { 0x8038 } + + @inlinable static var TEXTURE_BINDING_2D: GLenum { 0x8069 } + + @inlinable static var SAMPLE_BUFFERS: GLenum { 0x80A8 } + + @inlinable static var SAMPLES: GLenum { 0x80A9 } + + @inlinable static var SAMPLE_COVERAGE_VALUE: GLenum { 0x80AA } + + @inlinable static var SAMPLE_COVERAGE_INVERT: GLenum { 0x80AB } + + @inlinable static var COMPRESSED_TEXTURE_FORMATS: GLenum { 0x86A3 } + + @inlinable static var DONT_CARE: GLenum { 0x1100 } + + @inlinable static var FASTEST: GLenum { 0x1101 } + + @inlinable static var NICEST: GLenum { 0x1102 } + + @inlinable static var GENERATE_MIPMAP_HINT: GLenum { 0x8192 } + + @inlinable static var BYTE: GLenum { 0x1400 } + + @inlinable static var UNSIGNED_BYTE: GLenum { 0x1401 } + + @inlinable static var SHORT: GLenum { 0x1402 } + + @inlinable static var UNSIGNED_SHORT: GLenum { 0x1403 } + + @inlinable static var INT: GLenum { 0x1404 } + + @inlinable static var UNSIGNED_INT: GLenum { 0x1405 } + + @inlinable static var FLOAT: GLenum { 0x1406 } + + @inlinable static var DEPTH_COMPONENT: GLenum { 0x1902 } + + @inlinable static var ALPHA: GLenum { 0x1906 } + + @inlinable static var RGB: GLenum { 0x1907 } + + @inlinable static var RGBA: GLenum { 0x1908 } + + @inlinable static var LUMINANCE: GLenum { 0x1909 } + + @inlinable static var LUMINANCE_ALPHA: GLenum { 0x190A } + + @inlinable static var UNSIGNED_SHORT_4_4_4_4: GLenum { 0x8033 } + + @inlinable static var UNSIGNED_SHORT_5_5_5_1: GLenum { 0x8034 } + + @inlinable static var UNSIGNED_SHORT_5_6_5: GLenum { 0x8363 } + + @inlinable static var FRAGMENT_SHADER: GLenum { 0x8B30 } + + @inlinable static var VERTEX_SHADER: GLenum { 0x8B31 } + + @inlinable static var MAX_VERTEX_ATTRIBS: GLenum { 0x8869 } + + @inlinable static var MAX_VERTEX_UNIFORM_VECTORS: GLenum { 0x8DFB } + + @inlinable static var MAX_VARYING_VECTORS: GLenum { 0x8DFC } + + @inlinable static var MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4D } + + @inlinable static var MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4C } + + @inlinable static var MAX_TEXTURE_IMAGE_UNITS: GLenum { 0x8872 } + + @inlinable static var MAX_FRAGMENT_UNIFORM_VECTORS: GLenum { 0x8DFD } + + @inlinable static var SHADER_TYPE: GLenum { 0x8B4F } + + @inlinable static var DELETE_STATUS: GLenum { 0x8B80 } + + @inlinable static var LINK_STATUS: GLenum { 0x8B82 } + + @inlinable static var VALIDATE_STATUS: GLenum { 0x8B83 } + + @inlinable static var ATTACHED_SHADERS: GLenum { 0x8B85 } + + @inlinable static var ACTIVE_UNIFORMS: GLenum { 0x8B86 } + + @inlinable static var ACTIVE_ATTRIBUTES: GLenum { 0x8B89 } + + @inlinable static var SHADING_LANGUAGE_VERSION: GLenum { 0x8B8C } + + @inlinable static var CURRENT_PROGRAM: GLenum { 0x8B8D } + + @inlinable static var NEVER: GLenum { 0x0200 } + + @inlinable static var LESS: GLenum { 0x0201 } + + @inlinable static var EQUAL: GLenum { 0x0202 } + + @inlinable static var LEQUAL: GLenum { 0x0203 } + + @inlinable static var GREATER: GLenum { 0x0204 } + + @inlinable static var NOTEQUAL: GLenum { 0x0205 } + + @inlinable static var GEQUAL: GLenum { 0x0206 } + + @inlinable static var ALWAYS: GLenum { 0x0207 } + + @inlinable static var KEEP: GLenum { 0x1E00 } + + @inlinable static var REPLACE: GLenum { 0x1E01 } + + @inlinable static var INCR: GLenum { 0x1E02 } + + @inlinable static var DECR: GLenum { 0x1E03 } + + @inlinable static var INVERT: GLenum { 0x150A } + + @inlinable static var INCR_WRAP: GLenum { 0x8507 } + + @inlinable static var DECR_WRAP: GLenum { 0x8508 } + + @inlinable static var VENDOR: GLenum { 0x1F00 } + + @inlinable static var RENDERER: GLenum { 0x1F01 } + + @inlinable static var VERSION: GLenum { 0x1F02 } + + @inlinable static var NEAREST: GLenum { 0x2600 } + + @inlinable static var LINEAR: GLenum { 0x2601 } + + @inlinable static var NEAREST_MIPMAP_NEAREST: GLenum { 0x2700 } + + @inlinable static var LINEAR_MIPMAP_NEAREST: GLenum { 0x2701 } + + @inlinable static var NEAREST_MIPMAP_LINEAR: GLenum { 0x2702 } + + @inlinable static var LINEAR_MIPMAP_LINEAR: GLenum { 0x2703 } + + @inlinable static var TEXTURE_MAG_FILTER: GLenum { 0x2800 } + + @inlinable static var TEXTURE_MIN_FILTER: GLenum { 0x2801 } + + @inlinable static var TEXTURE_WRAP_S: GLenum { 0x2802 } + + @inlinable static var TEXTURE_WRAP_T: GLenum { 0x2803 } + + @inlinable static var TEXTURE_2D: GLenum { 0x0DE1 } + + @inlinable static var TEXTURE: GLenum { 0x1702 } + + @inlinable static var TEXTURE_CUBE_MAP: GLenum { 0x8513 } + + @inlinable static var TEXTURE_BINDING_CUBE_MAP: GLenum { 0x8514 } + + @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_X: GLenum { 0x8515 } + + @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum { 0x8516 } + + @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum { 0x8517 } + + @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum { 0x8518 } + + @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum { 0x8519 } + + @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum { 0x851A } + + @inlinable static var MAX_CUBE_MAP_TEXTURE_SIZE: GLenum { 0x851C } + + @inlinable static var TEXTURE0: GLenum { 0x84C0 } + + @inlinable static var TEXTURE1: GLenum { 0x84C1 } + + @inlinable static var TEXTURE2: GLenum { 0x84C2 } + + @inlinable static var TEXTURE3: GLenum { 0x84C3 } + + @inlinable static var TEXTURE4: GLenum { 0x84C4 } + + @inlinable static var TEXTURE5: GLenum { 0x84C5 } + + @inlinable static var TEXTURE6: GLenum { 0x84C6 } + + @inlinable static var TEXTURE7: GLenum { 0x84C7 } + + @inlinable static var TEXTURE8: GLenum { 0x84C8 } + + @inlinable static var TEXTURE9: GLenum { 0x84C9 } + + @inlinable static var TEXTURE10: GLenum { 0x84CA } + + @inlinable static var TEXTURE11: GLenum { 0x84CB } + + @inlinable static var TEXTURE12: GLenum { 0x84CC } + + @inlinable static var TEXTURE13: GLenum { 0x84CD } + + @inlinable static var TEXTURE14: GLenum { 0x84CE } + + @inlinable static var TEXTURE15: GLenum { 0x84CF } + + @inlinable static var TEXTURE16: GLenum { 0x84D0 } + + @inlinable static var TEXTURE17: GLenum { 0x84D1 } + + @inlinable static var TEXTURE18: GLenum { 0x84D2 } + + @inlinable static var TEXTURE19: GLenum { 0x84D3 } + + @inlinable static var TEXTURE20: GLenum { 0x84D4 } + + @inlinable static var TEXTURE21: GLenum { 0x84D5 } + + @inlinable static var TEXTURE22: GLenum { 0x84D6 } + + @inlinable static var TEXTURE23: GLenum { 0x84D7 } + + @inlinable static var TEXTURE24: GLenum { 0x84D8 } + + @inlinable static var TEXTURE25: GLenum { 0x84D9 } + + @inlinable static var TEXTURE26: GLenum { 0x84DA } + + @inlinable static var TEXTURE27: GLenum { 0x84DB } + + @inlinable static var TEXTURE28: GLenum { 0x84DC } + + @inlinable static var TEXTURE29: GLenum { 0x84DD } + + @inlinable static var TEXTURE30: GLenum { 0x84DE } + + @inlinable static var TEXTURE31: GLenum { 0x84DF } + + @inlinable static var ACTIVE_TEXTURE: GLenum { 0x84E0 } + + @inlinable static var REPEAT: GLenum { 0x2901 } + + @inlinable static var CLAMP_TO_EDGE: GLenum { 0x812F } + + @inlinable static var MIRRORED_REPEAT: GLenum { 0x8370 } + + @inlinable static var FLOAT_VEC2: GLenum { 0x8B50 } + + @inlinable static var FLOAT_VEC3: GLenum { 0x8B51 } + + @inlinable static var FLOAT_VEC4: GLenum { 0x8B52 } + + @inlinable static var INT_VEC2: GLenum { 0x8B53 } + + @inlinable static var INT_VEC3: GLenum { 0x8B54 } + + @inlinable static var INT_VEC4: GLenum { 0x8B55 } + + @inlinable static var BOOL: GLenum { 0x8B56 } + + @inlinable static var BOOL_VEC2: GLenum { 0x8B57 } + + @inlinable static var BOOL_VEC3: GLenum { 0x8B58 } + + @inlinable static var BOOL_VEC4: GLenum { 0x8B59 } + + @inlinable static var FLOAT_MAT2: GLenum { 0x8B5A } + + @inlinable static var FLOAT_MAT3: GLenum { 0x8B5B } + + @inlinable static var FLOAT_MAT4: GLenum { 0x8B5C } + + @inlinable static var SAMPLER_2D: GLenum { 0x8B5E } + + @inlinable static var SAMPLER_CUBE: GLenum { 0x8B60 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_ENABLED: GLenum { 0x8622 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_SIZE: GLenum { 0x8623 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_STRIDE: GLenum { 0x8624 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_TYPE: GLenum { 0x8625 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum { 0x886A } + + @inlinable static var VERTEX_ATTRIB_ARRAY_POINTER: GLenum { 0x8645 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum { 0x889F } + + @inlinable static var IMPLEMENTATION_COLOR_READ_TYPE: GLenum { 0x8B9A } + + @inlinable static var IMPLEMENTATION_COLOR_READ_FORMAT: GLenum { 0x8B9B } + + @inlinable static var COMPILE_STATUS: GLenum { 0x8B81 } + + @inlinable static var LOW_FLOAT: GLenum { 0x8DF0 } + + @inlinable static var MEDIUM_FLOAT: GLenum { 0x8DF1 } + + @inlinable static var HIGH_FLOAT: GLenum { 0x8DF2 } + + @inlinable static var LOW_INT: GLenum { 0x8DF3 } + + @inlinable static var MEDIUM_INT: GLenum { 0x8DF4 } + + @inlinable static var HIGH_INT: GLenum { 0x8DF5 } + + @inlinable static var FRAMEBUFFER: GLenum { 0x8D40 } + + @inlinable static var RENDERBUFFER: GLenum { 0x8D41 } + + @inlinable static var RGBA4: GLenum { 0x8056 } + + @inlinable static var RGB5_A1: GLenum { 0x8057 } + + @inlinable static var RGB565: GLenum { 0x8D62 } + + @inlinable static var DEPTH_COMPONENT16: GLenum { 0x81A5 } + + @inlinable static var STENCIL_INDEX8: GLenum { 0x8D48 } + + @inlinable static var DEPTH_STENCIL: GLenum { 0x84F9 } + + @inlinable static var RENDERBUFFER_WIDTH: GLenum { 0x8D42 } + + @inlinable static var RENDERBUFFER_HEIGHT: GLenum { 0x8D43 } + + @inlinable static var RENDERBUFFER_INTERNAL_FORMAT: GLenum { 0x8D44 } + + @inlinable static var RENDERBUFFER_RED_SIZE: GLenum { 0x8D50 } + + @inlinable static var RENDERBUFFER_GREEN_SIZE: GLenum { 0x8D51 } + + @inlinable static var RENDERBUFFER_BLUE_SIZE: GLenum { 0x8D52 } + + @inlinable static var RENDERBUFFER_ALPHA_SIZE: GLenum { 0x8D53 } + + @inlinable static var RENDERBUFFER_DEPTH_SIZE: GLenum { 0x8D54 } + + @inlinable static var RENDERBUFFER_STENCIL_SIZE: GLenum { 0x8D55 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum { 0x8CD0 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum { 0x8CD1 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum { 0x8CD2 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum { 0x8CD3 } + + @inlinable static var COLOR_ATTACHMENT0: GLenum { 0x8CE0 } + + @inlinable static var DEPTH_ATTACHMENT: GLenum { 0x8D00 } + + @inlinable static var STENCIL_ATTACHMENT: GLenum { 0x8D20 } + + @inlinable static var DEPTH_STENCIL_ATTACHMENT: GLenum { 0x821A } + + @inlinable static var NONE: GLenum { 0 } + + @inlinable static var FRAMEBUFFER_COMPLETE: GLenum { 0x8CD5 } + + @inlinable static var FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum { 0x8CD6 } + + @inlinable static var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum { 0x8CD7 } + + @inlinable static var FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum { 0x8CD9 } + + @inlinable static var FRAMEBUFFER_UNSUPPORTED: GLenum { 0x8CDD } + + @inlinable static var FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } + + @inlinable static var RENDERBUFFER_BINDING: GLenum { 0x8CA7 } + + @inlinable static var MAX_RENDERBUFFER_SIZE: GLenum { 0x84E8 } + + @inlinable static var INVALID_FRAMEBUFFER_OPERATION: GLenum { 0x0506 } + + @inlinable static var UNPACK_FLIP_Y_WEBGL: GLenum { 0x9240 } + + @inlinable static var UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum { 0x9241 } + + @inlinable static var CONTEXT_LOST_WEBGL: GLenum { 0x9242 } + + @inlinable static var UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum { 0x9243 } + + @inlinable static var BROWSER_DEFAULT_WEBGL: GLenum { 0x9244 } + + @inlinable var canvas: HTMLCanvasElement_or_OffscreenCanvas { ReadonlyAttribute[Strings.canvas, in: jsObject] } + + @inlinable var drawingBufferWidth: GLsizei { ReadonlyAttribute[Strings.drawingBufferWidth, in: jsObject] } + + @inlinable var drawingBufferHeight: GLsizei { ReadonlyAttribute[Strings.drawingBufferHeight, in: jsObject] } + + @inlinable func getContextAttributes() -> WebGLContextAttributes? { + let this = jsObject + return this[Strings.getContextAttributes].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func isContextLost() -> Bool { + let this = jsObject + return this[Strings.isContextLost].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func getSupportedExtensions() -> [String]? { + let this = jsObject + return this[Strings.getSupportedExtensions].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func getExtension(name: String) -> JSObject? { + let this = jsObject + return this[Strings.getExtension].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + } + + @inlinable func activeTexture(texture: GLenum) { + let this = jsObject + _ = this[Strings.activeTexture].function!(this: this, arguments: [texture.jsValue]) + } + + @inlinable func attachShader(program: WebGLProgram, shader: WebGLShader) { + let this = jsObject + _ = this[Strings.attachShader].function!(this: this, arguments: [program.jsValue, shader.jsValue]) + } + + @inlinable func bindAttribLocation(program: WebGLProgram, index: GLuint, name: String) { + let this = jsObject + _ = this[Strings.bindAttribLocation].function!(this: this, arguments: [program.jsValue, index.jsValue, name.jsValue]) + } + + @inlinable func bindBuffer(target: GLenum, buffer: WebGLBuffer?) { + let this = jsObject + _ = this[Strings.bindBuffer].function!(this: this, arguments: [target.jsValue, buffer.jsValue]) + } + + @inlinable func bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer?) { + let this = jsObject + _ = this[Strings.bindFramebuffer].function!(this: this, arguments: [target.jsValue, framebuffer.jsValue]) + } + + @inlinable func bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer?) { + let this = jsObject + _ = this[Strings.bindRenderbuffer].function!(this: this, arguments: [target.jsValue, renderbuffer.jsValue]) + } + + @inlinable func bindTexture(target: GLenum, texture: WebGLTexture?) { + let this = jsObject + _ = this[Strings.bindTexture].function!(this: this, arguments: [target.jsValue, texture.jsValue]) + } + + @inlinable func blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { + let this = jsObject + _ = this[Strings.blendColor].function!(this: this, arguments: [red.jsValue, green.jsValue, blue.jsValue, alpha.jsValue]) + } + + @inlinable func blendEquation(mode: GLenum) { + let this = jsObject + _ = this[Strings.blendEquation].function!(this: this, arguments: [mode.jsValue]) + } + + @inlinable func blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum) { + let this = jsObject + _ = this[Strings.blendEquationSeparate].function!(this: this, arguments: [modeRGB.jsValue, modeAlpha.jsValue]) + } + + @inlinable func blendFunc(sfactor: GLenum, dfactor: GLenum) { + let this = jsObject + _ = this[Strings.blendFunc].function!(this: this, arguments: [sfactor.jsValue, dfactor.jsValue]) + } + + @inlinable func blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { + let this = jsObject + _ = this[Strings.blendFuncSeparate].function!(this: this, arguments: [srcRGB.jsValue, dstRGB.jsValue, srcAlpha.jsValue, dstAlpha.jsValue]) + } + + @inlinable func checkFramebufferStatus(target: GLenum) -> GLenum { + let this = jsObject + return this[Strings.checkFramebufferStatus].function!(this: this, arguments: [target.jsValue]).fromJSValue()! + } + + @inlinable func clear(mask: GLbitfield) { + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: [mask.jsValue]) + } + + @inlinable func clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { + let this = jsObject + _ = this[Strings.clearColor].function!(this: this, arguments: [red.jsValue, green.jsValue, blue.jsValue, alpha.jsValue]) + } + + @inlinable func clearDepth(depth: GLclampf) { + let this = jsObject + _ = this[Strings.clearDepth].function!(this: this, arguments: [depth.jsValue]) + } + + @inlinable func clearStencil(s: GLint) { + let this = jsObject + _ = this[Strings.clearStencil].function!(this: this, arguments: [s.jsValue]) + } + + @inlinable func colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) { + let this = jsObject + _ = this[Strings.colorMask].function!(this: this, arguments: [red.jsValue, green.jsValue, blue.jsValue, alpha.jsValue]) + } + + @inlinable func compileShader(shader: WebGLShader) { + let this = jsObject + _ = this[Strings.compileShader].function!(this: this, arguments: [shader.jsValue]) + } + + @inlinable func copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = x.jsValue + let _arg4 = y.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = border.jsValue + let this = jsObject + _ = this[Strings.copyTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) + } + + @inlinable func copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = x.jsValue + let _arg5 = y.jsValue + let _arg6 = width.jsValue + let _arg7 = height.jsValue + let this = jsObject + _ = this[Strings.copyTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) + } + + @inlinable func createBuffer() -> WebGLBuffer? { + let this = jsObject + return this[Strings.createBuffer].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func createFramebuffer() -> WebGLFramebuffer? { + let this = jsObject + return this[Strings.createFramebuffer].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func createProgram() -> WebGLProgram? { + let this = jsObject + return this[Strings.createProgram].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func createRenderbuffer() -> WebGLRenderbuffer? { + let this = jsObject + return this[Strings.createRenderbuffer].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func createShader(type: GLenum) -> WebGLShader? { + let this = jsObject + return this[Strings.createShader].function!(this: this, arguments: [type.jsValue]).fromJSValue()! + } + + @inlinable func createTexture() -> WebGLTexture? { + let this = jsObject + return this[Strings.createTexture].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func cullFace(mode: GLenum) { + let this = jsObject + _ = this[Strings.cullFace].function!(this: this, arguments: [mode.jsValue]) + } + + @inlinable func deleteBuffer(buffer: WebGLBuffer?) { + let this = jsObject + _ = this[Strings.deleteBuffer].function!(this: this, arguments: [buffer.jsValue]) + } + + @inlinable func deleteFramebuffer(framebuffer: WebGLFramebuffer?) { + let this = jsObject + _ = this[Strings.deleteFramebuffer].function!(this: this, arguments: [framebuffer.jsValue]) + } + + @inlinable func deleteProgram(program: WebGLProgram?) { + let this = jsObject + _ = this[Strings.deleteProgram].function!(this: this, arguments: [program.jsValue]) + } + + @inlinable func deleteRenderbuffer(renderbuffer: WebGLRenderbuffer?) { + let this = jsObject + _ = this[Strings.deleteRenderbuffer].function!(this: this, arguments: [renderbuffer.jsValue]) + } + + @inlinable func deleteShader(shader: WebGLShader?) { + let this = jsObject + _ = this[Strings.deleteShader].function!(this: this, arguments: [shader.jsValue]) + } + + @inlinable func deleteTexture(texture: WebGLTexture?) { + let this = jsObject + _ = this[Strings.deleteTexture].function!(this: this, arguments: [texture.jsValue]) + } + + @inlinable func depthFunc(func: GLenum) { + let this = jsObject + _ = this[Strings.depthFunc].function!(this: this, arguments: [`func`.jsValue]) + } + + @inlinable func depthMask(flag: GLboolean) { + let this = jsObject + _ = this[Strings.depthMask].function!(this: this, arguments: [flag.jsValue]) + } + + @inlinable func depthRange(zNear: GLclampf, zFar: GLclampf) { + let this = jsObject + _ = this[Strings.depthRange].function!(this: this, arguments: [zNear.jsValue, zFar.jsValue]) + } + + @inlinable func detachShader(program: WebGLProgram, shader: WebGLShader) { + let this = jsObject + _ = this[Strings.detachShader].function!(this: this, arguments: [program.jsValue, shader.jsValue]) + } + + @inlinable func disable(cap: GLenum) { + let this = jsObject + _ = this[Strings.disable].function!(this: this, arguments: [cap.jsValue]) + } + + @inlinable func disableVertexAttribArray(index: GLuint) { + let this = jsObject + _ = this[Strings.disableVertexAttribArray].function!(this: this, arguments: [index.jsValue]) + } + + @inlinable func drawArrays(mode: GLenum, first: GLint, count: GLsizei) { + let this = jsObject + _ = this[Strings.drawArrays].function!(this: this, arguments: [mode.jsValue, first.jsValue, count.jsValue]) + } + + @inlinable func drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr) { + let this = jsObject + _ = this[Strings.drawElements].function!(this: this, arguments: [mode.jsValue, count.jsValue, type.jsValue, offset.jsValue]) + } + + @inlinable func enable(cap: GLenum) { + let this = jsObject + _ = this[Strings.enable].function!(this: this, arguments: [cap.jsValue]) + } + + @inlinable func enableVertexAttribArray(index: GLuint) { + let this = jsObject + _ = this[Strings.enableVertexAttribArray].function!(this: this, arguments: [index.jsValue]) + } + + @inlinable func finish() { + let this = jsObject + _ = this[Strings.finish].function!(this: this, arguments: []) + } + + @inlinable func flush() { + let this = jsObject + _ = this[Strings.flush].function!(this: this, arguments: []) + } + + @inlinable func framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer?) { + let this = jsObject + _ = this[Strings.framebufferRenderbuffer].function!(this: this, arguments: [target.jsValue, attachment.jsValue, renderbuffertarget.jsValue, renderbuffer.jsValue]) + } + + @inlinable func framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture?, level: GLint) { + let this = jsObject + _ = this[Strings.framebufferTexture2D].function!(this: this, arguments: [target.jsValue, attachment.jsValue, textarget.jsValue, texture.jsValue, level.jsValue]) + } + + @inlinable func frontFace(mode: GLenum) { + let this = jsObject + _ = this[Strings.frontFace].function!(this: this, arguments: [mode.jsValue]) + } + + @inlinable func generateMipmap(target: GLenum) { + let this = jsObject + _ = this[Strings.generateMipmap].function!(this: this, arguments: [target.jsValue]) + } + + @inlinable func getActiveAttrib(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + let this = jsObject + return this[Strings.getActiveAttrib].function!(this: this, arguments: [program.jsValue, index.jsValue]).fromJSValue()! + } + + @inlinable func getActiveUniform(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + let this = jsObject + return this[Strings.getActiveUniform].function!(this: this, arguments: [program.jsValue, index.jsValue]).fromJSValue()! + } + + @inlinable func getAttachedShaders(program: WebGLProgram) -> [WebGLShader]? { + let this = jsObject + return this[Strings.getAttachedShaders].function!(this: this, arguments: [program.jsValue]).fromJSValue()! + } + + @inlinable func getAttribLocation(program: WebGLProgram, name: String) -> GLint { + let this = jsObject + return this[Strings.getAttribLocation].function!(this: this, arguments: [program.jsValue, name.jsValue]).fromJSValue()! + } + + @inlinable func getBufferParameter(target: GLenum, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getBufferParameter].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getParameter(pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getParameter].function!(this: this, arguments: [pname.jsValue]).fromJSValue()! + } + + @inlinable func getError() -> GLenum { + let this = jsObject + return this[Strings.getError].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getFramebufferAttachmentParameter].function!(this: this, arguments: [target.jsValue, attachment.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getProgramParameter(program: WebGLProgram, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getProgramParameter].function!(this: this, arguments: [program.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getProgramInfoLog(program: WebGLProgram) -> String? { + let this = jsObject + return this[Strings.getProgramInfoLog].function!(this: this, arguments: [program.jsValue]).fromJSValue()! + } + + @inlinable func getRenderbufferParameter(target: GLenum, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getRenderbufferParameter].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getShaderParameter(shader: WebGLShader, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getShaderParameter].function!(this: this, arguments: [shader.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum) -> WebGLShaderPrecisionFormat? { + let this = jsObject + return this[Strings.getShaderPrecisionFormat].function!(this: this, arguments: [shadertype.jsValue, precisiontype.jsValue]).fromJSValue()! + } + + @inlinable func getShaderInfoLog(shader: WebGLShader) -> String? { + let this = jsObject + return this[Strings.getShaderInfoLog].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! + } + + @inlinable func getShaderSource(shader: WebGLShader) -> String? { + let this = jsObject + return this[Strings.getShaderSource].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! + } + + @inlinable func getTexParameter(target: GLenum, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getTexParameter].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getUniform(program: WebGLProgram, location: WebGLUniformLocation) -> JSValue { + let this = jsObject + return this[Strings.getUniform].function!(this: this, arguments: [program.jsValue, location.jsValue]).fromJSValue()! + } + + @inlinable func getUniformLocation(program: WebGLProgram, name: String) -> WebGLUniformLocation? { + let this = jsObject + return this[Strings.getUniformLocation].function!(this: this, arguments: [program.jsValue, name.jsValue]).fromJSValue()! + } + + @inlinable func getVertexAttrib(index: GLuint, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getVertexAttrib].function!(this: this, arguments: [index.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getVertexAttribOffset(index: GLuint, pname: GLenum) -> GLintptr { + let this = jsObject + return this[Strings.getVertexAttribOffset].function!(this: this, arguments: [index.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func hint(target: GLenum, mode: GLenum) { + let this = jsObject + _ = this[Strings.hint].function!(this: this, arguments: [target.jsValue, mode.jsValue]) + } + + @inlinable func isBuffer(buffer: WebGLBuffer?) -> GLboolean { + let this = jsObject + return this[Strings.isBuffer].function!(this: this, arguments: [buffer.jsValue]).fromJSValue()! + } + + @inlinable func isEnabled(cap: GLenum) -> GLboolean { + let this = jsObject + return this[Strings.isEnabled].function!(this: this, arguments: [cap.jsValue]).fromJSValue()! + } + + @inlinable func isFramebuffer(framebuffer: WebGLFramebuffer?) -> GLboolean { + let this = jsObject + return this[Strings.isFramebuffer].function!(this: this, arguments: [framebuffer.jsValue]).fromJSValue()! + } + + @inlinable func isProgram(program: WebGLProgram?) -> GLboolean { + let this = jsObject + return this[Strings.isProgram].function!(this: this, arguments: [program.jsValue]).fromJSValue()! + } + + @inlinable func isRenderbuffer(renderbuffer: WebGLRenderbuffer?) -> GLboolean { + let this = jsObject + return this[Strings.isRenderbuffer].function!(this: this, arguments: [renderbuffer.jsValue]).fromJSValue()! + } + + @inlinable func isShader(shader: WebGLShader?) -> GLboolean { + let this = jsObject + return this[Strings.isShader].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! + } + + @inlinable func isTexture(texture: WebGLTexture?) -> GLboolean { + let this = jsObject + return this[Strings.isTexture].function!(this: this, arguments: [texture.jsValue]).fromJSValue()! + } + + @inlinable func lineWidth(width: GLfloat) { + let this = jsObject + _ = this[Strings.lineWidth].function!(this: this, arguments: [width.jsValue]) + } + + @inlinable func linkProgram(program: WebGLProgram) { + let this = jsObject + _ = this[Strings.linkProgram].function!(this: this, arguments: [program.jsValue]) + } + + @inlinable func pixelStorei(pname: GLenum, param: GLint) { + let this = jsObject + _ = this[Strings.pixelStorei].function!(this: this, arguments: [pname.jsValue, param.jsValue]) + } + + @inlinable func polygonOffset(factor: GLfloat, units: GLfloat) { + let this = jsObject + _ = this[Strings.polygonOffset].function!(this: this, arguments: [factor.jsValue, units.jsValue]) + } + + @inlinable func renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) { + let this = jsObject + _ = this[Strings.renderbufferStorage].function!(this: this, arguments: [target.jsValue, internalformat.jsValue, width.jsValue, height.jsValue]) + } + + @inlinable func sampleCoverage(value: GLclampf, invert: GLboolean) { + let this = jsObject + _ = this[Strings.sampleCoverage].function!(this: this, arguments: [value.jsValue, invert.jsValue]) + } + + @inlinable func scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + let this = jsObject + _ = this[Strings.scissor].function!(this: this, arguments: [x.jsValue, y.jsValue, width.jsValue, height.jsValue]) + } + + @inlinable func shaderSource(shader: WebGLShader, source: String) { + let this = jsObject + _ = this[Strings.shaderSource].function!(this: this, arguments: [shader.jsValue, source.jsValue]) + } + + @inlinable func stencilFunc(func: GLenum, ref: GLint, mask: GLuint) { + let this = jsObject + _ = this[Strings.stencilFunc].function!(this: this, arguments: [`func`.jsValue, ref.jsValue, mask.jsValue]) + } + + @inlinable func stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint) { + let this = jsObject + _ = this[Strings.stencilFuncSeparate].function!(this: this, arguments: [face.jsValue, `func`.jsValue, ref.jsValue, mask.jsValue]) + } + + @inlinable func stencilMask(mask: GLuint) { + let this = jsObject + _ = this[Strings.stencilMask].function!(this: this, arguments: [mask.jsValue]) + } + + @inlinable func stencilMaskSeparate(face: GLenum, mask: GLuint) { + let this = jsObject + _ = this[Strings.stencilMaskSeparate].function!(this: this, arguments: [face.jsValue, mask.jsValue]) + } + + @inlinable func stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum) { + let this = jsObject + _ = this[Strings.stencilOp].function!(this: this, arguments: [fail.jsValue, zfail.jsValue, zpass.jsValue]) + } + + @inlinable func stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) { + let this = jsObject + _ = this[Strings.stencilOpSeparate].function!(this: this, arguments: [face.jsValue, fail.jsValue, zfail.jsValue, zpass.jsValue]) + } + + @inlinable func texParameterf(target: GLenum, pname: GLenum, param: GLfloat) { + let this = jsObject + _ = this[Strings.texParameterf].function!(this: this, arguments: [target.jsValue, pname.jsValue, param.jsValue]) + } + + @inlinable func texParameteri(target: GLenum, pname: GLenum, param: GLint) { + let this = jsObject + _ = this[Strings.texParameteri].function!(this: this, arguments: [target.jsValue, pname.jsValue, param.jsValue]) + } + + @inlinable func uniform1f(location: WebGLUniformLocation?, x: GLfloat) { + let this = jsObject + _ = this[Strings.uniform1f].function!(this: this, arguments: [location.jsValue, x.jsValue]) + } + + @inlinable func uniform2f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat) { + let this = jsObject + _ = this[Strings.uniform2f].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue]) + } + + @inlinable func uniform3f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat) { + let this = jsObject + _ = this[Strings.uniform3f].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue]) + } + + @inlinable func uniform4f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { + let this = jsObject + _ = this[Strings.uniform4f].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) + } + + @inlinable func uniform1i(location: WebGLUniformLocation?, x: GLint) { + let this = jsObject + _ = this[Strings.uniform1i].function!(this: this, arguments: [location.jsValue, x.jsValue]) + } + + @inlinable func uniform2i(location: WebGLUniformLocation?, x: GLint, y: GLint) { + let this = jsObject + _ = this[Strings.uniform2i].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue]) + } + + @inlinable func uniform3i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint) { + let this = jsObject + _ = this[Strings.uniform3i].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue]) + } + + @inlinable func uniform4i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint, w: GLint) { + let this = jsObject + _ = this[Strings.uniform4i].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) + } + + @inlinable func useProgram(program: WebGLProgram?) { + let this = jsObject + _ = this[Strings.useProgram].function!(this: this, arguments: [program.jsValue]) + } + + @inlinable func validateProgram(program: WebGLProgram) { + let this = jsObject + _ = this[Strings.validateProgram].function!(this: this, arguments: [program.jsValue]) + } + + @inlinable func vertexAttrib1f(index: GLuint, x: GLfloat) { + let this = jsObject + _ = this[Strings.vertexAttrib1f].function!(this: this, arguments: [index.jsValue, x.jsValue]) + } + + @inlinable func vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat) { + let this = jsObject + _ = this[Strings.vertexAttrib2f].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue]) + } + + @inlinable func vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) { + let this = jsObject + _ = this[Strings.vertexAttrib3f].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue]) + } + + @inlinable func vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { + let this = jsObject + _ = this[Strings.vertexAttrib4f].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) + } + + @inlinable func vertexAttrib1fv(index: GLuint, values: Float32List) { + let this = jsObject + _ = this[Strings.vertexAttrib1fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) + } + + @inlinable func vertexAttrib2fv(index: GLuint, values: Float32List) { + let this = jsObject + _ = this[Strings.vertexAttrib2fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) + } + + @inlinable func vertexAttrib3fv(index: GLuint, values: Float32List) { + let this = jsObject + _ = this[Strings.vertexAttrib3fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) + } + + @inlinable func vertexAttrib4fv(index: GLuint, values: Float32List) { + let this = jsObject + _ = this[Strings.vertexAttrib4fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) + } + + @inlinable func vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) { + let _arg0 = index.jsValue + let _arg1 = size.jsValue + let _arg2 = type.jsValue + let _arg3 = normalized.jsValue + let _arg4 = stride.jsValue + let _arg5 = offset.jsValue + let this = jsObject + _ = this[Strings.vertexAttribPointer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } + + @inlinable func viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + let this = jsObject + _ = this[Strings.viewport].function!(this: this, arguments: [x.jsValue, y.jsValue, width.jsValue, height.jsValue]) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift new file mode 100644 index 00000000..fe1977ac --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift @@ -0,0 +1,165 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public protocol WebGLRenderingContextOverloads: JSBridgedClass {} +public extension WebGLRenderingContextOverloads { + @inlinable func bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) { + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, size.jsValue, usage.jsValue]) + } + + @inlinable func bufferData(target: GLenum, data: BufferSource?, usage: GLenum) { + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, data.jsValue, usage.jsValue]) + } + + @inlinable func bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource) { + let this = jsObject + _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue, offset.jsValue, data.jsValue]) + } + + @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = border.jsValue + let _arg6 = data.jsValue + let this = jsObject + _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) + } + + @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let _arg6 = format.jsValue + let _arg7 = data.jsValue + let this = jsObject + _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) + } + + @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + let _arg0 = x.jsValue + let _arg1 = y.jsValue + let _arg2 = width.jsValue + let _arg3 = height.jsValue + let _arg4 = format.jsValue + let _arg5 = type.jsValue + let _arg6 = pixels.jsValue + let this = jsObject + _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) + } + + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = border.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = pixels.jsValue + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } + + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = format.jsValue + let _arg4 = type.jsValue + let _arg5 = source.jsValue + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } + + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = pixels.jsValue + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } + + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = format.jsValue + let _arg5 = type.jsValue + let _arg6 = source.jsValue + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) + } + + @inlinable func uniform1fv(location: WebGLUniformLocation?, v: Float32List) { + let this = jsObject + _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } + + @inlinable func uniform2fv(location: WebGLUniformLocation?, v: Float32List) { + let this = jsObject + _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } + + @inlinable func uniform3fv(location: WebGLUniformLocation?, v: Float32List) { + let this = jsObject + _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } + + @inlinable func uniform4fv(location: WebGLUniformLocation?, v: Float32List) { + let this = jsObject + _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } + + @inlinable func uniform1iv(location: WebGLUniformLocation?, v: Int32List) { + let this = jsObject + _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } + + @inlinable func uniform2iv(location: WebGLUniformLocation?, v: Int32List) { + let this = jsObject + _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } + + @inlinable func uniform3iv(location: WebGLUniformLocation?, v: Int32List) { + let this = jsObject + _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } + + @inlinable func uniform4iv(location: WebGLUniformLocation?, v: Int32List) { + let this = jsObject + _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } + + @inlinable func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + let this = jsObject + _ = this[Strings.uniformMatrix2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, value.jsValue]) + } + + @inlinable func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + let this = jsObject + _ = this[Strings.uniformMatrix3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, value.jsValue]) + } + + @inlinable func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + let this = jsObject + _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, value.jsValue]) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLShader.swift b/Sources/DOMKit/WebIDL/WebGLShader.swift new file mode 100644 index 00000000..97f2b719 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLShader.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLShader: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLShader].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift b/Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift new file mode 100644 index 00000000..67725e58 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift @@ -0,0 +1,26 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLShaderPrecisionFormat: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLShaderPrecisionFormat].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _rangeMin = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeMin) + _rangeMax = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeMax) + _precision = ReadonlyAttribute(jsObject: jsObject, name: Strings.precision) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var rangeMin: GLint + + @ReadonlyAttribute + public var rangeMax: GLint + + @ReadonlyAttribute + public var precision: GLint +} diff --git a/Sources/DOMKit/WebIDL/WebGLTexture.swift b/Sources/DOMKit/WebIDL/WebGLTexture.swift new file mode 100644 index 00000000..ee7ad6c9 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLTexture.swift @@ -0,0 +1,12 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLTexture: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTexture].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} diff --git a/Sources/DOMKit/WebIDL/WebGLUniformLocation.swift b/Sources/DOMKit/WebIDL/WebGLUniformLocation.swift new file mode 100644 index 00000000..cf833a95 --- /dev/null +++ b/Sources/DOMKit/WebIDL/WebGLUniformLocation.swift @@ -0,0 +1,14 @@ +// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! + +import JavaScriptEventLoop +import JavaScriptKit + +public class WebGLUniformLocation: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLUniformLocation].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} diff --git a/parse-idl/parse-all.js b/parse-idl/parse-all.js index 3a3c1f5e..9df63f02 100644 --- a/parse-idl/parse-all.js +++ b/parse-idl/parse-all.js @@ -26,6 +26,7 @@ console.log( "mediacapture-streams", "mediastream-recording", "webcodecs", + "webgl1", ].map((key) => parsedFiles[key]), null, 2 From 3dac17c7a548fa2da9cf6bb5345bbc1592bf949b Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Tue, 3 May 2022 11:11:23 +0100 Subject: [PATCH 8/8] Fix merge conflict --- Sources/DOMKit/Generated.swift | 2176 ++++++++++++++++- Sources/DOMKit/WebIDL/Float32List.swift | 46 - Sources/DOMKit/WebIDL/Int32List.swift | 46 - Sources/DOMKit/WebIDL/TexImageSource.swift | 116 - Sources/DOMKit/WebIDL/WebGLActiveInfo.swift | 26 - Sources/DOMKit/WebIDL/WebGLBuffer.swift | 12 - .../WebIDL/WebGLContextAttributes.swift | 60 - Sources/DOMKit/WebIDL/WebGLContextEvent.swift | 20 - .../DOMKit/WebIDL/WebGLContextEventInit.swift | 20 - Sources/DOMKit/WebIDL/WebGLFramebuffer.swift | 12 - Sources/DOMKit/WebIDL/WebGLObject.swift | 14 - .../DOMKit/WebIDL/WebGLPowerPreference.swift | 23 - Sources/DOMKit/WebIDL/WebGLProgram.swift | 12 - Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift | 12 - .../DOMKit/WebIDL/WebGLRenderingContext.swift | 14 - .../WebIDL/WebGLRenderingContextBase.swift | 1217 --------- .../WebGLRenderingContextOverloads.swift | 165 -- Sources/DOMKit/WebIDL/WebGLShader.swift | 12 - .../WebIDL/WebGLShaderPrecisionFormat.swift | 26 - Sources/DOMKit/WebIDL/WebGLTexture.swift | 12 - .../DOMKit/WebIDL/WebGLUniformLocation.swift | 14 - 21 files changed, 2071 insertions(+), 1984 deletions(-) delete mode 100644 Sources/DOMKit/WebIDL/Float32List.swift delete mode 100644 Sources/DOMKit/WebIDL/Int32List.swift delete mode 100644 Sources/DOMKit/WebIDL/TexImageSource.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLActiveInfo.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLBuffer.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLContextAttributes.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLContextEvent.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLContextEventInit.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLFramebuffer.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLObject.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLPowerPreference.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLProgram.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLRenderingContext.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLShader.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLTexture.swift delete mode 100644 Sources/DOMKit/WebIDL/WebGLUniformLocation.swift diff --git a/Sources/DOMKit/Generated.swift b/Sources/DOMKit/Generated.swift index 88bb7667..a109f8c2 100644 --- a/Sources/DOMKit/Generated.swift +++ b/Sources/DOMKit/Generated.swift @@ -15257,6 +15257,21 @@ public typealias EpochTimeStamp = UInt64 public typealias DOMTimeStamp = UInt64 +public typealias GLenum = UInt32 +public typealias GLboolean = Bool +public typealias GLbitfield = UInt32 +public typealias GLbyte = Int8 +public typealias GLshort = Int16 +public typealias GLint = Int32 +public typealias GLsizei = Int32 +public typealias GLintptr = Int64 +public typealias GLsizeiptr = Int64 +public typealias GLubyte = UInt8 +public typealias GLushort = UInt16 +public typealias GLuint = UInt32 +public typealias GLfloat = Float +public typealias GLclampf = Float + public typealias MutationCallback = ([MutationRecord], MutationObserver) -> Void public typealias BlobCallback = (Blob?) -> Void public typealias FunctionStringCallback = (String) -> Void @@ -16353,153 +16368,1756 @@ public class VideoFrameInit: BridgedDictionary { public var displayHeight: UInt32 } -public enum VideoMatrixCoefficients: JSString, JSValueCompatible { - case rgb = "rgb" - case bt709 = "bt709" - case bt470bg = "bt470bg" - case smpte170m = "smpte170m" +public enum VideoMatrixCoefficients: JSString, JSValueCompatible { + case rgb = "rgb" + case bt709 = "bt709" + case bt470bg = "bt470bg" + case smpte170m = "smpte170m" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public enum VideoPixelFormat: JSString, JSValueCompatible { + case i420 = "I420" + case i420A = "I420A" + case i422 = "I422" + case i444 = "I444" + case nV12 = "NV12" + case rGBA = "RGBA" + case rGBX = "RGBX" + case bGRA = "BGRA" + case bGRX = "BGRX" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public enum VideoResizeModeEnum: JSString, JSValueCompatible { + case none = "none" + case cropAndScale = "crop-and-scale" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class VideoTrack: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoTrack].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) + _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) + _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) + _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) + _selected = ReadWriteAttribute(jsObject: jsObject, name: Strings.selected) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var id: String + + @ReadonlyAttribute + public var kind: String + + @ReadonlyAttribute + public var label: String + + @ReadonlyAttribute + public var language: String + + @ReadWriteAttribute + public var selected: Bool +} + +public class VideoTrackList: EventTarget { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.VideoTrackList].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) + _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedIndex) + _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) + _onaddtrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaddtrack) + _onremovetrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremovetrack) + super.init(unsafelyWrapping: jsObject) + } + + @ReadonlyAttribute + public var length: UInt32 + + @inlinable public subscript(key: Int) -> VideoTrack { + jsObject[key].fromJSValue()! + } + + @inlinable public func getTrackById(id: String) -> VideoTrack? { + let this = jsObject + return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue]).fromJSValue()! + } + + @ReadonlyAttribute + public var selectedIndex: Int32 + + @ClosureAttribute1Optional + public var onchange: EventHandler + + @ClosureAttribute1Optional + public var onaddtrack: EventHandler + + @ClosureAttribute1Optional + public var onremovetrack: EventHandler +} + +public enum VideoTransferCharacteristics: JSString, JSValueCompatible { + case bt709 = "bt709" + case smpte170m = "smpte170m" + case iec6196621 = "iec61966-2-1" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class WebGLActiveInfo: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLActiveInfo].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) + _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) + _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) + self.jsObject = jsObject + } + + @ReadonlyAttribute + public var size: GLint + + @ReadonlyAttribute + public var type: GLenum + + @ReadonlyAttribute + public var name: String +} + +public class WebGLBuffer: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLBuffer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + +public class WebGLContextAttributes: BridgedDictionary { + public convenience init(alpha: Bool, depth: Bool, stencil: Bool, antialias: Bool, premultipliedAlpha: Bool, preserveDrawingBuffer: Bool, powerPreference: WebGLPowerPreference, failIfMajorPerformanceCaveat: Bool, desynchronized: Bool) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.alpha] = alpha.jsValue + object[Strings.depth] = depth.jsValue + object[Strings.stencil] = stencil.jsValue + object[Strings.antialias] = antialias.jsValue + object[Strings.premultipliedAlpha] = premultipliedAlpha.jsValue + object[Strings.preserveDrawingBuffer] = preserveDrawingBuffer.jsValue + object[Strings.powerPreference] = powerPreference.jsValue + object[Strings.failIfMajorPerformanceCaveat] = failIfMajorPerformanceCaveat.jsValue + object[Strings.desynchronized] = desynchronized.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) + _depth = ReadWriteAttribute(jsObject: object, name: Strings.depth) + _stencil = ReadWriteAttribute(jsObject: object, name: Strings.stencil) + _antialias = ReadWriteAttribute(jsObject: object, name: Strings.antialias) + _premultipliedAlpha = ReadWriteAttribute(jsObject: object, name: Strings.premultipliedAlpha) + _preserveDrawingBuffer = ReadWriteAttribute(jsObject: object, name: Strings.preserveDrawingBuffer) + _powerPreference = ReadWriteAttribute(jsObject: object, name: Strings.powerPreference) + _failIfMajorPerformanceCaveat = ReadWriteAttribute(jsObject: object, name: Strings.failIfMajorPerformanceCaveat) + _desynchronized = ReadWriteAttribute(jsObject: object, name: Strings.desynchronized) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var alpha: Bool + + @ReadWriteAttribute + public var depth: Bool + + @ReadWriteAttribute + public var stencil: Bool + + @ReadWriteAttribute + public var antialias: Bool + + @ReadWriteAttribute + public var premultipliedAlpha: Bool + + @ReadWriteAttribute + public var preserveDrawingBuffer: Bool + + @ReadWriteAttribute + public var powerPreference: WebGLPowerPreference + + @ReadWriteAttribute + public var failIfMajorPerformanceCaveat: Bool + + @ReadWriteAttribute + public var desynchronized: Bool +} + +public class WebGLContextEvent: Event { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLContextEvent].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + _statusMessage = ReadonlyAttribute(jsObject: jsObject, name: Strings.statusMessage) + super.init(unsafelyWrapping: jsObject) + } + + @inlinable public convenience init(type: String, eventInit: WebGLContextEventInit? = nil) { + self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInit?.jsValue ?? .undefined])) + } + + @ReadonlyAttribute + public var statusMessage: String +} + +public class WebGLContextEventInit: BridgedDictionary { + public convenience init(statusMessage: String) { + let object = JSObject.global[Strings.Object].function!.new() + object[Strings.statusMessage] = statusMessage.jsValue + self.init(unsafelyWrapping: object) + } + + public required init(unsafelyWrapping object: JSObject) { + _statusMessage = ReadWriteAttribute(jsObject: object, name: Strings.statusMessage) + super.init(unsafelyWrapping: object) + } + + @ReadWriteAttribute + public var statusMessage: String +} + +public class WebGLFramebuffer: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLFramebuffer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + +public class WebGLObject: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLObject].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} + +public enum WebGLPowerPreference: JSString, JSValueCompatible { + case `default` = "default" + case lowPower = "low-power" + case highPerformance = "high-performance" + + @inlinable public static func construct(from jsValue: JSValue) -> Self? { + if let string = jsValue.jsString { + return Self(rawValue: string) + } + return nil + } + + @inlinable public init?(string: String) { + self.init(rawValue: JSString(string)) + } + + @inlinable public var jsValue: JSValue { rawValue.jsValue } +} + +public class WebGLProgram: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLProgram].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + +public class WebGLRenderbuffer: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLRenderbuffer].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + +public class WebGLRenderingContext: JSBridgedClass, WebGLRenderingContextBase, WebGLRenderingContextOverloads { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLRenderingContext].function! } + + public let jsObject: JSObject + + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject + } +} + +public protocol WebGLRenderingContextBase: JSBridgedClass {} +public extension WebGLRenderingContextBase { + @inlinable static var DEPTH_BUFFER_BIT: GLenum { 0x0000_0100 } + + @inlinable static var STENCIL_BUFFER_BIT: GLenum { 0x0000_0400 } + + @inlinable static var COLOR_BUFFER_BIT: GLenum { 0x0000_4000 } + + @inlinable static var POINTS: GLenum { 0x0000 } + + @inlinable static var LINES: GLenum { 0x0001 } + + @inlinable static var LINE_LOOP: GLenum { 0x0002 } + + @inlinable static var LINE_STRIP: GLenum { 0x0003 } + + @inlinable static var TRIANGLES: GLenum { 0x0004 } + + @inlinable static var TRIANGLE_STRIP: GLenum { 0x0005 } + + @inlinable static var TRIANGLE_FAN: GLenum { 0x0006 } + + @inlinable static var ZERO: GLenum { 0 } + + @inlinable static var ONE: GLenum { 1 } + + @inlinable static var SRC_COLOR: GLenum { 0x0300 } + + @inlinable static var ONE_MINUS_SRC_COLOR: GLenum { 0x0301 } + + @inlinable static var SRC_ALPHA: GLenum { 0x0302 } + + @inlinable static var ONE_MINUS_SRC_ALPHA: GLenum { 0x0303 } + + @inlinable static var DST_ALPHA: GLenum { 0x0304 } + + @inlinable static var ONE_MINUS_DST_ALPHA: GLenum { 0x0305 } + + @inlinable static var DST_COLOR: GLenum { 0x0306 } + + @inlinable static var ONE_MINUS_DST_COLOR: GLenum { 0x0307 } + + @inlinable static var SRC_ALPHA_SATURATE: GLenum { 0x0308 } + + @inlinable static var FUNC_ADD: GLenum { 0x8006 } + + @inlinable static var BLEND_EQUATION: GLenum { 0x8009 } + + @inlinable static var BLEND_EQUATION_RGB: GLenum { 0x8009 } + + @inlinable static var BLEND_EQUATION_ALPHA: GLenum { 0x883D } + + @inlinable static var FUNC_SUBTRACT: GLenum { 0x800A } + + @inlinable static var FUNC_REVERSE_SUBTRACT: GLenum { 0x800B } + + @inlinable static var BLEND_DST_RGB: GLenum { 0x80C8 } + + @inlinable static var BLEND_SRC_RGB: GLenum { 0x80C9 } + + @inlinable static var BLEND_DST_ALPHA: GLenum { 0x80CA } + + @inlinable static var BLEND_SRC_ALPHA: GLenum { 0x80CB } + + @inlinable static var CONSTANT_COLOR: GLenum { 0x8001 } + + @inlinable static var ONE_MINUS_CONSTANT_COLOR: GLenum { 0x8002 } + + @inlinable static var CONSTANT_ALPHA: GLenum { 0x8003 } + + @inlinable static var ONE_MINUS_CONSTANT_ALPHA: GLenum { 0x8004 } + + @inlinable static var BLEND_COLOR: GLenum { 0x8005 } + + @inlinable static var ARRAY_BUFFER: GLenum { 0x8892 } + + @inlinable static var ELEMENT_ARRAY_BUFFER: GLenum { 0x8893 } + + @inlinable static var ARRAY_BUFFER_BINDING: GLenum { 0x8894 } + + @inlinable static var ELEMENT_ARRAY_BUFFER_BINDING: GLenum { 0x8895 } + + @inlinable static var STREAM_DRAW: GLenum { 0x88E0 } + + @inlinable static var STATIC_DRAW: GLenum { 0x88E4 } + + @inlinable static var DYNAMIC_DRAW: GLenum { 0x88E8 } + + @inlinable static var BUFFER_SIZE: GLenum { 0x8764 } + + @inlinable static var BUFFER_USAGE: GLenum { 0x8765 } + + @inlinable static var CURRENT_VERTEX_ATTRIB: GLenum { 0x8626 } + + @inlinable static var FRONT: GLenum { 0x0404 } + + @inlinable static var BACK: GLenum { 0x0405 } + + @inlinable static var FRONT_AND_BACK: GLenum { 0x0408 } + + @inlinable static var CULL_FACE: GLenum { 0x0B44 } + + @inlinable static var BLEND: GLenum { 0x0BE2 } + + @inlinable static var DITHER: GLenum { 0x0BD0 } + + @inlinable static var STENCIL_TEST: GLenum { 0x0B90 } + + @inlinable static var DEPTH_TEST: GLenum { 0x0B71 } + + @inlinable static var SCISSOR_TEST: GLenum { 0x0C11 } + + @inlinable static var POLYGON_OFFSET_FILL: GLenum { 0x8037 } + + @inlinable static var SAMPLE_ALPHA_TO_COVERAGE: GLenum { 0x809E } + + @inlinable static var SAMPLE_COVERAGE: GLenum { 0x80A0 } + + @inlinable static var NO_ERROR: GLenum { 0 } + + @inlinable static var INVALID_ENUM: GLenum { 0x0500 } + + @inlinable static var INVALID_VALUE: GLenum { 0x0501 } + + @inlinable static var INVALID_OPERATION: GLenum { 0x0502 } + + @inlinable static var OUT_OF_MEMORY: GLenum { 0x0505 } + + @inlinable static var CW: GLenum { 0x0900 } + + @inlinable static var CCW: GLenum { 0x0901 } + + @inlinable static var LINE_WIDTH: GLenum { 0x0B21 } + + @inlinable static var ALIASED_POINT_SIZE_RANGE: GLenum { 0x846D } + + @inlinable static var ALIASED_LINE_WIDTH_RANGE: GLenum { 0x846E } + + @inlinable static var CULL_FACE_MODE: GLenum { 0x0B45 } + + @inlinable static var FRONT_FACE: GLenum { 0x0B46 } + + @inlinable static var DEPTH_RANGE: GLenum { 0x0B70 } + + @inlinable static var DEPTH_WRITEMASK: GLenum { 0x0B72 } + + @inlinable static var DEPTH_CLEAR_VALUE: GLenum { 0x0B73 } + + @inlinable static var DEPTH_FUNC: GLenum { 0x0B74 } + + @inlinable static var STENCIL_CLEAR_VALUE: GLenum { 0x0B91 } + + @inlinable static var STENCIL_FUNC: GLenum { 0x0B92 } + + @inlinable static var STENCIL_FAIL: GLenum { 0x0B94 } + + @inlinable static var STENCIL_PASS_DEPTH_FAIL: GLenum { 0x0B95 } + + @inlinable static var STENCIL_PASS_DEPTH_PASS: GLenum { 0x0B96 } + + @inlinable static var STENCIL_REF: GLenum { 0x0B97 } + + @inlinable static var STENCIL_VALUE_MASK: GLenum { 0x0B93 } + + @inlinable static var STENCIL_WRITEMASK: GLenum { 0x0B98 } + + @inlinable static var STENCIL_BACK_FUNC: GLenum { 0x8800 } + + @inlinable static var STENCIL_BACK_FAIL: GLenum { 0x8801 } + + @inlinable static var STENCIL_BACK_PASS_DEPTH_FAIL: GLenum { 0x8802 } + + @inlinable static var STENCIL_BACK_PASS_DEPTH_PASS: GLenum { 0x8803 } + + @inlinable static var STENCIL_BACK_REF: GLenum { 0x8CA3 } + + @inlinable static var STENCIL_BACK_VALUE_MASK: GLenum { 0x8CA4 } + + @inlinable static var STENCIL_BACK_WRITEMASK: GLenum { 0x8CA5 } + + @inlinable static var VIEWPORT: GLenum { 0x0BA2 } + + @inlinable static var SCISSOR_BOX: GLenum { 0x0C10 } + + @inlinable static var COLOR_CLEAR_VALUE: GLenum { 0x0C22 } + + @inlinable static var COLOR_WRITEMASK: GLenum { 0x0C23 } + + @inlinable static var UNPACK_ALIGNMENT: GLenum { 0x0CF5 } + + @inlinable static var PACK_ALIGNMENT: GLenum { 0x0D05 } + + @inlinable static var MAX_TEXTURE_SIZE: GLenum { 0x0D33 } + + @inlinable static var MAX_VIEWPORT_DIMS: GLenum { 0x0D3A } + + @inlinable static var SUBPIXEL_BITS: GLenum { 0x0D50 } + + @inlinable static var RED_BITS: GLenum { 0x0D52 } + + @inlinable static var GREEN_BITS: GLenum { 0x0D53 } + + @inlinable static var BLUE_BITS: GLenum { 0x0D54 } + + @inlinable static var ALPHA_BITS: GLenum { 0x0D55 } + + @inlinable static var DEPTH_BITS: GLenum { 0x0D56 } + + @inlinable static var STENCIL_BITS: GLenum { 0x0D57 } + + @inlinable static var POLYGON_OFFSET_UNITS: GLenum { 0x2A00 } + + @inlinable static var POLYGON_OFFSET_FACTOR: GLenum { 0x8038 } + + @inlinable static var TEXTURE_BINDING_2D: GLenum { 0x8069 } + + @inlinable static var SAMPLE_BUFFERS: GLenum { 0x80A8 } + + @inlinable static var SAMPLES: GLenum { 0x80A9 } + + @inlinable static var SAMPLE_COVERAGE_VALUE: GLenum { 0x80AA } + + @inlinable static var SAMPLE_COVERAGE_INVERT: GLenum { 0x80AB } + + @inlinable static var COMPRESSED_TEXTURE_FORMATS: GLenum { 0x86A3 } + + @inlinable static var DONT_CARE: GLenum { 0x1100 } + + @inlinable static var FASTEST: GLenum { 0x1101 } + + @inlinable static var NICEST: GLenum { 0x1102 } + + @inlinable static var GENERATE_MIPMAP_HINT: GLenum { 0x8192 } + + @inlinable static var BYTE: GLenum { 0x1400 } + + @inlinable static var UNSIGNED_BYTE: GLenum { 0x1401 } + + @inlinable static var SHORT: GLenum { 0x1402 } + + @inlinable static var UNSIGNED_SHORT: GLenum { 0x1403 } + + @inlinable static var INT: GLenum { 0x1404 } + + @inlinable static var UNSIGNED_INT: GLenum { 0x1405 } + + @inlinable static var FLOAT: GLenum { 0x1406 } + + @inlinable static var DEPTH_COMPONENT: GLenum { 0x1902 } + + @inlinable static var ALPHA: GLenum { 0x1906 } + + @inlinable static var RGB: GLenum { 0x1907 } + + @inlinable static var RGBA: GLenum { 0x1908 } + + @inlinable static var LUMINANCE: GLenum { 0x1909 } + + @inlinable static var LUMINANCE_ALPHA: GLenum { 0x190A } + + @inlinable static var UNSIGNED_SHORT_4_4_4_4: GLenum { 0x8033 } + + @inlinable static var UNSIGNED_SHORT_5_5_5_1: GLenum { 0x8034 } + + @inlinable static var UNSIGNED_SHORT_5_6_5: GLenum { 0x8363 } + + @inlinable static var FRAGMENT_SHADER: GLenum { 0x8B30 } + + @inlinable static var VERTEX_SHADER: GLenum { 0x8B31 } + + @inlinable static var MAX_VERTEX_ATTRIBS: GLenum { 0x8869 } + + @inlinable static var MAX_VERTEX_UNIFORM_VECTORS: GLenum { 0x8DFB } + + @inlinable static var MAX_VARYING_VECTORS: GLenum { 0x8DFC } + + @inlinable static var MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4D } + + @inlinable static var MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4C } + + @inlinable static var MAX_TEXTURE_IMAGE_UNITS: GLenum { 0x8872 } + + @inlinable static var MAX_FRAGMENT_UNIFORM_VECTORS: GLenum { 0x8DFD } + + @inlinable static var SHADER_TYPE: GLenum { 0x8B4F } + + @inlinable static var DELETE_STATUS: GLenum { 0x8B80 } + + @inlinable static var LINK_STATUS: GLenum { 0x8B82 } + + @inlinable static var VALIDATE_STATUS: GLenum { 0x8B83 } + + @inlinable static var ATTACHED_SHADERS: GLenum { 0x8B85 } + + @inlinable static var ACTIVE_UNIFORMS: GLenum { 0x8B86 } + + @inlinable static var ACTIVE_ATTRIBUTES: GLenum { 0x8B89 } + + @inlinable static var SHADING_LANGUAGE_VERSION: GLenum { 0x8B8C } + + @inlinable static var CURRENT_PROGRAM: GLenum { 0x8B8D } + + @inlinable static var NEVER: GLenum { 0x0200 } + + @inlinable static var LESS: GLenum { 0x0201 } + + @inlinable static var EQUAL: GLenum { 0x0202 } + + @inlinable static var LEQUAL: GLenum { 0x0203 } + + @inlinable static var GREATER: GLenum { 0x0204 } + + @inlinable static var NOTEQUAL: GLenum { 0x0205 } + + @inlinable static var GEQUAL: GLenum { 0x0206 } + + @inlinable static var ALWAYS: GLenum { 0x0207 } + + @inlinable static var KEEP: GLenum { 0x1E00 } + + @inlinable static var REPLACE: GLenum { 0x1E01 } + + @inlinable static var INCR: GLenum { 0x1E02 } + + @inlinable static var DECR: GLenum { 0x1E03 } + + @inlinable static var INVERT: GLenum { 0x150A } + + @inlinable static var INCR_WRAP: GLenum { 0x8507 } + + @inlinable static var DECR_WRAP: GLenum { 0x8508 } + + @inlinable static var VENDOR: GLenum { 0x1F00 } + + @inlinable static var RENDERER: GLenum { 0x1F01 } + + @inlinable static var VERSION: GLenum { 0x1F02 } + + @inlinable static var NEAREST: GLenum { 0x2600 } + + @inlinable static var LINEAR: GLenum { 0x2601 } + + @inlinable static var NEAREST_MIPMAP_NEAREST: GLenum { 0x2700 } + + @inlinable static var LINEAR_MIPMAP_NEAREST: GLenum { 0x2701 } + + @inlinable static var NEAREST_MIPMAP_LINEAR: GLenum { 0x2702 } + + @inlinable static var LINEAR_MIPMAP_LINEAR: GLenum { 0x2703 } + + @inlinable static var TEXTURE_MAG_FILTER: GLenum { 0x2800 } + + @inlinable static var TEXTURE_MIN_FILTER: GLenum { 0x2801 } + + @inlinable static var TEXTURE_WRAP_S: GLenum { 0x2802 } + + @inlinable static var TEXTURE_WRAP_T: GLenum { 0x2803 } + + @inlinable static var TEXTURE_2D: GLenum { 0x0DE1 } + + @inlinable static var TEXTURE: GLenum { 0x1702 } + + @inlinable static var TEXTURE_CUBE_MAP: GLenum { 0x8513 } + + @inlinable static var TEXTURE_BINDING_CUBE_MAP: GLenum { 0x8514 } + + @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_X: GLenum { 0x8515 } + + @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum { 0x8516 } + + @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum { 0x8517 } + + @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum { 0x8518 } + + @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum { 0x8519 } + + @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum { 0x851A } + + @inlinable static var MAX_CUBE_MAP_TEXTURE_SIZE: GLenum { 0x851C } + + @inlinable static var TEXTURE0: GLenum { 0x84C0 } + + @inlinable static var TEXTURE1: GLenum { 0x84C1 } + + @inlinable static var TEXTURE2: GLenum { 0x84C2 } + + @inlinable static var TEXTURE3: GLenum { 0x84C3 } + + @inlinable static var TEXTURE4: GLenum { 0x84C4 } + + @inlinable static var TEXTURE5: GLenum { 0x84C5 } + + @inlinable static var TEXTURE6: GLenum { 0x84C6 } + + @inlinable static var TEXTURE7: GLenum { 0x84C7 } + + @inlinable static var TEXTURE8: GLenum { 0x84C8 } + + @inlinable static var TEXTURE9: GLenum { 0x84C9 } + + @inlinable static var TEXTURE10: GLenum { 0x84CA } + + @inlinable static var TEXTURE11: GLenum { 0x84CB } + + @inlinable static var TEXTURE12: GLenum { 0x84CC } + + @inlinable static var TEXTURE13: GLenum { 0x84CD } + + @inlinable static var TEXTURE14: GLenum { 0x84CE } + + @inlinable static var TEXTURE15: GLenum { 0x84CF } + + @inlinable static var TEXTURE16: GLenum { 0x84D0 } + + @inlinable static var TEXTURE17: GLenum { 0x84D1 } + + @inlinable static var TEXTURE18: GLenum { 0x84D2 } + + @inlinable static var TEXTURE19: GLenum { 0x84D3 } + + @inlinable static var TEXTURE20: GLenum { 0x84D4 } + + @inlinable static var TEXTURE21: GLenum { 0x84D5 } + + @inlinable static var TEXTURE22: GLenum { 0x84D6 } + + @inlinable static var TEXTURE23: GLenum { 0x84D7 } + + @inlinable static var TEXTURE24: GLenum { 0x84D8 } + + @inlinable static var TEXTURE25: GLenum { 0x84D9 } + + @inlinable static var TEXTURE26: GLenum { 0x84DA } + + @inlinable static var TEXTURE27: GLenum { 0x84DB } + + @inlinable static var TEXTURE28: GLenum { 0x84DC } + + @inlinable static var TEXTURE29: GLenum { 0x84DD } + + @inlinable static var TEXTURE30: GLenum { 0x84DE } + + @inlinable static var TEXTURE31: GLenum { 0x84DF } + + @inlinable static var ACTIVE_TEXTURE: GLenum { 0x84E0 } + + @inlinable static var REPEAT: GLenum { 0x2901 } + + @inlinable static var CLAMP_TO_EDGE: GLenum { 0x812F } + + @inlinable static var MIRRORED_REPEAT: GLenum { 0x8370 } + + @inlinable static var FLOAT_VEC2: GLenum { 0x8B50 } + + @inlinable static var FLOAT_VEC3: GLenum { 0x8B51 } + + @inlinable static var FLOAT_VEC4: GLenum { 0x8B52 } + + @inlinable static var INT_VEC2: GLenum { 0x8B53 } + + @inlinable static var INT_VEC3: GLenum { 0x8B54 } + + @inlinable static var INT_VEC4: GLenum { 0x8B55 } + + @inlinable static var BOOL: GLenum { 0x8B56 } + + @inlinable static var BOOL_VEC2: GLenum { 0x8B57 } + + @inlinable static var BOOL_VEC3: GLenum { 0x8B58 } + + @inlinable static var BOOL_VEC4: GLenum { 0x8B59 } + + @inlinable static var FLOAT_MAT2: GLenum { 0x8B5A } + + @inlinable static var FLOAT_MAT3: GLenum { 0x8B5B } + + @inlinable static var FLOAT_MAT4: GLenum { 0x8B5C } + + @inlinable static var SAMPLER_2D: GLenum { 0x8B5E } + + @inlinable static var SAMPLER_CUBE: GLenum { 0x8B60 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_ENABLED: GLenum { 0x8622 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_SIZE: GLenum { 0x8623 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_STRIDE: GLenum { 0x8624 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_TYPE: GLenum { 0x8625 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum { 0x886A } + + @inlinable static var VERTEX_ATTRIB_ARRAY_POINTER: GLenum { 0x8645 } + + @inlinable static var VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum { 0x889F } + + @inlinable static var IMPLEMENTATION_COLOR_READ_TYPE: GLenum { 0x8B9A } + + @inlinable static var IMPLEMENTATION_COLOR_READ_FORMAT: GLenum { 0x8B9B } + + @inlinable static var COMPILE_STATUS: GLenum { 0x8B81 } + + @inlinable static var LOW_FLOAT: GLenum { 0x8DF0 } + + @inlinable static var MEDIUM_FLOAT: GLenum { 0x8DF1 } + + @inlinable static var HIGH_FLOAT: GLenum { 0x8DF2 } + + @inlinable static var LOW_INT: GLenum { 0x8DF3 } + + @inlinable static var MEDIUM_INT: GLenum { 0x8DF4 } + + @inlinable static var HIGH_INT: GLenum { 0x8DF5 } + + @inlinable static var FRAMEBUFFER: GLenum { 0x8D40 } + + @inlinable static var RENDERBUFFER: GLenum { 0x8D41 } + + @inlinable static var RGBA4: GLenum { 0x8056 } + + @inlinable static var RGB5_A1: GLenum { 0x8057 } + + @inlinable static var RGB565: GLenum { 0x8D62 } + + @inlinable static var DEPTH_COMPONENT16: GLenum { 0x81A5 } + + @inlinable static var STENCIL_INDEX8: GLenum { 0x8D48 } + + @inlinable static var DEPTH_STENCIL: GLenum { 0x84F9 } + + @inlinable static var RENDERBUFFER_WIDTH: GLenum { 0x8D42 } + + @inlinable static var RENDERBUFFER_HEIGHT: GLenum { 0x8D43 } + + @inlinable static var RENDERBUFFER_INTERNAL_FORMAT: GLenum { 0x8D44 } + + @inlinable static var RENDERBUFFER_RED_SIZE: GLenum { 0x8D50 } + + @inlinable static var RENDERBUFFER_GREEN_SIZE: GLenum { 0x8D51 } + + @inlinable static var RENDERBUFFER_BLUE_SIZE: GLenum { 0x8D52 } + + @inlinable static var RENDERBUFFER_ALPHA_SIZE: GLenum { 0x8D53 } + + @inlinable static var RENDERBUFFER_DEPTH_SIZE: GLenum { 0x8D54 } + + @inlinable static var RENDERBUFFER_STENCIL_SIZE: GLenum { 0x8D55 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum { 0x8CD0 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum { 0x8CD1 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum { 0x8CD2 } + + @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum { 0x8CD3 } + + @inlinable static var COLOR_ATTACHMENT0: GLenum { 0x8CE0 } + + @inlinable static var DEPTH_ATTACHMENT: GLenum { 0x8D00 } + + @inlinable static var STENCIL_ATTACHMENT: GLenum { 0x8D20 } + + @inlinable static var DEPTH_STENCIL_ATTACHMENT: GLenum { 0x821A } + + @inlinable static var NONE: GLenum { 0 } + + @inlinable static var FRAMEBUFFER_COMPLETE: GLenum { 0x8CD5 } + + @inlinable static var FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum { 0x8CD6 } + + @inlinable static var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum { 0x8CD7 } + + @inlinable static var FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum { 0x8CD9 } + + @inlinable static var FRAMEBUFFER_UNSUPPORTED: GLenum { 0x8CDD } + + @inlinable static var FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } + + @inlinable static var RENDERBUFFER_BINDING: GLenum { 0x8CA7 } + + @inlinable static var MAX_RENDERBUFFER_SIZE: GLenum { 0x84E8 } + + @inlinable static var INVALID_FRAMEBUFFER_OPERATION: GLenum { 0x0506 } + + @inlinable static var UNPACK_FLIP_Y_WEBGL: GLenum { 0x9240 } + + @inlinable static var UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum { 0x9241 } + + @inlinable static var CONTEXT_LOST_WEBGL: GLenum { 0x9242 } + + @inlinable static var UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum { 0x9243 } + + @inlinable static var BROWSER_DEFAULT_WEBGL: GLenum { 0x9244 } + + @inlinable var canvas: HTMLCanvasElement_or_OffscreenCanvas { ReadonlyAttribute[Strings.canvas, in: jsObject] } + + @inlinable var drawingBufferWidth: GLsizei { ReadonlyAttribute[Strings.drawingBufferWidth, in: jsObject] } + + @inlinable var drawingBufferHeight: GLsizei { ReadonlyAttribute[Strings.drawingBufferHeight, in: jsObject] } + + @inlinable func getContextAttributes() -> WebGLContextAttributes? { + let this = jsObject + return this[Strings.getContextAttributes].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func isContextLost() -> Bool { + let this = jsObject + return this[Strings.isContextLost].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func getSupportedExtensions() -> [String]? { + let this = jsObject + return this[Strings.getSupportedExtensions].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func getExtension(name: String) -> JSObject? { + let this = jsObject + return this[Strings.getExtension].function!(this: this, arguments: [name.jsValue]).fromJSValue()! + } + + @inlinable func activeTexture(texture: GLenum) { + let this = jsObject + _ = this[Strings.activeTexture].function!(this: this, arguments: [texture.jsValue]) + } + + @inlinable func attachShader(program: WebGLProgram, shader: WebGLShader) { + let this = jsObject + _ = this[Strings.attachShader].function!(this: this, arguments: [program.jsValue, shader.jsValue]) + } + + @inlinable func bindAttribLocation(program: WebGLProgram, index: GLuint, name: String) { + let this = jsObject + _ = this[Strings.bindAttribLocation].function!(this: this, arguments: [program.jsValue, index.jsValue, name.jsValue]) + } + + @inlinable func bindBuffer(target: GLenum, buffer: WebGLBuffer?) { + let this = jsObject + _ = this[Strings.bindBuffer].function!(this: this, arguments: [target.jsValue, buffer.jsValue]) + } + + @inlinable func bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer?) { + let this = jsObject + _ = this[Strings.bindFramebuffer].function!(this: this, arguments: [target.jsValue, framebuffer.jsValue]) + } + + @inlinable func bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer?) { + let this = jsObject + _ = this[Strings.bindRenderbuffer].function!(this: this, arguments: [target.jsValue, renderbuffer.jsValue]) + } + + @inlinable func bindTexture(target: GLenum, texture: WebGLTexture?) { + let this = jsObject + _ = this[Strings.bindTexture].function!(this: this, arguments: [target.jsValue, texture.jsValue]) + } + + @inlinable func blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { + let this = jsObject + _ = this[Strings.blendColor].function!(this: this, arguments: [red.jsValue, green.jsValue, blue.jsValue, alpha.jsValue]) + } + + @inlinable func blendEquation(mode: GLenum) { + let this = jsObject + _ = this[Strings.blendEquation].function!(this: this, arguments: [mode.jsValue]) + } + + @inlinable func blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum) { + let this = jsObject + _ = this[Strings.blendEquationSeparate].function!(this: this, arguments: [modeRGB.jsValue, modeAlpha.jsValue]) + } + + @inlinable func blendFunc(sfactor: GLenum, dfactor: GLenum) { + let this = jsObject + _ = this[Strings.blendFunc].function!(this: this, arguments: [sfactor.jsValue, dfactor.jsValue]) + } + + @inlinable func blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { + let this = jsObject + _ = this[Strings.blendFuncSeparate].function!(this: this, arguments: [srcRGB.jsValue, dstRGB.jsValue, srcAlpha.jsValue, dstAlpha.jsValue]) + } + + @inlinable func checkFramebufferStatus(target: GLenum) -> GLenum { + let this = jsObject + return this[Strings.checkFramebufferStatus].function!(this: this, arguments: [target.jsValue]).fromJSValue()! + } + + @inlinable func clear(mask: GLbitfield) { + let this = jsObject + _ = this[Strings.clear].function!(this: this, arguments: [mask.jsValue]) + } + + @inlinable func clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { + let this = jsObject + _ = this[Strings.clearColor].function!(this: this, arguments: [red.jsValue, green.jsValue, blue.jsValue, alpha.jsValue]) + } + + @inlinable func clearDepth(depth: GLclampf) { + let this = jsObject + _ = this[Strings.clearDepth].function!(this: this, arguments: [depth.jsValue]) + } + + @inlinable func clearStencil(s: GLint) { + let this = jsObject + _ = this[Strings.clearStencil].function!(this: this, arguments: [s.jsValue]) + } + + @inlinable func colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) { + let this = jsObject + _ = this[Strings.colorMask].function!(this: this, arguments: [red.jsValue, green.jsValue, blue.jsValue, alpha.jsValue]) + } + + @inlinable func compileShader(shader: WebGLShader) { + let this = jsObject + _ = this[Strings.compileShader].function!(this: this, arguments: [shader.jsValue]) + } + + @inlinable func copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = x.jsValue + let _arg4 = y.jsValue + let _arg5 = width.jsValue + let _arg6 = height.jsValue + let _arg7 = border.jsValue + let this = jsObject + _ = this[Strings.copyTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) + } + + @inlinable func copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = x.jsValue + let _arg5 = y.jsValue + let _arg6 = width.jsValue + let _arg7 = height.jsValue + let this = jsObject + _ = this[Strings.copyTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) + } + + @inlinable func createBuffer() -> WebGLBuffer? { + let this = jsObject + return this[Strings.createBuffer].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func createFramebuffer() -> WebGLFramebuffer? { + let this = jsObject + return this[Strings.createFramebuffer].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func createProgram() -> WebGLProgram? { + let this = jsObject + return this[Strings.createProgram].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func createRenderbuffer() -> WebGLRenderbuffer? { + let this = jsObject + return this[Strings.createRenderbuffer].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func createShader(type: GLenum) -> WebGLShader? { + let this = jsObject + return this[Strings.createShader].function!(this: this, arguments: [type.jsValue]).fromJSValue()! + } + + @inlinable func createTexture() -> WebGLTexture? { + let this = jsObject + return this[Strings.createTexture].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func cullFace(mode: GLenum) { + let this = jsObject + _ = this[Strings.cullFace].function!(this: this, arguments: [mode.jsValue]) + } + + @inlinable func deleteBuffer(buffer: WebGLBuffer?) { + let this = jsObject + _ = this[Strings.deleteBuffer].function!(this: this, arguments: [buffer.jsValue]) + } + + @inlinable func deleteFramebuffer(framebuffer: WebGLFramebuffer?) { + let this = jsObject + _ = this[Strings.deleteFramebuffer].function!(this: this, arguments: [framebuffer.jsValue]) + } + + @inlinable func deleteProgram(program: WebGLProgram?) { + let this = jsObject + _ = this[Strings.deleteProgram].function!(this: this, arguments: [program.jsValue]) + } + + @inlinable func deleteRenderbuffer(renderbuffer: WebGLRenderbuffer?) { + let this = jsObject + _ = this[Strings.deleteRenderbuffer].function!(this: this, arguments: [renderbuffer.jsValue]) + } + + @inlinable func deleteShader(shader: WebGLShader?) { + let this = jsObject + _ = this[Strings.deleteShader].function!(this: this, arguments: [shader.jsValue]) + } + + @inlinable func deleteTexture(texture: WebGLTexture?) { + let this = jsObject + _ = this[Strings.deleteTexture].function!(this: this, arguments: [texture.jsValue]) + } + + @inlinable func depthFunc(func: GLenum) { + let this = jsObject + _ = this[Strings.depthFunc].function!(this: this, arguments: [`func`.jsValue]) + } + + @inlinable func depthMask(flag: GLboolean) { + let this = jsObject + _ = this[Strings.depthMask].function!(this: this, arguments: [flag.jsValue]) + } + + @inlinable func depthRange(zNear: GLclampf, zFar: GLclampf) { + let this = jsObject + _ = this[Strings.depthRange].function!(this: this, arguments: [zNear.jsValue, zFar.jsValue]) + } + + @inlinable func detachShader(program: WebGLProgram, shader: WebGLShader) { + let this = jsObject + _ = this[Strings.detachShader].function!(this: this, arguments: [program.jsValue, shader.jsValue]) + } + + @inlinable func disable(cap: GLenum) { + let this = jsObject + _ = this[Strings.disable].function!(this: this, arguments: [cap.jsValue]) + } + + @inlinable func disableVertexAttribArray(index: GLuint) { + let this = jsObject + _ = this[Strings.disableVertexAttribArray].function!(this: this, arguments: [index.jsValue]) + } + + @inlinable func drawArrays(mode: GLenum, first: GLint, count: GLsizei) { + let this = jsObject + _ = this[Strings.drawArrays].function!(this: this, arguments: [mode.jsValue, first.jsValue, count.jsValue]) + } + + @inlinable func drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr) { + let this = jsObject + _ = this[Strings.drawElements].function!(this: this, arguments: [mode.jsValue, count.jsValue, type.jsValue, offset.jsValue]) + } + + @inlinable func enable(cap: GLenum) { + let this = jsObject + _ = this[Strings.enable].function!(this: this, arguments: [cap.jsValue]) + } + + @inlinable func enableVertexAttribArray(index: GLuint) { + let this = jsObject + _ = this[Strings.enableVertexAttribArray].function!(this: this, arguments: [index.jsValue]) + } + + @inlinable func finish() { + let this = jsObject + _ = this[Strings.finish].function!(this: this, arguments: []) + } + + @inlinable func flush() { + let this = jsObject + _ = this[Strings.flush].function!(this: this, arguments: []) + } + + @inlinable func framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer?) { + let this = jsObject + _ = this[Strings.framebufferRenderbuffer].function!(this: this, arguments: [target.jsValue, attachment.jsValue, renderbuffertarget.jsValue, renderbuffer.jsValue]) + } + + @inlinable func framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture?, level: GLint) { + let this = jsObject + _ = this[Strings.framebufferTexture2D].function!(this: this, arguments: [target.jsValue, attachment.jsValue, textarget.jsValue, texture.jsValue, level.jsValue]) + } + + @inlinable func frontFace(mode: GLenum) { + let this = jsObject + _ = this[Strings.frontFace].function!(this: this, arguments: [mode.jsValue]) + } + + @inlinable func generateMipmap(target: GLenum) { + let this = jsObject + _ = this[Strings.generateMipmap].function!(this: this, arguments: [target.jsValue]) + } + + @inlinable func getActiveAttrib(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + let this = jsObject + return this[Strings.getActiveAttrib].function!(this: this, arguments: [program.jsValue, index.jsValue]).fromJSValue()! + } + + @inlinable func getActiveUniform(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { + let this = jsObject + return this[Strings.getActiveUniform].function!(this: this, arguments: [program.jsValue, index.jsValue]).fromJSValue()! + } + + @inlinable func getAttachedShaders(program: WebGLProgram) -> [WebGLShader]? { + let this = jsObject + return this[Strings.getAttachedShaders].function!(this: this, arguments: [program.jsValue]).fromJSValue()! + } + + @inlinable func getAttribLocation(program: WebGLProgram, name: String) -> GLint { + let this = jsObject + return this[Strings.getAttribLocation].function!(this: this, arguments: [program.jsValue, name.jsValue]).fromJSValue()! + } + + @inlinable func getBufferParameter(target: GLenum, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getBufferParameter].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getParameter(pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getParameter].function!(this: this, arguments: [pname.jsValue]).fromJSValue()! + } + + @inlinable func getError() -> GLenum { + let this = jsObject + return this[Strings.getError].function!(this: this, arguments: []).fromJSValue()! + } + + @inlinable func getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getFramebufferAttachmentParameter].function!(this: this, arguments: [target.jsValue, attachment.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getProgramParameter(program: WebGLProgram, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getProgramParameter].function!(this: this, arguments: [program.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getProgramInfoLog(program: WebGLProgram) -> String? { + let this = jsObject + return this[Strings.getProgramInfoLog].function!(this: this, arguments: [program.jsValue]).fromJSValue()! + } + + @inlinable func getRenderbufferParameter(target: GLenum, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getRenderbufferParameter].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getShaderParameter(shader: WebGLShader, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getShaderParameter].function!(this: this, arguments: [shader.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum) -> WebGLShaderPrecisionFormat? { + let this = jsObject + return this[Strings.getShaderPrecisionFormat].function!(this: this, arguments: [shadertype.jsValue, precisiontype.jsValue]).fromJSValue()! + } + + @inlinable func getShaderInfoLog(shader: WebGLShader) -> String? { + let this = jsObject + return this[Strings.getShaderInfoLog].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! + } + + @inlinable func getShaderSource(shader: WebGLShader) -> String? { + let this = jsObject + return this[Strings.getShaderSource].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! + } + + @inlinable func getTexParameter(target: GLenum, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getTexParameter].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getUniform(program: WebGLProgram, location: WebGLUniformLocation) -> JSValue { + let this = jsObject + return this[Strings.getUniform].function!(this: this, arguments: [program.jsValue, location.jsValue]).fromJSValue()! + } + + @inlinable func getUniformLocation(program: WebGLProgram, name: String) -> WebGLUniformLocation? { + let this = jsObject + return this[Strings.getUniformLocation].function!(this: this, arguments: [program.jsValue, name.jsValue]).fromJSValue()! + } + + @inlinable func getVertexAttrib(index: GLuint, pname: GLenum) -> JSValue { + let this = jsObject + return this[Strings.getVertexAttrib].function!(this: this, arguments: [index.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func getVertexAttribOffset(index: GLuint, pname: GLenum) -> GLintptr { + let this = jsObject + return this[Strings.getVertexAttribOffset].function!(this: this, arguments: [index.jsValue, pname.jsValue]).fromJSValue()! + } + + @inlinable func hint(target: GLenum, mode: GLenum) { + let this = jsObject + _ = this[Strings.hint].function!(this: this, arguments: [target.jsValue, mode.jsValue]) + } + + @inlinable func isBuffer(buffer: WebGLBuffer?) -> GLboolean { + let this = jsObject + return this[Strings.isBuffer].function!(this: this, arguments: [buffer.jsValue]).fromJSValue()! + } + + @inlinable func isEnabled(cap: GLenum) -> GLboolean { + let this = jsObject + return this[Strings.isEnabled].function!(this: this, arguments: [cap.jsValue]).fromJSValue()! + } + + @inlinable func isFramebuffer(framebuffer: WebGLFramebuffer?) -> GLboolean { + let this = jsObject + return this[Strings.isFramebuffer].function!(this: this, arguments: [framebuffer.jsValue]).fromJSValue()! + } + + @inlinable func isProgram(program: WebGLProgram?) -> GLboolean { + let this = jsObject + return this[Strings.isProgram].function!(this: this, arguments: [program.jsValue]).fromJSValue()! + } + + @inlinable func isRenderbuffer(renderbuffer: WebGLRenderbuffer?) -> GLboolean { + let this = jsObject + return this[Strings.isRenderbuffer].function!(this: this, arguments: [renderbuffer.jsValue]).fromJSValue()! + } + + @inlinable func isShader(shader: WebGLShader?) -> GLboolean { + let this = jsObject + return this[Strings.isShader].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! + } + + @inlinable func isTexture(texture: WebGLTexture?) -> GLboolean { + let this = jsObject + return this[Strings.isTexture].function!(this: this, arguments: [texture.jsValue]).fromJSValue()! + } + + @inlinable func lineWidth(width: GLfloat) { + let this = jsObject + _ = this[Strings.lineWidth].function!(this: this, arguments: [width.jsValue]) + } + + @inlinable func linkProgram(program: WebGLProgram) { + let this = jsObject + _ = this[Strings.linkProgram].function!(this: this, arguments: [program.jsValue]) + } + + @inlinable func pixelStorei(pname: GLenum, param: GLint) { + let this = jsObject + _ = this[Strings.pixelStorei].function!(this: this, arguments: [pname.jsValue, param.jsValue]) + } + + @inlinable func polygonOffset(factor: GLfloat, units: GLfloat) { + let this = jsObject + _ = this[Strings.polygonOffset].function!(this: this, arguments: [factor.jsValue, units.jsValue]) + } + + @inlinable func renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) { + let this = jsObject + _ = this[Strings.renderbufferStorage].function!(this: this, arguments: [target.jsValue, internalformat.jsValue, width.jsValue, height.jsValue]) + } + + @inlinable func sampleCoverage(value: GLclampf, invert: GLboolean) { + let this = jsObject + _ = this[Strings.sampleCoverage].function!(this: this, arguments: [value.jsValue, invert.jsValue]) + } + + @inlinable func scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + let this = jsObject + _ = this[Strings.scissor].function!(this: this, arguments: [x.jsValue, y.jsValue, width.jsValue, height.jsValue]) + } + + @inlinable func shaderSource(shader: WebGLShader, source: String) { + let this = jsObject + _ = this[Strings.shaderSource].function!(this: this, arguments: [shader.jsValue, source.jsValue]) + } + + @inlinable func stencilFunc(func: GLenum, ref: GLint, mask: GLuint) { + let this = jsObject + _ = this[Strings.stencilFunc].function!(this: this, arguments: [`func`.jsValue, ref.jsValue, mask.jsValue]) + } + + @inlinable func stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint) { + let this = jsObject + _ = this[Strings.stencilFuncSeparate].function!(this: this, arguments: [face.jsValue, `func`.jsValue, ref.jsValue, mask.jsValue]) + } + + @inlinable func stencilMask(mask: GLuint) { + let this = jsObject + _ = this[Strings.stencilMask].function!(this: this, arguments: [mask.jsValue]) + } + + @inlinable func stencilMaskSeparate(face: GLenum, mask: GLuint) { + let this = jsObject + _ = this[Strings.stencilMaskSeparate].function!(this: this, arguments: [face.jsValue, mask.jsValue]) + } + + @inlinable func stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum) { + let this = jsObject + _ = this[Strings.stencilOp].function!(this: this, arguments: [fail.jsValue, zfail.jsValue, zpass.jsValue]) + } + + @inlinable func stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) { + let this = jsObject + _ = this[Strings.stencilOpSeparate].function!(this: this, arguments: [face.jsValue, fail.jsValue, zfail.jsValue, zpass.jsValue]) + } + + @inlinable func texParameterf(target: GLenum, pname: GLenum, param: GLfloat) { + let this = jsObject + _ = this[Strings.texParameterf].function!(this: this, arguments: [target.jsValue, pname.jsValue, param.jsValue]) + } + + @inlinable func texParameteri(target: GLenum, pname: GLenum, param: GLint) { + let this = jsObject + _ = this[Strings.texParameteri].function!(this: this, arguments: [target.jsValue, pname.jsValue, param.jsValue]) + } + + @inlinable func uniform1f(location: WebGLUniformLocation?, x: GLfloat) { + let this = jsObject + _ = this[Strings.uniform1f].function!(this: this, arguments: [location.jsValue, x.jsValue]) + } + + @inlinable func uniform2f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat) { + let this = jsObject + _ = this[Strings.uniform2f].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue]) + } + + @inlinable func uniform3f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat) { + let this = jsObject + _ = this[Strings.uniform3f].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue]) + } + + @inlinable func uniform4f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { + let this = jsObject + _ = this[Strings.uniform4f].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) + } + + @inlinable func uniform1i(location: WebGLUniformLocation?, x: GLint) { + let this = jsObject + _ = this[Strings.uniform1i].function!(this: this, arguments: [location.jsValue, x.jsValue]) + } + + @inlinable func uniform2i(location: WebGLUniformLocation?, x: GLint, y: GLint) { + let this = jsObject + _ = this[Strings.uniform2i].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue]) + } + + @inlinable func uniform3i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint) { + let this = jsObject + _ = this[Strings.uniform3i].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue]) + } + + @inlinable func uniform4i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint, w: GLint) { + let this = jsObject + _ = this[Strings.uniform4i].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) + } + + @inlinable func useProgram(program: WebGLProgram?) { + let this = jsObject + _ = this[Strings.useProgram].function!(this: this, arguments: [program.jsValue]) + } + + @inlinable func validateProgram(program: WebGLProgram) { + let this = jsObject + _ = this[Strings.validateProgram].function!(this: this, arguments: [program.jsValue]) + } + + @inlinable func vertexAttrib1f(index: GLuint, x: GLfloat) { + let this = jsObject + _ = this[Strings.vertexAttrib1f].function!(this: this, arguments: [index.jsValue, x.jsValue]) + } + + @inlinable func vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat) { + let this = jsObject + _ = this[Strings.vertexAttrib2f].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue]) + } + + @inlinable func vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) { + let this = jsObject + _ = this[Strings.vertexAttrib3f].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue]) + } + + @inlinable func vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { + let this = jsObject + _ = this[Strings.vertexAttrib4f].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) + } + + @inlinable func vertexAttrib1fv(index: GLuint, values: Float32List) { + let this = jsObject + _ = this[Strings.vertexAttrib1fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) + } + + @inlinable func vertexAttrib2fv(index: GLuint, values: Float32List) { + let this = jsObject + _ = this[Strings.vertexAttrib2fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) + } + + @inlinable func vertexAttrib3fv(index: GLuint, values: Float32List) { + let this = jsObject + _ = this[Strings.vertexAttrib3fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) + } + + @inlinable func vertexAttrib4fv(index: GLuint, values: Float32List) { + let this = jsObject + _ = this[Strings.vertexAttrib4fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) + } + + @inlinable func vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) { + let _arg0 = index.jsValue + let _arg1 = size.jsValue + let _arg2 = type.jsValue + let _arg3 = normalized.jsValue + let _arg4 = stride.jsValue + let _arg5 = offset.jsValue + let this = jsObject + _ = this[Strings.vertexAttribPointer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } + + @inlinable func viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { + let this = jsObject + _ = this[Strings.viewport].function!(this: this, arguments: [x.jsValue, y.jsValue, width.jsValue, height.jsValue]) + } +} + +public protocol WebGLRenderingContextOverloads: JSBridgedClass {} +public extension WebGLRenderingContextOverloads { + @inlinable func bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) { + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, size.jsValue, usage.jsValue]) + } + + @inlinable func bufferData(target: GLenum, data: BufferSource?, usage: GLenum) { + let this = jsObject + _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, data.jsValue, usage.jsValue]) + } + + @inlinable func bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource) { + let this = jsObject + _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue, offset.jsValue, data.jsValue]) + } + + @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = border.jsValue + let _arg6 = data.jsValue + let this = jsObject + _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) + } + + @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let _arg6 = format.jsValue + let _arg7 = data.jsValue + let this = jsObject + _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) + } + + @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + let _arg0 = x.jsValue + let _arg1 = y.jsValue + let _arg2 = width.jsValue + let _arg3 = height.jsValue + let _arg4 = format.jsValue + let _arg5 = type.jsValue + let _arg6 = pixels.jsValue + let this = jsObject + _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) + } + + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = width.jsValue + let _arg4 = height.jsValue + let _arg5 = border.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = pixels.jsValue + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } + + @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = internalformat.jsValue + let _arg3 = format.jsValue + let _arg4 = type.jsValue + let _arg5 = source.jsValue + let this = jsObject + _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) + } + + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = width.jsValue + let _arg5 = height.jsValue + let _arg6 = format.jsValue + let _arg7 = type.jsValue + let _arg8 = pixels.jsValue + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) + } + + @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource) { + let _arg0 = target.jsValue + let _arg1 = level.jsValue + let _arg2 = xoffset.jsValue + let _arg3 = yoffset.jsValue + let _arg4 = format.jsValue + let _arg5 = type.jsValue + let _arg6 = source.jsValue + let this = jsObject + _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) + } - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + @inlinable func uniform1fv(location: WebGLUniformLocation?, v: Float32List) { + let this = jsObject + _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable func uniform2fv(location: WebGLUniformLocation?, v: Float32List) { + let this = jsObject + _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} + @inlinable func uniform3fv(location: WebGLUniformLocation?, v: Float32List) { + let this = jsObject + _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } -public enum VideoPixelFormat: JSString, JSValueCompatible { - case i420 = "I420" - case i420A = "I420A" - case i422 = "I422" - case i444 = "I444" - case nV12 = "NV12" - case rGBA = "RGBA" - case rGBX = "RGBX" - case bGRA = "BGRA" - case bGRX = "BGRX" + @inlinable func uniform4fv(location: WebGLUniformLocation?, v: Float32List) { + let this = jsObject + _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + @inlinable func uniform1iv(location: WebGLUniformLocation?, v: Int32List) { + let this = jsObject + _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable func uniform2iv(location: WebGLUniformLocation?, v: Int32List) { + let this = jsObject + _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} + @inlinable func uniform3iv(location: WebGLUniformLocation?, v: Int32List) { + let this = jsObject + _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } -public enum VideoResizeModeEnum: JSString, JSValueCompatible { - case none = "none" - case cropAndScale = "crop-and-scale" + @inlinable func uniform4iv(location: WebGLUniformLocation?, v: Int32List) { + let this = jsObject + _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) + } - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil + @inlinable func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + let this = jsObject + _ = this[Strings.uniformMatrix2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, value.jsValue]) } - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + @inlinable func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + let this = jsObject + _ = this[Strings.uniformMatrix3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, value.jsValue]) } - @inlinable public var jsValue: JSValue { rawValue.jsValue } + @inlinable func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { + let this = jsObject + _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, value.jsValue]) + } } -public class VideoTrack: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.VideoTrack].function! } +public class WebGLShader: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLShader].function! } + + public required init(unsafelyWrapping jsObject: JSObject) { + super.init(unsafelyWrapping: jsObject) + } +} + +public class WebGLShaderPrecisionFormat: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLShaderPrecisionFormat].function! } public let jsObject: JSObject public required init(unsafelyWrapping jsObject: JSObject) { - _id = ReadonlyAttribute(jsObject: jsObject, name: Strings.id) - _kind = ReadonlyAttribute(jsObject: jsObject, name: Strings.kind) - _label = ReadonlyAttribute(jsObject: jsObject, name: Strings.label) - _language = ReadonlyAttribute(jsObject: jsObject, name: Strings.language) - _selected = ReadWriteAttribute(jsObject: jsObject, name: Strings.selected) + _rangeMin = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeMin) + _rangeMax = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeMax) + _precision = ReadonlyAttribute(jsObject: jsObject, name: Strings.precision) self.jsObject = jsObject } @ReadonlyAttribute - public var id: String - - @ReadonlyAttribute - public var kind: String + public var rangeMin: GLint @ReadonlyAttribute - public var label: String + public var rangeMax: GLint @ReadonlyAttribute - public var language: String - - @ReadWriteAttribute - public var selected: Bool + public var precision: GLint } -public class VideoTrackList: EventTarget { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.VideoTrackList].function! } +public class WebGLTexture: WebGLObject { + @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTexture].function! } public required init(unsafelyWrapping jsObject: JSObject) { - _length = ReadonlyAttribute(jsObject: jsObject, name: Strings.length) - _selectedIndex = ReadonlyAttribute(jsObject: jsObject, name: Strings.selectedIndex) - _onchange = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onchange) - _onaddtrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onaddtrack) - _onremovetrack = ClosureAttribute1Optional(jsObject: jsObject, name: Strings.onremovetrack) super.init(unsafelyWrapping: jsObject) } - - @ReadonlyAttribute - public var length: UInt32 - - @inlinable public subscript(key: Int) -> VideoTrack { - jsObject[key].fromJSValue()! - } - - @inlinable public func getTrackById(id: String) -> VideoTrack? { - let this = jsObject - return this[Strings.getTrackById].function!(this: this, arguments: [id.jsValue]).fromJSValue()! - } - - @ReadonlyAttribute - public var selectedIndex: Int32 - - @ClosureAttribute1Optional - public var onchange: EventHandler - - @ClosureAttribute1Optional - public var onaddtrack: EventHandler - - @ClosureAttribute1Optional - public var onremovetrack: EventHandler } -public enum VideoTransferCharacteristics: JSString, JSValueCompatible { - case bt709 = "bt709" - case smpte170m = "smpte170m" - case iec6196621 = "iec61966-2-1" +public class WebGLUniformLocation: JSBridgedClass { + @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLUniformLocation].function! } - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } + public let jsObject: JSObject - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) + public required init(unsafelyWrapping jsObject: JSObject) { + self.jsObject = jsObject } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } } public class WheelEvent: MouseEvent { @@ -18348,6 +19966,18 @@ public enum console { @usableFromInline static let VideoFrame: JSString = "VideoFrame" @usableFromInline static let VideoTrack: JSString = "VideoTrack" @usableFromInline static let VideoTrackList: JSString = "VideoTrackList" + @usableFromInline static let WebGLActiveInfo: JSString = "WebGLActiveInfo" + @usableFromInline static let WebGLBuffer: JSString = "WebGLBuffer" + @usableFromInline static let WebGLContextEvent: JSString = "WebGLContextEvent" + @usableFromInline static let WebGLFramebuffer: JSString = "WebGLFramebuffer" + @usableFromInline static let WebGLObject: JSString = "WebGLObject" + @usableFromInline static let WebGLProgram: JSString = "WebGLProgram" + @usableFromInline static let WebGLRenderbuffer: JSString = "WebGLRenderbuffer" + @usableFromInline static let WebGLRenderingContext: JSString = "WebGLRenderingContext" + @usableFromInline static let WebGLShader: JSString = "WebGLShader" + @usableFromInline static let WebGLShaderPrecisionFormat: JSString = "WebGLShaderPrecisionFormat" + @usableFromInline static let WebGLTexture: JSString = "WebGLTexture" + @usableFromInline static let WebGLUniformLocation: JSString = "WebGLUniformLocation" @usableFromInline static let WheelEvent: JSString = "WheelEvent" @usableFromInline static let Window: JSString = "Window" @usableFromInline static let Worker: JSString = "Worker" @@ -18376,6 +20006,7 @@ public enum console { @usableFromInline static let active: JSString = "active" @usableFromInline static let activeCues: JSString = "activeCues" @usableFromInline static let activeElement: JSString = "activeElement" + @usableFromInline static let activeTexture: JSString = "activeTexture" @usableFromInline static let actualBoundingBoxAscent: JSString = "actualBoundingBoxAscent" @usableFromInline static let actualBoundingBoxDescent: JSString = "actualBoundingBoxDescent" @usableFromInline static let actualBoundingBoxLeft: JSString = "actualBoundingBoxLeft" @@ -18408,6 +20039,7 @@ public enum console { @usableFromInline static let anchors: JSString = "anchors" @usableFromInline static let animate: JSString = "animate" @usableFromInline static let animated: JSString = "animated" + @usableFromInline static let antialias: JSString = "antialias" @usableFromInline static let appCodeName: JSString = "appCodeName" @usableFromInline static let appName: JSString = "appName" @usableFromInline static let appVersion: JSString = "appVersion" @@ -18471,6 +20103,7 @@ public enum console { @usableFromInline static let async: JSString = "async" @usableFromInline static let atob: JSString = "atob" @usableFromInline static let attachInternals: JSString = "attachInternals" + @usableFromInline static let attachShader: JSString = "attachShader" @usableFromInline static let attachShadow: JSString = "attachShadow" @usableFromInline static let attrChange: JSString = "attrChange" @usableFromInline static let attrName: JSString = "attrName" @@ -18500,9 +20133,19 @@ public enum console { @usableFromInline static let behavior: JSString = "behavior" @usableFromInline static let bezierCurveTo: JSString = "bezierCurveTo" @usableFromInline static let bgColor: JSString = "bgColor" + @usableFromInline static let bindAttribLocation: JSString = "bindAttribLocation" + @usableFromInline static let bindBuffer: JSString = "bindBuffer" + @usableFromInline static let bindFramebuffer: JSString = "bindFramebuffer" + @usableFromInline static let bindRenderbuffer: JSString = "bindRenderbuffer" + @usableFromInline static let bindTexture: JSString = "bindTexture" @usableFromInline static let bitrate: JSString = "bitrate" @usableFromInline static let bitrateMode: JSString = "bitrateMode" @usableFromInline static let bitsPerSecond: JSString = "bitsPerSecond" + @usableFromInline static let blendColor: JSString = "blendColor" + @usableFromInline static let blendEquation: JSString = "blendEquation" + @usableFromInline static let blendEquationSeparate: JSString = "blendEquationSeparate" + @usableFromInline static let blendFunc: JSString = "blendFunc" + @usableFromInline static let blendFuncSeparate: JSString = "blendFuncSeparate" @usableFromInline static let blob: JSString = "blob" @usableFromInline static let blocking: JSString = "blocking" @usableFromInline static let blur: JSString = "blur" @@ -18513,6 +20156,8 @@ public enum console { @usableFromInline static let bottom: JSString = "bottom" @usableFromInline static let btoa: JSString = "btoa" @usableFromInline static let bubbles: JSString = "bubbles" + @usableFromInline static let bufferData: JSString = "bufferData" + @usableFromInline static let bufferSubData: JSString = "bufferSubData" @usableFromInline static let buffered: JSString = "buffered" @usableFromInline static let button: JSString = "button" @usableFromInline static let buttons: JSString = "buttons" @@ -18543,6 +20188,7 @@ public enum console { @usableFromInline static let characterDataOldValue: JSString = "characterDataOldValue" @usableFromInline static let characterSet: JSString = "characterSet" @usableFromInline static let charset: JSString = "charset" + @usableFromInline static let checkFramebufferStatus: JSString = "checkFramebufferStatus" @usableFromInline static let checkValidity: JSString = "checkValidity" @usableFromInline static let checked: JSString = "checked" @usableFromInline static let childElementCount: JSString = "childElementCount" @@ -18553,10 +20199,13 @@ public enum console { @usableFromInline static let classList: JSString = "classList" @usableFromInline static let className: JSString = "className" @usableFromInline static let clear: JSString = "clear" + @usableFromInline static let clearColor: JSString = "clearColor" @usableFromInline static let clearData: JSString = "clearData" + @usableFromInline static let clearDepth: JSString = "clearDepth" @usableFromInline static let clearInterval: JSString = "clearInterval" @usableFromInline static let clearParameters: JSString = "clearParameters" @usableFromInline static let clearRect: JSString = "clearRect" + @usableFromInline static let clearStencil: JSString = "clearStencil" @usableFromInline static let clearTimeout: JSString = "clearTimeout" @usableFromInline static let click: JSString = "click" @usableFromInline static let clientId: JSString = "clientId" @@ -18584,6 +20233,7 @@ public enum console { @usableFromInline static let collapsed: JSString = "collapsed" @usableFromInline static let colno: JSString = "colno" @usableFromInline static let color: JSString = "color" + @usableFromInline static let colorMask: JSString = "colorMask" @usableFromInline static let colorSpace: JSString = "colorSpace" @usableFromInline static let colorSpaceConversion: JSString = "colorSpaceConversion" @usableFromInline static let cols: JSString = "cols" @@ -18595,12 +20245,15 @@ public enum console { @usableFromInline static let compareDocumentPosition: JSString = "compareDocumentPosition" @usableFromInline static let comparePoint: JSString = "comparePoint" @usableFromInline static let compatMode: JSString = "compatMode" + @usableFromInline static let compileShader: JSString = "compileShader" @usableFromInline static let complete: JSString = "complete" @usableFromInline static let completeFramesOnly: JSString = "completeFramesOnly" @usableFromInline static let completed: JSString = "completed" @usableFromInline static let composed: JSString = "composed" @usableFromInline static let composedPath: JSString = "composedPath" @usableFromInline static let composite: JSString = "composite" + @usableFromInline static let compressedTexImage2D: JSString = "compressedTexImage2D" + @usableFromInline static let compressedTexSubImage2D: JSString = "compressedTexSubImage2D" @usableFromInline static let computedOffset: JSString = "computedOffset" @usableFromInline static let config: JSString = "config" @usableFromInline static let configure: JSString = "configure" @@ -18620,11 +20273,14 @@ public enum console { @usableFromInline static let cookie: JSString = "cookie" @usableFromInline static let cookieEnabled: JSString = "cookieEnabled" @usableFromInline static let coords: JSString = "coords" + @usableFromInline static let copyTexImage2D: JSString = "copyTexImage2D" + @usableFromInline static let copyTexSubImage2D: JSString = "copyTexSubImage2D" @usableFromInline static let copyTo: JSString = "copyTo" @usableFromInline static let count: JSString = "count" @usableFromInline static let countReset: JSString = "countReset" @usableFromInline static let createAttribute: JSString = "createAttribute" @usableFromInline static let createAttributeNS: JSString = "createAttributeNS" + @usableFromInline static let createBuffer: JSString = "createBuffer" @usableFromInline static let createCDATASection: JSString = "createCDATASection" @usableFromInline static let createCaption: JSString = "createCaption" @usableFromInline static let createComment: JSString = "createComment" @@ -18635,6 +20291,7 @@ public enum console { @usableFromInline static let createElement: JSString = "createElement" @usableFromInline static let createElementNS: JSString = "createElementNS" @usableFromInline static let createEvent: JSString = "createEvent" + @usableFromInline static let createFramebuffer: JSString = "createFramebuffer" @usableFromInline static let createHTMLDocument: JSString = "createHTMLDocument" @usableFromInline static let createImageBitmap: JSString = "createImageBitmap" @usableFromInline static let createImageData: JSString = "createImageData" @@ -18642,17 +20299,22 @@ public enum console { @usableFromInline static let createObjectURL: JSString = "createObjectURL" @usableFromInline static let createPattern: JSString = "createPattern" @usableFromInline static let createProcessingInstruction: JSString = "createProcessingInstruction" + @usableFromInline static let createProgram: JSString = "createProgram" @usableFromInline static let createRadialGradient: JSString = "createRadialGradient" @usableFromInline static let createRange: JSString = "createRange" + @usableFromInline static let createRenderbuffer: JSString = "createRenderbuffer" + @usableFromInline static let createShader: JSString = "createShader" @usableFromInline static let createTBody: JSString = "createTBody" @usableFromInline static let createTFoot: JSString = "createTFoot" @usableFromInline static let createTHead: JSString = "createTHead" @usableFromInline static let createTextNode: JSString = "createTextNode" + @usableFromInline static let createTexture: JSString = "createTexture" @usableFromInline static let credentials: JSString = "credentials" @usableFromInline static let crossOrigin: JSString = "crossOrigin" @usableFromInline static let crossOriginIsolated: JSString = "crossOriginIsolated" @usableFromInline static let ctrlKey: JSString = "ctrlKey" @usableFromInline static let cues: JSString = "cues" + @usableFromInline static let cullFace: JSString = "cullFace" @usableFromInline static let currentIteration: JSString = "currentIteration" @usableFromInline static let currentNode: JSString = "currentNode" @usableFromInline static let currentScript: JSString = "currentScript" @@ -18685,17 +20347,27 @@ public enum console { @usableFromInline static let delay: JSString = "delay" @usableFromInline static let delegatesFocus: JSString = "delegatesFocus" @usableFromInline static let delete: JSString = "delete" + @usableFromInline static let deleteBuffer: JSString = "deleteBuffer" @usableFromInline static let deleteCaption: JSString = "deleteCaption" @usableFromInline static let deleteCell: JSString = "deleteCell" @usableFromInline static let deleteContents: JSString = "deleteContents" @usableFromInline static let deleteData: JSString = "deleteData" + @usableFromInline static let deleteFramebuffer: JSString = "deleteFramebuffer" + @usableFromInline static let deleteProgram: JSString = "deleteProgram" + @usableFromInline static let deleteRenderbuffer: JSString = "deleteRenderbuffer" @usableFromInline static let deleteRow: JSString = "deleteRow" + @usableFromInline static let deleteShader: JSString = "deleteShader" @usableFromInline static let deleteTFoot: JSString = "deleteTFoot" @usableFromInline static let deleteTHead: JSString = "deleteTHead" + @usableFromInline static let deleteTexture: JSString = "deleteTexture" @usableFromInline static let deltaMode: JSString = "deltaMode" @usableFromInline static let deltaX: JSString = "deltaX" @usableFromInline static let deltaY: JSString = "deltaY" @usableFromInline static let deltaZ: JSString = "deltaZ" + @usableFromInline static let depth: JSString = "depth" + @usableFromInline static let depthFunc: JSString = "depthFunc" + @usableFromInline static let depthMask: JSString = "depthMask" + @usableFromInline static let depthRange: JSString = "depthRange" @usableFromInline static let description: JSString = "description" @usableFromInline static let designMode: JSString = "designMode" @usableFromInline static let desiredHeight: JSString = "desiredHeight" @@ -18704,6 +20376,7 @@ public enum console { @usableFromInline static let destination: JSString = "destination" @usableFromInline static let desynchronized: JSString = "desynchronized" @usableFromInline static let detach: JSString = "detach" + @usableFromInline static let detachShader: JSString = "detachShader" @usableFromInline static let detail: JSString = "detail" @usableFromInline static let deviceId: JSString = "deviceId" @usableFromInline static let dir: JSString = "dir" @@ -18711,6 +20384,7 @@ public enum console { @usableFromInline static let direction: JSString = "direction" @usableFromInline static let dirxml: JSString = "dirxml" @usableFromInline static let disable: JSString = "disable" + @usableFromInline static let disableVertexAttribArray: JSString = "disableVertexAttribArray" @usableFromInline static let disabled: JSString = "disabled" @usableFromInline static let disconnect: JSString = "disconnect" @usableFromInline static let dispatchEvent: JSString = "dispatchEvent" @@ -18726,8 +20400,12 @@ public enum console { @usableFromInline static let done: JSString = "done" @usableFromInline static let download: JSString = "download" @usableFromInline static let draggable: JSString = "draggable" + @usableFromInline static let drawArrays: JSString = "drawArrays" + @usableFromInline static let drawElements: JSString = "drawElements" @usableFromInline static let drawFocusIfNeeded: JSString = "drawFocusIfNeeded" @usableFromInline static let drawImage: JSString = "drawImage" + @usableFromInline static let drawingBufferHeight: JSString = "drawingBufferHeight" + @usableFromInline static let drawingBufferWidth: JSString = "drawingBufferWidth" @usableFromInline static let dropEffect: JSString = "dropEffect" @usableFromInline static let duration: JSString = "duration" @usableFromInline static let e: JSString = "e" @@ -18741,6 +20419,7 @@ public enum console { @usableFromInline static let emHeightDescent: JSString = "emHeightDescent" @usableFromInline static let embeds: JSString = "embeds" @usableFromInline static let enable: JSString = "enable" + @usableFromInline static let enableVertexAttribArray: JSString = "enableVertexAttribArray" @usableFromInline static let enabled: JSString = "enabled" @usableFromInline static let enabledPlugin: JSString = "enabledPlugin" @usableFromInline static let encode: JSString = "encode" @@ -18769,6 +20448,7 @@ public enum console { @usableFromInline static let f: JSString = "f" @usableFromInline static let face: JSString = "face" @usableFromInline static let facingMode: JSString = "facingMode" + @usableFromInline static let failIfMajorPerformanceCaveat: JSString = "failIfMajorPerformanceCaveat" @usableFromInline static let fastSeek: JSString = "fastSeek" @usableFromInline static let fetch: JSString = "fetch" @usableFromInline static let fgColor: JSString = "fgColor" @@ -18811,6 +20491,8 @@ public enum console { @usableFromInline static let frameIndex: JSString = "frameIndex" @usableFromInline static let frameOffset: JSString = "frameOffset" @usableFromInline static let frameRate: JSString = "frameRate" + @usableFromInline static let framebufferRenderbuffer: JSString = "framebufferRenderbuffer" + @usableFromInline static let framebufferTexture2D: JSString = "framebufferTexture2D" @usableFromInline static let framerate: JSString = "framerate" @usableFromInline static let frames: JSString = "frames" @usableFromInline static let fromFloat32Array: JSString = "fromFloat32Array" @@ -18819,12 +20501,18 @@ public enum console { @usableFromInline static let fromPoint: JSString = "fromPoint" @usableFromInline static let fromQuad: JSString = "fromQuad" @usableFromInline static let fromRect: JSString = "fromRect" + @usableFromInline static let frontFace: JSString = "frontFace" @usableFromInline static let fullRange: JSString = "fullRange" + @usableFromInline static let generateMipmap: JSString = "generateMipmap" @usableFromInline static let get: JSString = "get" + @usableFromInline static let getActiveAttrib: JSString = "getActiveAttrib" + @usableFromInline static let getActiveUniform: JSString = "getActiveUniform" @usableFromInline static let getAll: JSString = "getAll" @usableFromInline static let getAllResponseHeaders: JSString = "getAllResponseHeaders" @usableFromInline static let getAnimations: JSString = "getAnimations" @usableFromInline static let getAsFile: JSString = "getAsFile" + @usableFromInline static let getAttachedShaders: JSString = "getAttachedShaders" + @usableFromInline static let getAttribLocation: JSString = "getAttribLocation" @usableFromInline static let getAttribute: JSString = "getAttribute" @usableFromInline static let getAttributeNS: JSString = "getAttributeNS" @usableFromInline static let getAttributeNames: JSString = "getAttributeNames" @@ -18832,6 +20520,7 @@ public enum console { @usableFromInline static let getAttributeNodeNS: JSString = "getAttributeNodeNS" @usableFromInline static let getAudioTracks: JSString = "getAudioTracks" @usableFromInline static let getBounds: JSString = "getBounds" + @usableFromInline static let getBufferParameter: JSString = "getBufferParameter" @usableFromInline static let getCapabilities: JSString = "getCapabilities" @usableFromInline static let getComputedTiming: JSString = "getComputedTiming" @usableFromInline static let getConstraints: JSString = "getConstraints" @@ -18844,27 +20533,43 @@ public enum console { @usableFromInline static let getElementsByName: JSString = "getElementsByName" @usableFromInline static let getElementsByTagName: JSString = "getElementsByTagName" @usableFromInline static let getElementsByTagNameNS: JSString = "getElementsByTagNameNS" + @usableFromInline static let getError: JSString = "getError" + @usableFromInline static let getExtension: JSString = "getExtension" + @usableFromInline static let getFramebufferAttachmentParameter: JSString = "getFramebufferAttachmentParameter" @usableFromInline static let getImageData: JSString = "getImageData" @usableFromInline static let getKeyframes: JSString = "getKeyframes" @usableFromInline static let getLineDash: JSString = "getLineDash" @usableFromInline static let getModifierState: JSString = "getModifierState" @usableFromInline static let getNamedItemNS: JSString = "getNamedItemNS" @usableFromInline static let getParameter: JSString = "getParameter" + @usableFromInline static let getProgramInfoLog: JSString = "getProgramInfoLog" + @usableFromInline static let getProgramParameter: JSString = "getProgramParameter" @usableFromInline static let getReader: JSString = "getReader" @usableFromInline static let getRegistration: JSString = "getRegistration" @usableFromInline static let getRegistrations: JSString = "getRegistrations" + @usableFromInline static let getRenderbufferParameter: JSString = "getRenderbufferParameter" @usableFromInline static let getResponseHeader: JSString = "getResponseHeader" @usableFromInline static let getRootNode: JSString = "getRootNode" @usableFromInline static let getSVGDocument: JSString = "getSVGDocument" @usableFromInline static let getSettings: JSString = "getSettings" + @usableFromInline static let getShaderInfoLog: JSString = "getShaderInfoLog" + @usableFromInline static let getShaderParameter: JSString = "getShaderParameter" + @usableFromInline static let getShaderPrecisionFormat: JSString = "getShaderPrecisionFormat" + @usableFromInline static let getShaderSource: JSString = "getShaderSource" @usableFromInline static let getStartDate: JSString = "getStartDate" @usableFromInline static let getState: JSString = "getState" @usableFromInline static let getSupportedConstraints: JSString = "getSupportedConstraints" + @usableFromInline static let getSupportedExtensions: JSString = "getSupportedExtensions" + @usableFromInline static let getTexParameter: JSString = "getTexParameter" @usableFromInline static let getTiming: JSString = "getTiming" @usableFromInline static let getTrackById: JSString = "getTrackById" @usableFromInline static let getTracks: JSString = "getTracks" @usableFromInline static let getTransform: JSString = "getTransform" + @usableFromInline static let getUniform: JSString = "getUniform" + @usableFromInline static let getUniformLocation: JSString = "getUniformLocation" @usableFromInline static let getUserMedia: JSString = "getUserMedia" + @usableFromInline static let getVertexAttrib: JSString = "getVertexAttrib" + @usableFromInline static let getVertexAttribOffset: JSString = "getVertexAttribOffset" @usableFromInline static let getVideoTracks: JSString = "getVideoTracks" @usableFromInline static let getWriter: JSString = "getWriter" @usableFromInline static let globalAlpha: JSString = "globalAlpha" @@ -18893,6 +20598,7 @@ public enum console { @usableFromInline static let hidden: JSString = "hidden" @usableFromInline static let high: JSString = "high" @usableFromInline static let highWaterMark: JSString = "highWaterMark" + @usableFromInline static let hint: JSString = "hint" @usableFromInline static let history: JSString = "history" @usableFromInline static let host: JSString = "host" @usableFromInline static let hostname: JSString = "hostname" @@ -18951,22 +20657,29 @@ public enum console { @usableFromInline static let invertSelf: JSString = "invertSelf" @usableFromInline static let `is`: JSString = "is" @usableFromInline static let is2D: JSString = "is2D" + @usableFromInline static let isBuffer: JSString = "isBuffer" @usableFromInline static let isComposing: JSString = "isComposing" @usableFromInline static let isConfigSupported: JSString = "isConfigSupported" @usableFromInline static let isConnected: JSString = "isConnected" @usableFromInline static let isContentEditable: JSString = "isContentEditable" @usableFromInline static let isContextLost: JSString = "isContextLost" @usableFromInline static let isDefaultNamespace: JSString = "isDefaultNamespace" + @usableFromInline static let isEnabled: JSString = "isEnabled" @usableFromInline static let isEqualNode: JSString = "isEqualNode" + @usableFromInline static let isFramebuffer: JSString = "isFramebuffer" @usableFromInline static let isHistoryNavigation: JSString = "isHistoryNavigation" @usableFromInline static let isIdentity: JSString = "isIdentity" @usableFromInline static let isMap: JSString = "isMap" @usableFromInline static let isPointInPath: JSString = "isPointInPath" @usableFromInline static let isPointInRange: JSString = "isPointInRange" @usableFromInline static let isPointInStroke: JSString = "isPointInStroke" + @usableFromInline static let isProgram: JSString = "isProgram" @usableFromInline static let isReloadNavigation: JSString = "isReloadNavigation" + @usableFromInline static let isRenderbuffer: JSString = "isRenderbuffer" @usableFromInline static let isSameNode: JSString = "isSameNode" @usableFromInline static let isSecureContext: JSString = "isSecureContext" + @usableFromInline static let isShader: JSString = "isShader" + @usableFromInline static let isTexture: JSString = "isTexture" @usableFromInline static let isTrusted: JSString = "isTrusted" @usableFromInline static let isTypeSupported: JSString = "isTypeSupported" @usableFromInline static let item: JSString = "item" @@ -19006,6 +20719,7 @@ public enum console { @usableFromInline static let lineno: JSString = "lineno" @usableFromInline static let link: JSString = "link" @usableFromInline static let linkColor: JSString = "linkColor" + @usableFromInline static let linkProgram: JSString = "linkProgram" @usableFromInline static let links: JSString = "links" @usableFromInline static let list: JSString = "list" @usableFromInline static let load: JSString = "load" @@ -19261,6 +20975,7 @@ public enum console { @usableFromInline static let ping: JSString = "ping" @usableFromInline static let pipeThrough: JSString = "pipeThrough" @usableFromInline static let pipeTo: JSString = "pipeTo" + @usableFromInline static let pixelStorei: JSString = "pixelStorei" @usableFromInline static let placeholder: JSString = "placeholder" @usableFromInline static let planeIndex: JSString = "planeIndex" @usableFromInline static let platform: JSString = "platform" @@ -19271,6 +20986,7 @@ public enum console { @usableFromInline static let playsInline: JSString = "playsInline" @usableFromInline static let plugins: JSString = "plugins" @usableFromInline static let pointerBeforeReferenceNode: JSString = "pointerBeforeReferenceNode" + @usableFromInline static let polygonOffset: JSString = "polygonOffset" @usableFromInline static let port: JSString = "port" @usableFromInline static let port1: JSString = "port1" @usableFromInline static let port2: JSString = "port2" @@ -19278,13 +20994,17 @@ public enum console { @usableFromInline static let position: JSString = "position" @usableFromInline static let postMessage: JSString = "postMessage" @usableFromInline static let poster: JSString = "poster" + @usableFromInline static let powerPreference: JSString = "powerPreference" @usableFromInline static let preMultiplySelf: JSString = "preMultiplySelf" + @usableFromInline static let precision: JSString = "precision" @usableFromInline static let preferAnimation: JSString = "preferAnimation" @usableFromInline static let prefix: JSString = "prefix" @usableFromInline static let preload: JSString = "preload" @usableFromInline static let preloadResponse: JSString = "preloadResponse" + @usableFromInline static let premultipliedAlpha: JSString = "premultipliedAlpha" @usableFromInline static let premultiplyAlpha: JSString = "premultiplyAlpha" @usableFromInline static let prepend: JSString = "prepend" + @usableFromInline static let preserveDrawingBuffer: JSString = "preserveDrawingBuffer" @usableFromInline static let preservesPitch: JSString = "preservesPitch" @usableFromInline static let prevValue: JSString = "prevValue" @usableFromInline static let preventAbort: JSString = "preventAbort" @@ -19318,6 +21038,8 @@ public enum console { @usableFromInline static let queryCommandValue: JSString = "queryCommandValue" @usableFromInline static let querySelector: JSString = "querySelector" @usableFromInline static let querySelectorAll: JSString = "querySelectorAll" + @usableFromInline static let rangeMax: JSString = "rangeMax" + @usableFromInline static let rangeMin: JSString = "rangeMin" @usableFromInline static let rangeOverflow: JSString = "rangeOverflow" @usableFromInline static let rangeUnderflow: JSString = "rangeUnderflow" @usableFromInline static let read: JSString = "read" @@ -19326,6 +21048,7 @@ public enum console { @usableFromInline static let readAsDataURL: JSString = "readAsDataURL" @usableFromInline static let readAsText: JSString = "readAsText" @usableFromInline static let readOnly: JSString = "readOnly" + @usableFromInline static let readPixels: JSString = "readPixels" @usableFromInline static let readable: JSString = "readable" @usableFromInline static let readableType: JSString = "readableType" @usableFromInline static let ready: JSString = "ready" @@ -19358,6 +21081,7 @@ public enum console { @usableFromInline static let removeParameter: JSString = "removeParameter" @usableFromInline static let removeTrack: JSString = "removeTrack" @usableFromInline static let removedNodes: JSString = "removedNodes" + @usableFromInline static let renderbufferStorage: JSString = "renderbufferStorage" @usableFromInline static let `repeat`: JSString = "repeat" @usableFromInline static let repetitionCount: JSString = "repetitionCount" @usableFromInline static let replace: JSString = "replace" @@ -19410,6 +21134,7 @@ public enum console { @usableFromInline static let rowSpan: JSString = "rowSpan" @usableFromInline static let rows: JSString = "rows" @usableFromInline static let rules: JSString = "rules" + @usableFromInline static let sampleCoverage: JSString = "sampleCoverage" @usableFromInline static let sampleRate: JSString = "sampleRate" @usableFromInline static let sampleSize: JSString = "sampleSize" @usableFromInline static let sandbox: JSString = "sandbox" @@ -19421,6 +21146,7 @@ public enum console { @usableFromInline static let scaleNonUniform: JSString = "scaleNonUniform" @usableFromInline static let scaleSelf: JSString = "scaleSelf" @usableFromInline static let scheme: JSString = "scheme" + @usableFromInline static let scissor: JSString = "scissor" @usableFromInline static let scope: JSString = "scope" @usableFromInline static let screenX: JSString = "screenX" @usableFromInline static let screenY: JSString = "screenY" @@ -19479,6 +21205,7 @@ public enum console { @usableFromInline static let setTimeout: JSString = "setTimeout" @usableFromInline static let setTransform: JSString = "setTransform" @usableFromInline static let setValidity: JSString = "setValidity" + @usableFromInline static let shaderSource: JSString = "shaderSource" @usableFromInline static let shadowBlur: JSString = "shadowBlur" @usableFromInline static let shadowColor: JSString = "shadowColor" @usableFromInline static let shadowOffsetX: JSString = "shadowOffsetX" @@ -19521,8 +21248,16 @@ public enum console { @usableFromInline static let startTime: JSString = "startTime" @usableFromInline static let state: JSString = "state" @usableFromInline static let status: JSString = "status" + @usableFromInline static let statusMessage: JSString = "statusMessage" @usableFromInline static let statusText: JSString = "statusText" @usableFromInline static let statusbar: JSString = "statusbar" + @usableFromInline static let stencil: JSString = "stencil" + @usableFromInline static let stencilFunc: JSString = "stencilFunc" + @usableFromInline static let stencilFuncSeparate: JSString = "stencilFuncSeparate" + @usableFromInline static let stencilMask: JSString = "stencilMask" + @usableFromInline static let stencilMaskSeparate: JSString = "stencilMaskSeparate" + @usableFromInline static let stencilOp: JSString = "stencilOp" + @usableFromInline static let stencilOpSeparate: JSString = "stencilOpSeparate" @usableFromInline static let step: JSString = "step" @usableFromInline static let stepDown: JSString = "stepDown" @usableFromInline static let stepMismatch: JSString = "stepMismatch" @@ -19563,6 +21298,10 @@ public enum console { @usableFromInline static let tee: JSString = "tee" @usableFromInline static let temporalLayerId: JSString = "temporalLayerId" @usableFromInline static let terminate: JSString = "terminate" + @usableFromInline static let texImage2D: JSString = "texImage2D" + @usableFromInline static let texParameterf: JSString = "texParameterf" + @usableFromInline static let texParameteri: JSString = "texParameteri" + @usableFromInline static let texSubImage2D: JSString = "texSubImage2D" @usableFromInline static let text: JSString = "text" @usableFromInline static let textAlign: JSString = "textAlign" @usableFromInline static let textBaseline: JSString = "textBaseline" @@ -19610,6 +21349,25 @@ public enum console { @usableFromInline static let type: JSString = "type" @usableFromInline static let typeMismatch: JSString = "typeMismatch" @usableFromInline static let types: JSString = "types" + @usableFromInline static let uniform1f: JSString = "uniform1f" + @usableFromInline static let uniform1fv: JSString = "uniform1fv" + @usableFromInline static let uniform1i: JSString = "uniform1i" + @usableFromInline static let uniform1iv: JSString = "uniform1iv" + @usableFromInline static let uniform2f: JSString = "uniform2f" + @usableFromInline static let uniform2fv: JSString = "uniform2fv" + @usableFromInline static let uniform2i: JSString = "uniform2i" + @usableFromInline static let uniform2iv: JSString = "uniform2iv" + @usableFromInline static let uniform3f: JSString = "uniform3f" + @usableFromInline static let uniform3fv: JSString = "uniform3fv" + @usableFromInline static let uniform3i: JSString = "uniform3i" + @usableFromInline static let uniform3iv: JSString = "uniform3iv" + @usableFromInline static let uniform4f: JSString = "uniform4f" + @usableFromInline static let uniform4fv: JSString = "uniform4fv" + @usableFromInline static let uniform4i: JSString = "uniform4i" + @usableFromInline static let uniform4iv: JSString = "uniform4iv" + @usableFromInline static let uniformMatrix2fv: JSString = "uniformMatrix2fv" + @usableFromInline static let uniformMatrix3fv: JSString = "uniformMatrix3fv" + @usableFromInline static let uniformMatrix4fv: JSString = "uniformMatrix4fv" @usableFromInline static let unregister: JSString = "unregister" @usableFromInline static let unregisterProtocolHandler: JSString = "unregisterProtocolHandler" @usableFromInline static let update: JSString = "update" @@ -19620,11 +21378,13 @@ public enum console { @usableFromInline static let upload: JSString = "upload" @usableFromInline static let url: JSString = "url" @usableFromInline static let useMap: JSString = "useMap" + @usableFromInline static let useProgram: JSString = "useProgram" @usableFromInline static let userAgent: JSString = "userAgent" @usableFromInline static let username: JSString = "username" @usableFromInline static let vAlign: JSString = "vAlign" @usableFromInline static let vLink: JSString = "vLink" @usableFromInline static let valid: JSString = "valid" + @usableFromInline static let validateProgram: JSString = "validateProgram" @usableFromInline static let validationMessage: JSString = "validationMessage" @usableFromInline static let validity: JSString = "validity" @usableFromInline static let value: JSString = "value" @@ -19635,12 +21395,22 @@ public enum console { @usableFromInline static let vendor: JSString = "vendor" @usableFromInline static let vendorSub: JSString = "vendorSub" @usableFromInline static let version: JSString = "version" + @usableFromInline static let vertexAttrib1f: JSString = "vertexAttrib1f" + @usableFromInline static let vertexAttrib1fv: JSString = "vertexAttrib1fv" + @usableFromInline static let vertexAttrib2f: JSString = "vertexAttrib2f" + @usableFromInline static let vertexAttrib2fv: JSString = "vertexAttrib2fv" + @usableFromInline static let vertexAttrib3f: JSString = "vertexAttrib3f" + @usableFromInline static let vertexAttrib3fv: JSString = "vertexAttrib3fv" + @usableFromInline static let vertexAttrib4f: JSString = "vertexAttrib4f" + @usableFromInline static let vertexAttrib4fv: JSString = "vertexAttrib4fv" + @usableFromInline static let vertexAttribPointer: JSString = "vertexAttribPointer" @usableFromInline static let video: JSString = "video" @usableFromInline static let videoBitsPerSecond: JSString = "videoBitsPerSecond" @usableFromInline static let videoHeight: JSString = "videoHeight" @usableFromInline static let videoTracks: JSString = "videoTracks" @usableFromInline static let videoWidth: JSString = "videoWidth" @usableFromInline static let view: JSString = "view" + @usableFromInline static let viewport: JSString = "viewport" @usableFromInline static let visibilityState: JSString = "visibilityState" @usableFromInline static let visible: JSString = "visible" @usableFromInline static let visibleRect: JSString = "visibleRect" @@ -20805,6 +22575,48 @@ public enum File_or_FormData_or_String: JSValueCompatible, Any_File_or_FormData_ } } +public protocol Any_Float32List: ConvertibleToJSValue {} +extension Float32Array: Any_Float32List {} +extension Array: Any_Float32List where Element == GLfloat {} + +public enum Float32List: JSValueCompatible, Any_Float32List { + case float32Array(Float32Array) + case seq_of_GLfloat([GLfloat]) + + var float32Array: Float32Array? { + switch self { + case let .float32Array(float32Array): return float32Array + default: return nil + } + } + + var seq_of_GLfloat: [GLfloat]? { + switch self { + case let .seq_of_GLfloat(seq_of_GLfloat): return seq_of_GLfloat + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let float32Array: Float32Array = value.fromJSValue() { + return .float32Array(float32Array) + } + if let seq_of_GLfloat: [GLfloat] = value.fromJSValue() { + return .seq_of_GLfloat(seq_of_GLfloat) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .float32Array(float32Array): + return float32Array.jsValue + case let .seq_of_GLfloat(seq_of_GLfloat): + return seq_of_GLfloat.jsValue + } + } +} + public protocol Any_FormDataEntryValue: ConvertibleToJSValue {} extension File: Any_FormDataEntryValue {} extension String: Any_FormDataEntryValue {} @@ -21113,6 +22925,48 @@ public enum ImageBufferSource: JSValueCompatible, Any_ImageBufferSource { } } +public protocol Any_Int32List: ConvertibleToJSValue {} +extension Int32Array: Any_Int32List {} +extension Array: Any_Int32List where Element == GLint {} + +public enum Int32List: JSValueCompatible, Any_Int32List { + case int32Array(Int32Array) + case seq_of_GLint([GLint]) + + var int32Array: Int32Array? { + switch self { + case let .int32Array(int32Array): return int32Array + default: return nil + } + } + + var seq_of_GLint: [GLint]? { + switch self { + case let .seq_of_GLint(seq_of_GLint): return seq_of_GLint + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let int32Array: Int32Array = value.fromJSValue() { + return .int32Array(int32Array) + } + if let seq_of_GLint: [GLint] = value.fromJSValue() { + return .seq_of_GLint(seq_of_GLint) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .int32Array(int32Array): + return int32Array.jsValue + case let .seq_of_GLint(seq_of_GLint): + return seq_of_GLint.jsValue + } + } +} + public protocol Any_MessageEventSource: ConvertibleToJSValue {} extension MessagePort: Any_MessageEventSource {} extension ServiceWorker: Any_MessageEventSource {} @@ -21561,6 +23415,118 @@ public enum String_or_seq_of_String: JSValueCompatible, Any_String_or_seq_of_Str } } +public protocol Any_TexImageSource: ConvertibleToJSValue {} +extension HTMLCanvasElement: Any_TexImageSource {} +extension HTMLImageElement: Any_TexImageSource {} +extension HTMLVideoElement: Any_TexImageSource {} +extension ImageBitmap: Any_TexImageSource {} +extension ImageData: Any_TexImageSource {} +extension OffscreenCanvas: Any_TexImageSource {} +extension VideoFrame: Any_TexImageSource {} + +public enum TexImageSource: JSValueCompatible, Any_TexImageSource { + case htmlCanvasElement(HTMLCanvasElement) + case htmlImageElement(HTMLImageElement) + case htmlVideoElement(HTMLVideoElement) + case imageBitmap(ImageBitmap) + case imageData(ImageData) + case offscreenCanvas(OffscreenCanvas) + case videoFrame(VideoFrame) + + var htmlCanvasElement: HTMLCanvasElement? { + switch self { + case let .htmlCanvasElement(htmlCanvasElement): return htmlCanvasElement + default: return nil + } + } + + var htmlImageElement: HTMLImageElement? { + switch self { + case let .htmlImageElement(htmlImageElement): return htmlImageElement + default: return nil + } + } + + var htmlVideoElement: HTMLVideoElement? { + switch self { + case let .htmlVideoElement(htmlVideoElement): return htmlVideoElement + default: return nil + } + } + + var imageBitmap: ImageBitmap? { + switch self { + case let .imageBitmap(imageBitmap): return imageBitmap + default: return nil + } + } + + var imageData: ImageData? { + switch self { + case let .imageData(imageData): return imageData + default: return nil + } + } + + var offscreenCanvas: OffscreenCanvas? { + switch self { + case let .offscreenCanvas(offscreenCanvas): return offscreenCanvas + default: return nil + } + } + + var videoFrame: VideoFrame? { + switch self { + case let .videoFrame(videoFrame): return videoFrame + default: return nil + } + } + + public static func construct(from value: JSValue) -> Self? { + if let htmlCanvasElement: HTMLCanvasElement = value.fromJSValue() { + return .htmlCanvasElement(htmlCanvasElement) + } + if let htmlImageElement: HTMLImageElement = value.fromJSValue() { + return .htmlImageElement(htmlImageElement) + } + if let htmlVideoElement: HTMLVideoElement = value.fromJSValue() { + return .htmlVideoElement(htmlVideoElement) + } + if let imageBitmap: ImageBitmap = value.fromJSValue() { + return .imageBitmap(imageBitmap) + } + if let imageData: ImageData = value.fromJSValue() { + return .imageData(imageData) + } + if let offscreenCanvas: OffscreenCanvas = value.fromJSValue() { + return .offscreenCanvas(offscreenCanvas) + } + if let videoFrame: VideoFrame = value.fromJSValue() { + return .videoFrame(videoFrame) + } + return nil + } + + public var jsValue: JSValue { + switch self { + case let .htmlCanvasElement(htmlCanvasElement): + return htmlCanvasElement.jsValue + case let .htmlImageElement(htmlImageElement): + return htmlImageElement.jsValue + case let .htmlVideoElement(htmlVideoElement): + return htmlVideoElement.jsValue + case let .imageBitmap(imageBitmap): + return imageBitmap.jsValue + case let .imageData(imageData): + return imageData.jsValue + case let .offscreenCanvas(offscreenCanvas): + return offscreenCanvas.jsValue + case let .videoFrame(videoFrame): + return videoFrame.jsValue + } + } +} + public protocol Any_TimerHandler: ConvertibleToJSValue {} extension JSFunction: Any_TimerHandler {} extension String: Any_TimerHandler {} diff --git a/Sources/DOMKit/WebIDL/Float32List.swift b/Sources/DOMKit/WebIDL/Float32List.swift deleted file mode 100644 index 1f1e5bdb..00000000 --- a/Sources/DOMKit/WebIDL/Float32List.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Float32List: ConvertibleToJSValue {} -extension Float32Array: Any_Float32List {} -extension Array: Any_Float32List where Element == GLfloat {} - -public enum Float32List: JSValueCompatible, Any_Float32List { - case float32Array(Float32Array) - case seq_of_GLfloat([GLfloat]) - - var float32Array: Float32Array? { - switch self { - case let .float32Array(float32Array): return float32Array - default: return nil - } - } - - var seq_of_GLfloat: [GLfloat]? { - switch self { - case let .seq_of_GLfloat(seq_of_GLfloat): return seq_of_GLfloat - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let float32Array: Float32Array = value.fromJSValue() { - return .float32Array(float32Array) - } - if let seq_of_GLfloat: [GLfloat] = value.fromJSValue() { - return .seq_of_GLfloat(seq_of_GLfloat) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .float32Array(float32Array): - return float32Array.jsValue - case let .seq_of_GLfloat(seq_of_GLfloat): - return seq_of_GLfloat.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/Int32List.swift b/Sources/DOMKit/WebIDL/Int32List.swift deleted file mode 100644 index ce876a5b..00000000 --- a/Sources/DOMKit/WebIDL/Int32List.swift +++ /dev/null @@ -1,46 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_Int32List: ConvertibleToJSValue {} -extension Int32Array: Any_Int32List {} -extension Array: Any_Int32List where Element == GLint {} - -public enum Int32List: JSValueCompatible, Any_Int32List { - case int32Array(Int32Array) - case seq_of_GLint([GLint]) - - var int32Array: Int32Array? { - switch self { - case let .int32Array(int32Array): return int32Array - default: return nil - } - } - - var seq_of_GLint: [GLint]? { - switch self { - case let .seq_of_GLint(seq_of_GLint): return seq_of_GLint - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let int32Array: Int32Array = value.fromJSValue() { - return .int32Array(int32Array) - } - if let seq_of_GLint: [GLint] = value.fromJSValue() { - return .seq_of_GLint(seq_of_GLint) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .int32Array(int32Array): - return int32Array.jsValue - case let .seq_of_GLint(seq_of_GLint): - return seq_of_GLint.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/TexImageSource.swift b/Sources/DOMKit/WebIDL/TexImageSource.swift deleted file mode 100644 index d5750fff..00000000 --- a/Sources/DOMKit/WebIDL/TexImageSource.swift +++ /dev/null @@ -1,116 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol Any_TexImageSource: ConvertibleToJSValue {} -extension HTMLCanvasElement: Any_TexImageSource {} -extension HTMLImageElement: Any_TexImageSource {} -extension HTMLVideoElement: Any_TexImageSource {} -extension ImageBitmap: Any_TexImageSource {} -extension ImageData: Any_TexImageSource {} -extension OffscreenCanvas: Any_TexImageSource {} -extension VideoFrame: Any_TexImageSource {} - -public enum TexImageSource: JSValueCompatible, Any_TexImageSource { - case htmlCanvasElement(HTMLCanvasElement) - case htmlImageElement(HTMLImageElement) - case htmlVideoElement(HTMLVideoElement) - case imageBitmap(ImageBitmap) - case imageData(ImageData) - case offscreenCanvas(OffscreenCanvas) - case videoFrame(VideoFrame) - - var htmlCanvasElement: HTMLCanvasElement? { - switch self { - case let .htmlCanvasElement(htmlCanvasElement): return htmlCanvasElement - default: return nil - } - } - - var htmlImageElement: HTMLImageElement? { - switch self { - case let .htmlImageElement(htmlImageElement): return htmlImageElement - default: return nil - } - } - - var htmlVideoElement: HTMLVideoElement? { - switch self { - case let .htmlVideoElement(htmlVideoElement): return htmlVideoElement - default: return nil - } - } - - var imageBitmap: ImageBitmap? { - switch self { - case let .imageBitmap(imageBitmap): return imageBitmap - default: return nil - } - } - - var imageData: ImageData? { - switch self { - case let .imageData(imageData): return imageData - default: return nil - } - } - - var offscreenCanvas: OffscreenCanvas? { - switch self { - case let .offscreenCanvas(offscreenCanvas): return offscreenCanvas - default: return nil - } - } - - var videoFrame: VideoFrame? { - switch self { - case let .videoFrame(videoFrame): return videoFrame - default: return nil - } - } - - public static func construct(from value: JSValue) -> Self? { - if let htmlCanvasElement: HTMLCanvasElement = value.fromJSValue() { - return .htmlCanvasElement(htmlCanvasElement) - } - if let htmlImageElement: HTMLImageElement = value.fromJSValue() { - return .htmlImageElement(htmlImageElement) - } - if let htmlVideoElement: HTMLVideoElement = value.fromJSValue() { - return .htmlVideoElement(htmlVideoElement) - } - if let imageBitmap: ImageBitmap = value.fromJSValue() { - return .imageBitmap(imageBitmap) - } - if let imageData: ImageData = value.fromJSValue() { - return .imageData(imageData) - } - if let offscreenCanvas: OffscreenCanvas = value.fromJSValue() { - return .offscreenCanvas(offscreenCanvas) - } - if let videoFrame: VideoFrame = value.fromJSValue() { - return .videoFrame(videoFrame) - } - return nil - } - - public var jsValue: JSValue { - switch self { - case let .htmlCanvasElement(htmlCanvasElement): - return htmlCanvasElement.jsValue - case let .htmlImageElement(htmlImageElement): - return htmlImageElement.jsValue - case let .htmlVideoElement(htmlVideoElement): - return htmlVideoElement.jsValue - case let .imageBitmap(imageBitmap): - return imageBitmap.jsValue - case let .imageData(imageData): - return imageData.jsValue - case let .offscreenCanvas(offscreenCanvas): - return offscreenCanvas.jsValue - case let .videoFrame(videoFrame): - return videoFrame.jsValue - } - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift b/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift deleted file mode 100644 index 38991452..00000000 --- a/Sources/DOMKit/WebIDL/WebGLActiveInfo.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLActiveInfo: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLActiveInfo].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _size = ReadonlyAttribute(jsObject: jsObject, name: Strings.size) - _type = ReadonlyAttribute(jsObject: jsObject, name: Strings.type) - _name = ReadonlyAttribute(jsObject: jsObject, name: Strings.name) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var size: GLint - - @ReadonlyAttribute - public var type: GLenum - - @ReadonlyAttribute - public var name: String -} diff --git a/Sources/DOMKit/WebIDL/WebGLBuffer.swift b/Sources/DOMKit/WebIDL/WebGLBuffer.swift deleted file mode 100644 index c5217eb0..00000000 --- a/Sources/DOMKit/WebIDL/WebGLBuffer.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLBuffer: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLBuffer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift b/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift deleted file mode 100644 index 28853501..00000000 --- a/Sources/DOMKit/WebIDL/WebGLContextAttributes.swift +++ /dev/null @@ -1,60 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLContextAttributes: BridgedDictionary { - public convenience init(alpha: Bool, depth: Bool, stencil: Bool, antialias: Bool, premultipliedAlpha: Bool, preserveDrawingBuffer: Bool, powerPreference: WebGLPowerPreference, failIfMajorPerformanceCaveat: Bool, desynchronized: Bool) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.alpha] = alpha.jsValue - object[Strings.depth] = depth.jsValue - object[Strings.stencil] = stencil.jsValue - object[Strings.antialias] = antialias.jsValue - object[Strings.premultipliedAlpha] = premultipliedAlpha.jsValue - object[Strings.preserveDrawingBuffer] = preserveDrawingBuffer.jsValue - object[Strings.powerPreference] = powerPreference.jsValue - object[Strings.failIfMajorPerformanceCaveat] = failIfMajorPerformanceCaveat.jsValue - object[Strings.desynchronized] = desynchronized.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _alpha = ReadWriteAttribute(jsObject: object, name: Strings.alpha) - _depth = ReadWriteAttribute(jsObject: object, name: Strings.depth) - _stencil = ReadWriteAttribute(jsObject: object, name: Strings.stencil) - _antialias = ReadWriteAttribute(jsObject: object, name: Strings.antialias) - _premultipliedAlpha = ReadWriteAttribute(jsObject: object, name: Strings.premultipliedAlpha) - _preserveDrawingBuffer = ReadWriteAttribute(jsObject: object, name: Strings.preserveDrawingBuffer) - _powerPreference = ReadWriteAttribute(jsObject: object, name: Strings.powerPreference) - _failIfMajorPerformanceCaveat = ReadWriteAttribute(jsObject: object, name: Strings.failIfMajorPerformanceCaveat) - _desynchronized = ReadWriteAttribute(jsObject: object, name: Strings.desynchronized) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var alpha: Bool - - @ReadWriteAttribute - public var depth: Bool - - @ReadWriteAttribute - public var stencil: Bool - - @ReadWriteAttribute - public var antialias: Bool - - @ReadWriteAttribute - public var premultipliedAlpha: Bool - - @ReadWriteAttribute - public var preserveDrawingBuffer: Bool - - @ReadWriteAttribute - public var powerPreference: WebGLPowerPreference - - @ReadWriteAttribute - public var failIfMajorPerformanceCaveat: Bool - - @ReadWriteAttribute - public var desynchronized: Bool -} diff --git a/Sources/DOMKit/WebIDL/WebGLContextEvent.swift b/Sources/DOMKit/WebIDL/WebGLContextEvent.swift deleted file mode 100644 index 20837070..00000000 --- a/Sources/DOMKit/WebIDL/WebGLContextEvent.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLContextEvent: Event { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLContextEvent].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - _statusMessage = ReadonlyAttribute(jsObject: jsObject, name: Strings.statusMessage) - super.init(unsafelyWrapping: jsObject) - } - - @inlinable public convenience init(type: String, eventInit: WebGLContextEventInit? = nil) { - self.init(unsafelyWrapping: Self.constructor.new(arguments: [type.jsValue, eventInit?.jsValue ?? .undefined])) - } - - @ReadonlyAttribute - public var statusMessage: String -} diff --git a/Sources/DOMKit/WebIDL/WebGLContextEventInit.swift b/Sources/DOMKit/WebIDL/WebGLContextEventInit.swift deleted file mode 100644 index 20c0c668..00000000 --- a/Sources/DOMKit/WebIDL/WebGLContextEventInit.swift +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLContextEventInit: BridgedDictionary { - public convenience init(statusMessage: String) { - let object = JSObject.global[Strings.Object].function!.new() - object[Strings.statusMessage] = statusMessage.jsValue - self.init(unsafelyWrapping: object) - } - - public required init(unsafelyWrapping object: JSObject) { - _statusMessage = ReadWriteAttribute(jsObject: object, name: Strings.statusMessage) - super.init(unsafelyWrapping: object) - } - - @ReadWriteAttribute - public var statusMessage: String -} diff --git a/Sources/DOMKit/WebIDL/WebGLFramebuffer.swift b/Sources/DOMKit/WebIDL/WebGLFramebuffer.swift deleted file mode 100644 index 83d1af39..00000000 --- a/Sources/DOMKit/WebIDL/WebGLFramebuffer.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLFramebuffer: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLFramebuffer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLObject.swift b/Sources/DOMKit/WebIDL/WebGLObject.swift deleted file mode 100644 index c50d37fc..00000000 --- a/Sources/DOMKit/WebIDL/WebGLObject.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLObject: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLObject].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift b/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift deleted file mode 100644 index ce6b23f8..00000000 --- a/Sources/DOMKit/WebIDL/WebGLPowerPreference.swift +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public enum WebGLPowerPreference: JSString, JSValueCompatible { - case `default` = "default" - case lowPower = "low-power" - case highPerformance = "high-performance" - - @inlinable public static func construct(from jsValue: JSValue) -> Self? { - if let string = jsValue.jsString { - return Self(rawValue: string) - } - return nil - } - - @inlinable public init?(string: String) { - self.init(rawValue: JSString(string)) - } - - @inlinable public var jsValue: JSValue { rawValue.jsValue } -} diff --git a/Sources/DOMKit/WebIDL/WebGLProgram.swift b/Sources/DOMKit/WebIDL/WebGLProgram.swift deleted file mode 100644 index e38d4a93..00000000 --- a/Sources/DOMKit/WebIDL/WebGLProgram.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLProgram: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLProgram].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift b/Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift deleted file mode 100644 index 3b364894..00000000 --- a/Sources/DOMKit/WebIDL/WebGLRenderbuffer.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLRenderbuffer: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLRenderbuffer].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContext.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContext.swift deleted file mode 100644 index f9919cbe..00000000 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContext.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLRenderingContext: JSBridgedClass, WebGLRenderingContextBase, WebGLRenderingContextOverloads { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLRenderingContext].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift deleted file mode 100644 index c0baf5db..00000000 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextBase.swift +++ /dev/null @@ -1,1217 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol WebGLRenderingContextBase: JSBridgedClass {} -public extension WebGLRenderingContextBase { - @inlinable static var DEPTH_BUFFER_BIT: GLenum { 0x0000_0100 } - - @inlinable static var STENCIL_BUFFER_BIT: GLenum { 0x0000_0400 } - - @inlinable static var COLOR_BUFFER_BIT: GLenum { 0x0000_4000 } - - @inlinable static var POINTS: GLenum { 0x0000 } - - @inlinable static var LINES: GLenum { 0x0001 } - - @inlinable static var LINE_LOOP: GLenum { 0x0002 } - - @inlinable static var LINE_STRIP: GLenum { 0x0003 } - - @inlinable static var TRIANGLES: GLenum { 0x0004 } - - @inlinable static var TRIANGLE_STRIP: GLenum { 0x0005 } - - @inlinable static var TRIANGLE_FAN: GLenum { 0x0006 } - - @inlinable static var ZERO: GLenum { 0 } - - @inlinable static var ONE: GLenum { 1 } - - @inlinable static var SRC_COLOR: GLenum { 0x0300 } - - @inlinable static var ONE_MINUS_SRC_COLOR: GLenum { 0x0301 } - - @inlinable static var SRC_ALPHA: GLenum { 0x0302 } - - @inlinable static var ONE_MINUS_SRC_ALPHA: GLenum { 0x0303 } - - @inlinable static var DST_ALPHA: GLenum { 0x0304 } - - @inlinable static var ONE_MINUS_DST_ALPHA: GLenum { 0x0305 } - - @inlinable static var DST_COLOR: GLenum { 0x0306 } - - @inlinable static var ONE_MINUS_DST_COLOR: GLenum { 0x0307 } - - @inlinable static var SRC_ALPHA_SATURATE: GLenum { 0x0308 } - - @inlinable static var FUNC_ADD: GLenum { 0x8006 } - - @inlinable static var BLEND_EQUATION: GLenum { 0x8009 } - - @inlinable static var BLEND_EQUATION_RGB: GLenum { 0x8009 } - - @inlinable static var BLEND_EQUATION_ALPHA: GLenum { 0x883D } - - @inlinable static var FUNC_SUBTRACT: GLenum { 0x800A } - - @inlinable static var FUNC_REVERSE_SUBTRACT: GLenum { 0x800B } - - @inlinable static var BLEND_DST_RGB: GLenum { 0x80C8 } - - @inlinable static var BLEND_SRC_RGB: GLenum { 0x80C9 } - - @inlinable static var BLEND_DST_ALPHA: GLenum { 0x80CA } - - @inlinable static var BLEND_SRC_ALPHA: GLenum { 0x80CB } - - @inlinable static var CONSTANT_COLOR: GLenum { 0x8001 } - - @inlinable static var ONE_MINUS_CONSTANT_COLOR: GLenum { 0x8002 } - - @inlinable static var CONSTANT_ALPHA: GLenum { 0x8003 } - - @inlinable static var ONE_MINUS_CONSTANT_ALPHA: GLenum { 0x8004 } - - @inlinable static var BLEND_COLOR: GLenum { 0x8005 } - - @inlinable static var ARRAY_BUFFER: GLenum { 0x8892 } - - @inlinable static var ELEMENT_ARRAY_BUFFER: GLenum { 0x8893 } - - @inlinable static var ARRAY_BUFFER_BINDING: GLenum { 0x8894 } - - @inlinable static var ELEMENT_ARRAY_BUFFER_BINDING: GLenum { 0x8895 } - - @inlinable static var STREAM_DRAW: GLenum { 0x88E0 } - - @inlinable static var STATIC_DRAW: GLenum { 0x88E4 } - - @inlinable static var DYNAMIC_DRAW: GLenum { 0x88E8 } - - @inlinable static var BUFFER_SIZE: GLenum { 0x8764 } - - @inlinable static var BUFFER_USAGE: GLenum { 0x8765 } - - @inlinable static var CURRENT_VERTEX_ATTRIB: GLenum { 0x8626 } - - @inlinable static var FRONT: GLenum { 0x0404 } - - @inlinable static var BACK: GLenum { 0x0405 } - - @inlinable static var FRONT_AND_BACK: GLenum { 0x0408 } - - @inlinable static var CULL_FACE: GLenum { 0x0B44 } - - @inlinable static var BLEND: GLenum { 0x0BE2 } - - @inlinable static var DITHER: GLenum { 0x0BD0 } - - @inlinable static var STENCIL_TEST: GLenum { 0x0B90 } - - @inlinable static var DEPTH_TEST: GLenum { 0x0B71 } - - @inlinable static var SCISSOR_TEST: GLenum { 0x0C11 } - - @inlinable static var POLYGON_OFFSET_FILL: GLenum { 0x8037 } - - @inlinable static var SAMPLE_ALPHA_TO_COVERAGE: GLenum { 0x809E } - - @inlinable static var SAMPLE_COVERAGE: GLenum { 0x80A0 } - - @inlinable static var NO_ERROR: GLenum { 0 } - - @inlinable static var INVALID_ENUM: GLenum { 0x0500 } - - @inlinable static var INVALID_VALUE: GLenum { 0x0501 } - - @inlinable static var INVALID_OPERATION: GLenum { 0x0502 } - - @inlinable static var OUT_OF_MEMORY: GLenum { 0x0505 } - - @inlinable static var CW: GLenum { 0x0900 } - - @inlinable static var CCW: GLenum { 0x0901 } - - @inlinable static var LINE_WIDTH: GLenum { 0x0B21 } - - @inlinable static var ALIASED_POINT_SIZE_RANGE: GLenum { 0x846D } - - @inlinable static var ALIASED_LINE_WIDTH_RANGE: GLenum { 0x846E } - - @inlinable static var CULL_FACE_MODE: GLenum { 0x0B45 } - - @inlinable static var FRONT_FACE: GLenum { 0x0B46 } - - @inlinable static var DEPTH_RANGE: GLenum { 0x0B70 } - - @inlinable static var DEPTH_WRITEMASK: GLenum { 0x0B72 } - - @inlinable static var DEPTH_CLEAR_VALUE: GLenum { 0x0B73 } - - @inlinable static var DEPTH_FUNC: GLenum { 0x0B74 } - - @inlinable static var STENCIL_CLEAR_VALUE: GLenum { 0x0B91 } - - @inlinable static var STENCIL_FUNC: GLenum { 0x0B92 } - - @inlinable static var STENCIL_FAIL: GLenum { 0x0B94 } - - @inlinable static var STENCIL_PASS_DEPTH_FAIL: GLenum { 0x0B95 } - - @inlinable static var STENCIL_PASS_DEPTH_PASS: GLenum { 0x0B96 } - - @inlinable static var STENCIL_REF: GLenum { 0x0B97 } - - @inlinable static var STENCIL_VALUE_MASK: GLenum { 0x0B93 } - - @inlinable static var STENCIL_WRITEMASK: GLenum { 0x0B98 } - - @inlinable static var STENCIL_BACK_FUNC: GLenum { 0x8800 } - - @inlinable static var STENCIL_BACK_FAIL: GLenum { 0x8801 } - - @inlinable static var STENCIL_BACK_PASS_DEPTH_FAIL: GLenum { 0x8802 } - - @inlinable static var STENCIL_BACK_PASS_DEPTH_PASS: GLenum { 0x8803 } - - @inlinable static var STENCIL_BACK_REF: GLenum { 0x8CA3 } - - @inlinable static var STENCIL_BACK_VALUE_MASK: GLenum { 0x8CA4 } - - @inlinable static var STENCIL_BACK_WRITEMASK: GLenum { 0x8CA5 } - - @inlinable static var VIEWPORT: GLenum { 0x0BA2 } - - @inlinable static var SCISSOR_BOX: GLenum { 0x0C10 } - - @inlinable static var COLOR_CLEAR_VALUE: GLenum { 0x0C22 } - - @inlinable static var COLOR_WRITEMASK: GLenum { 0x0C23 } - - @inlinable static var UNPACK_ALIGNMENT: GLenum { 0x0CF5 } - - @inlinable static var PACK_ALIGNMENT: GLenum { 0x0D05 } - - @inlinable static var MAX_TEXTURE_SIZE: GLenum { 0x0D33 } - - @inlinable static var MAX_VIEWPORT_DIMS: GLenum { 0x0D3A } - - @inlinable static var SUBPIXEL_BITS: GLenum { 0x0D50 } - - @inlinable static var RED_BITS: GLenum { 0x0D52 } - - @inlinable static var GREEN_BITS: GLenum { 0x0D53 } - - @inlinable static var BLUE_BITS: GLenum { 0x0D54 } - - @inlinable static var ALPHA_BITS: GLenum { 0x0D55 } - - @inlinable static var DEPTH_BITS: GLenum { 0x0D56 } - - @inlinable static var STENCIL_BITS: GLenum { 0x0D57 } - - @inlinable static var POLYGON_OFFSET_UNITS: GLenum { 0x2A00 } - - @inlinable static var POLYGON_OFFSET_FACTOR: GLenum { 0x8038 } - - @inlinable static var TEXTURE_BINDING_2D: GLenum { 0x8069 } - - @inlinable static var SAMPLE_BUFFERS: GLenum { 0x80A8 } - - @inlinable static var SAMPLES: GLenum { 0x80A9 } - - @inlinable static var SAMPLE_COVERAGE_VALUE: GLenum { 0x80AA } - - @inlinable static var SAMPLE_COVERAGE_INVERT: GLenum { 0x80AB } - - @inlinable static var COMPRESSED_TEXTURE_FORMATS: GLenum { 0x86A3 } - - @inlinable static var DONT_CARE: GLenum { 0x1100 } - - @inlinable static var FASTEST: GLenum { 0x1101 } - - @inlinable static var NICEST: GLenum { 0x1102 } - - @inlinable static var GENERATE_MIPMAP_HINT: GLenum { 0x8192 } - - @inlinable static var BYTE: GLenum { 0x1400 } - - @inlinable static var UNSIGNED_BYTE: GLenum { 0x1401 } - - @inlinable static var SHORT: GLenum { 0x1402 } - - @inlinable static var UNSIGNED_SHORT: GLenum { 0x1403 } - - @inlinable static var INT: GLenum { 0x1404 } - - @inlinable static var UNSIGNED_INT: GLenum { 0x1405 } - - @inlinable static var FLOAT: GLenum { 0x1406 } - - @inlinable static var DEPTH_COMPONENT: GLenum { 0x1902 } - - @inlinable static var ALPHA: GLenum { 0x1906 } - - @inlinable static var RGB: GLenum { 0x1907 } - - @inlinable static var RGBA: GLenum { 0x1908 } - - @inlinable static var LUMINANCE: GLenum { 0x1909 } - - @inlinable static var LUMINANCE_ALPHA: GLenum { 0x190A } - - @inlinable static var UNSIGNED_SHORT_4_4_4_4: GLenum { 0x8033 } - - @inlinable static var UNSIGNED_SHORT_5_5_5_1: GLenum { 0x8034 } - - @inlinable static var UNSIGNED_SHORT_5_6_5: GLenum { 0x8363 } - - @inlinable static var FRAGMENT_SHADER: GLenum { 0x8B30 } - - @inlinable static var VERTEX_SHADER: GLenum { 0x8B31 } - - @inlinable static var MAX_VERTEX_ATTRIBS: GLenum { 0x8869 } - - @inlinable static var MAX_VERTEX_UNIFORM_VECTORS: GLenum { 0x8DFB } - - @inlinable static var MAX_VARYING_VECTORS: GLenum { 0x8DFC } - - @inlinable static var MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4D } - - @inlinable static var MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum { 0x8B4C } - - @inlinable static var MAX_TEXTURE_IMAGE_UNITS: GLenum { 0x8872 } - - @inlinable static var MAX_FRAGMENT_UNIFORM_VECTORS: GLenum { 0x8DFD } - - @inlinable static var SHADER_TYPE: GLenum { 0x8B4F } - - @inlinable static var DELETE_STATUS: GLenum { 0x8B80 } - - @inlinable static var LINK_STATUS: GLenum { 0x8B82 } - - @inlinable static var VALIDATE_STATUS: GLenum { 0x8B83 } - - @inlinable static var ATTACHED_SHADERS: GLenum { 0x8B85 } - - @inlinable static var ACTIVE_UNIFORMS: GLenum { 0x8B86 } - - @inlinable static var ACTIVE_ATTRIBUTES: GLenum { 0x8B89 } - - @inlinable static var SHADING_LANGUAGE_VERSION: GLenum { 0x8B8C } - - @inlinable static var CURRENT_PROGRAM: GLenum { 0x8B8D } - - @inlinable static var NEVER: GLenum { 0x0200 } - - @inlinable static var LESS: GLenum { 0x0201 } - - @inlinable static var EQUAL: GLenum { 0x0202 } - - @inlinable static var LEQUAL: GLenum { 0x0203 } - - @inlinable static var GREATER: GLenum { 0x0204 } - - @inlinable static var NOTEQUAL: GLenum { 0x0205 } - - @inlinable static var GEQUAL: GLenum { 0x0206 } - - @inlinable static var ALWAYS: GLenum { 0x0207 } - - @inlinable static var KEEP: GLenum { 0x1E00 } - - @inlinable static var REPLACE: GLenum { 0x1E01 } - - @inlinable static var INCR: GLenum { 0x1E02 } - - @inlinable static var DECR: GLenum { 0x1E03 } - - @inlinable static var INVERT: GLenum { 0x150A } - - @inlinable static var INCR_WRAP: GLenum { 0x8507 } - - @inlinable static var DECR_WRAP: GLenum { 0x8508 } - - @inlinable static var VENDOR: GLenum { 0x1F00 } - - @inlinable static var RENDERER: GLenum { 0x1F01 } - - @inlinable static var VERSION: GLenum { 0x1F02 } - - @inlinable static var NEAREST: GLenum { 0x2600 } - - @inlinable static var LINEAR: GLenum { 0x2601 } - - @inlinable static var NEAREST_MIPMAP_NEAREST: GLenum { 0x2700 } - - @inlinable static var LINEAR_MIPMAP_NEAREST: GLenum { 0x2701 } - - @inlinable static var NEAREST_MIPMAP_LINEAR: GLenum { 0x2702 } - - @inlinable static var LINEAR_MIPMAP_LINEAR: GLenum { 0x2703 } - - @inlinable static var TEXTURE_MAG_FILTER: GLenum { 0x2800 } - - @inlinable static var TEXTURE_MIN_FILTER: GLenum { 0x2801 } - - @inlinable static var TEXTURE_WRAP_S: GLenum { 0x2802 } - - @inlinable static var TEXTURE_WRAP_T: GLenum { 0x2803 } - - @inlinable static var TEXTURE_2D: GLenum { 0x0DE1 } - - @inlinable static var TEXTURE: GLenum { 0x1702 } - - @inlinable static var TEXTURE_CUBE_MAP: GLenum { 0x8513 } - - @inlinable static var TEXTURE_BINDING_CUBE_MAP: GLenum { 0x8514 } - - @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_X: GLenum { 0x8515 } - - @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum { 0x8516 } - - @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum { 0x8517 } - - @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum { 0x8518 } - - @inlinable static var TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum { 0x8519 } - - @inlinable static var TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum { 0x851A } - - @inlinable static var MAX_CUBE_MAP_TEXTURE_SIZE: GLenum { 0x851C } - - @inlinable static var TEXTURE0: GLenum { 0x84C0 } - - @inlinable static var TEXTURE1: GLenum { 0x84C1 } - - @inlinable static var TEXTURE2: GLenum { 0x84C2 } - - @inlinable static var TEXTURE3: GLenum { 0x84C3 } - - @inlinable static var TEXTURE4: GLenum { 0x84C4 } - - @inlinable static var TEXTURE5: GLenum { 0x84C5 } - - @inlinable static var TEXTURE6: GLenum { 0x84C6 } - - @inlinable static var TEXTURE7: GLenum { 0x84C7 } - - @inlinable static var TEXTURE8: GLenum { 0x84C8 } - - @inlinable static var TEXTURE9: GLenum { 0x84C9 } - - @inlinable static var TEXTURE10: GLenum { 0x84CA } - - @inlinable static var TEXTURE11: GLenum { 0x84CB } - - @inlinable static var TEXTURE12: GLenum { 0x84CC } - - @inlinable static var TEXTURE13: GLenum { 0x84CD } - - @inlinable static var TEXTURE14: GLenum { 0x84CE } - - @inlinable static var TEXTURE15: GLenum { 0x84CF } - - @inlinable static var TEXTURE16: GLenum { 0x84D0 } - - @inlinable static var TEXTURE17: GLenum { 0x84D1 } - - @inlinable static var TEXTURE18: GLenum { 0x84D2 } - - @inlinable static var TEXTURE19: GLenum { 0x84D3 } - - @inlinable static var TEXTURE20: GLenum { 0x84D4 } - - @inlinable static var TEXTURE21: GLenum { 0x84D5 } - - @inlinable static var TEXTURE22: GLenum { 0x84D6 } - - @inlinable static var TEXTURE23: GLenum { 0x84D7 } - - @inlinable static var TEXTURE24: GLenum { 0x84D8 } - - @inlinable static var TEXTURE25: GLenum { 0x84D9 } - - @inlinable static var TEXTURE26: GLenum { 0x84DA } - - @inlinable static var TEXTURE27: GLenum { 0x84DB } - - @inlinable static var TEXTURE28: GLenum { 0x84DC } - - @inlinable static var TEXTURE29: GLenum { 0x84DD } - - @inlinable static var TEXTURE30: GLenum { 0x84DE } - - @inlinable static var TEXTURE31: GLenum { 0x84DF } - - @inlinable static var ACTIVE_TEXTURE: GLenum { 0x84E0 } - - @inlinable static var REPEAT: GLenum { 0x2901 } - - @inlinable static var CLAMP_TO_EDGE: GLenum { 0x812F } - - @inlinable static var MIRRORED_REPEAT: GLenum { 0x8370 } - - @inlinable static var FLOAT_VEC2: GLenum { 0x8B50 } - - @inlinable static var FLOAT_VEC3: GLenum { 0x8B51 } - - @inlinable static var FLOAT_VEC4: GLenum { 0x8B52 } - - @inlinable static var INT_VEC2: GLenum { 0x8B53 } - - @inlinable static var INT_VEC3: GLenum { 0x8B54 } - - @inlinable static var INT_VEC4: GLenum { 0x8B55 } - - @inlinable static var BOOL: GLenum { 0x8B56 } - - @inlinable static var BOOL_VEC2: GLenum { 0x8B57 } - - @inlinable static var BOOL_VEC3: GLenum { 0x8B58 } - - @inlinable static var BOOL_VEC4: GLenum { 0x8B59 } - - @inlinable static var FLOAT_MAT2: GLenum { 0x8B5A } - - @inlinable static var FLOAT_MAT3: GLenum { 0x8B5B } - - @inlinable static var FLOAT_MAT4: GLenum { 0x8B5C } - - @inlinable static var SAMPLER_2D: GLenum { 0x8B5E } - - @inlinable static var SAMPLER_CUBE: GLenum { 0x8B60 } - - @inlinable static var VERTEX_ATTRIB_ARRAY_ENABLED: GLenum { 0x8622 } - - @inlinable static var VERTEX_ATTRIB_ARRAY_SIZE: GLenum { 0x8623 } - - @inlinable static var VERTEX_ATTRIB_ARRAY_STRIDE: GLenum { 0x8624 } - - @inlinable static var VERTEX_ATTRIB_ARRAY_TYPE: GLenum { 0x8625 } - - @inlinable static var VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum { 0x886A } - - @inlinable static var VERTEX_ATTRIB_ARRAY_POINTER: GLenum { 0x8645 } - - @inlinable static var VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum { 0x889F } - - @inlinable static var IMPLEMENTATION_COLOR_READ_TYPE: GLenum { 0x8B9A } - - @inlinable static var IMPLEMENTATION_COLOR_READ_FORMAT: GLenum { 0x8B9B } - - @inlinable static var COMPILE_STATUS: GLenum { 0x8B81 } - - @inlinable static var LOW_FLOAT: GLenum { 0x8DF0 } - - @inlinable static var MEDIUM_FLOAT: GLenum { 0x8DF1 } - - @inlinable static var HIGH_FLOAT: GLenum { 0x8DF2 } - - @inlinable static var LOW_INT: GLenum { 0x8DF3 } - - @inlinable static var MEDIUM_INT: GLenum { 0x8DF4 } - - @inlinable static var HIGH_INT: GLenum { 0x8DF5 } - - @inlinable static var FRAMEBUFFER: GLenum { 0x8D40 } - - @inlinable static var RENDERBUFFER: GLenum { 0x8D41 } - - @inlinable static var RGBA4: GLenum { 0x8056 } - - @inlinable static var RGB5_A1: GLenum { 0x8057 } - - @inlinable static var RGB565: GLenum { 0x8D62 } - - @inlinable static var DEPTH_COMPONENT16: GLenum { 0x81A5 } - - @inlinable static var STENCIL_INDEX8: GLenum { 0x8D48 } - - @inlinable static var DEPTH_STENCIL: GLenum { 0x84F9 } - - @inlinable static var RENDERBUFFER_WIDTH: GLenum { 0x8D42 } - - @inlinable static var RENDERBUFFER_HEIGHT: GLenum { 0x8D43 } - - @inlinable static var RENDERBUFFER_INTERNAL_FORMAT: GLenum { 0x8D44 } - - @inlinable static var RENDERBUFFER_RED_SIZE: GLenum { 0x8D50 } - - @inlinable static var RENDERBUFFER_GREEN_SIZE: GLenum { 0x8D51 } - - @inlinable static var RENDERBUFFER_BLUE_SIZE: GLenum { 0x8D52 } - - @inlinable static var RENDERBUFFER_ALPHA_SIZE: GLenum { 0x8D53 } - - @inlinable static var RENDERBUFFER_DEPTH_SIZE: GLenum { 0x8D54 } - - @inlinable static var RENDERBUFFER_STENCIL_SIZE: GLenum { 0x8D55 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum { 0x8CD0 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum { 0x8CD1 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum { 0x8CD2 } - - @inlinable static var FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum { 0x8CD3 } - - @inlinable static var COLOR_ATTACHMENT0: GLenum { 0x8CE0 } - - @inlinable static var DEPTH_ATTACHMENT: GLenum { 0x8D00 } - - @inlinable static var STENCIL_ATTACHMENT: GLenum { 0x8D20 } - - @inlinable static var DEPTH_STENCIL_ATTACHMENT: GLenum { 0x821A } - - @inlinable static var NONE: GLenum { 0 } - - @inlinable static var FRAMEBUFFER_COMPLETE: GLenum { 0x8CD5 } - - @inlinable static var FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum { 0x8CD6 } - - @inlinable static var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum { 0x8CD7 } - - @inlinable static var FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum { 0x8CD9 } - - @inlinable static var FRAMEBUFFER_UNSUPPORTED: GLenum { 0x8CDD } - - @inlinable static var FRAMEBUFFER_BINDING: GLenum { 0x8CA6 } - - @inlinable static var RENDERBUFFER_BINDING: GLenum { 0x8CA7 } - - @inlinable static var MAX_RENDERBUFFER_SIZE: GLenum { 0x84E8 } - - @inlinable static var INVALID_FRAMEBUFFER_OPERATION: GLenum { 0x0506 } - - @inlinable static var UNPACK_FLIP_Y_WEBGL: GLenum { 0x9240 } - - @inlinable static var UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum { 0x9241 } - - @inlinable static var CONTEXT_LOST_WEBGL: GLenum { 0x9242 } - - @inlinable static var UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum { 0x9243 } - - @inlinable static var BROWSER_DEFAULT_WEBGL: GLenum { 0x9244 } - - @inlinable var canvas: HTMLCanvasElement_or_OffscreenCanvas { ReadonlyAttribute[Strings.canvas, in: jsObject] } - - @inlinable var drawingBufferWidth: GLsizei { ReadonlyAttribute[Strings.drawingBufferWidth, in: jsObject] } - - @inlinable var drawingBufferHeight: GLsizei { ReadonlyAttribute[Strings.drawingBufferHeight, in: jsObject] } - - @inlinable func getContextAttributes() -> WebGLContextAttributes? { - let this = jsObject - return this[Strings.getContextAttributes].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func isContextLost() -> Bool { - let this = jsObject - return this[Strings.isContextLost].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func getSupportedExtensions() -> [String]? { - let this = jsObject - return this[Strings.getSupportedExtensions].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func getExtension(name: String) -> JSObject? { - let this = jsObject - return this[Strings.getExtension].function!(this: this, arguments: [name.jsValue]).fromJSValue()! - } - - @inlinable func activeTexture(texture: GLenum) { - let this = jsObject - _ = this[Strings.activeTexture].function!(this: this, arguments: [texture.jsValue]) - } - - @inlinable func attachShader(program: WebGLProgram, shader: WebGLShader) { - let this = jsObject - _ = this[Strings.attachShader].function!(this: this, arguments: [program.jsValue, shader.jsValue]) - } - - @inlinable func bindAttribLocation(program: WebGLProgram, index: GLuint, name: String) { - let this = jsObject - _ = this[Strings.bindAttribLocation].function!(this: this, arguments: [program.jsValue, index.jsValue, name.jsValue]) - } - - @inlinable func bindBuffer(target: GLenum, buffer: WebGLBuffer?) { - let this = jsObject - _ = this[Strings.bindBuffer].function!(this: this, arguments: [target.jsValue, buffer.jsValue]) - } - - @inlinable func bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer?) { - let this = jsObject - _ = this[Strings.bindFramebuffer].function!(this: this, arguments: [target.jsValue, framebuffer.jsValue]) - } - - @inlinable func bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer?) { - let this = jsObject - _ = this[Strings.bindRenderbuffer].function!(this: this, arguments: [target.jsValue, renderbuffer.jsValue]) - } - - @inlinable func bindTexture(target: GLenum, texture: WebGLTexture?) { - let this = jsObject - _ = this[Strings.bindTexture].function!(this: this, arguments: [target.jsValue, texture.jsValue]) - } - - @inlinable func blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { - let this = jsObject - _ = this[Strings.blendColor].function!(this: this, arguments: [red.jsValue, green.jsValue, blue.jsValue, alpha.jsValue]) - } - - @inlinable func blendEquation(mode: GLenum) { - let this = jsObject - _ = this[Strings.blendEquation].function!(this: this, arguments: [mode.jsValue]) - } - - @inlinable func blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum) { - let this = jsObject - _ = this[Strings.blendEquationSeparate].function!(this: this, arguments: [modeRGB.jsValue, modeAlpha.jsValue]) - } - - @inlinable func blendFunc(sfactor: GLenum, dfactor: GLenum) { - let this = jsObject - _ = this[Strings.blendFunc].function!(this: this, arguments: [sfactor.jsValue, dfactor.jsValue]) - } - - @inlinable func blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum) { - let this = jsObject - _ = this[Strings.blendFuncSeparate].function!(this: this, arguments: [srcRGB.jsValue, dstRGB.jsValue, srcAlpha.jsValue, dstAlpha.jsValue]) - } - - @inlinable func checkFramebufferStatus(target: GLenum) -> GLenum { - let this = jsObject - return this[Strings.checkFramebufferStatus].function!(this: this, arguments: [target.jsValue]).fromJSValue()! - } - - @inlinable func clear(mask: GLbitfield) { - let this = jsObject - _ = this[Strings.clear].function!(this: this, arguments: [mask.jsValue]) - } - - @inlinable func clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf) { - let this = jsObject - _ = this[Strings.clearColor].function!(this: this, arguments: [red.jsValue, green.jsValue, blue.jsValue, alpha.jsValue]) - } - - @inlinable func clearDepth(depth: GLclampf) { - let this = jsObject - _ = this[Strings.clearDepth].function!(this: this, arguments: [depth.jsValue]) - } - - @inlinable func clearStencil(s: GLint) { - let this = jsObject - _ = this[Strings.clearStencil].function!(this: this, arguments: [s.jsValue]) - } - - @inlinable func colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean) { - let this = jsObject - _ = this[Strings.colorMask].function!(this: this, arguments: [red.jsValue, green.jsValue, blue.jsValue, alpha.jsValue]) - } - - @inlinable func compileShader(shader: WebGLShader) { - let this = jsObject - _ = this[Strings.compileShader].function!(this: this, arguments: [shader.jsValue]) - } - - @inlinable func copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = x.jsValue - let _arg4 = y.jsValue - let _arg5 = width.jsValue - let _arg6 = height.jsValue - let _arg7 = border.jsValue - let this = jsObject - _ = this[Strings.copyTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) - } - - @inlinable func copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = xoffset.jsValue - let _arg3 = yoffset.jsValue - let _arg4 = x.jsValue - let _arg5 = y.jsValue - let _arg6 = width.jsValue - let _arg7 = height.jsValue - let this = jsObject - _ = this[Strings.copyTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) - } - - @inlinable func createBuffer() -> WebGLBuffer? { - let this = jsObject - return this[Strings.createBuffer].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func createFramebuffer() -> WebGLFramebuffer? { - let this = jsObject - return this[Strings.createFramebuffer].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func createProgram() -> WebGLProgram? { - let this = jsObject - return this[Strings.createProgram].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func createRenderbuffer() -> WebGLRenderbuffer? { - let this = jsObject - return this[Strings.createRenderbuffer].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func createShader(type: GLenum) -> WebGLShader? { - let this = jsObject - return this[Strings.createShader].function!(this: this, arguments: [type.jsValue]).fromJSValue()! - } - - @inlinable func createTexture() -> WebGLTexture? { - let this = jsObject - return this[Strings.createTexture].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func cullFace(mode: GLenum) { - let this = jsObject - _ = this[Strings.cullFace].function!(this: this, arguments: [mode.jsValue]) - } - - @inlinable func deleteBuffer(buffer: WebGLBuffer?) { - let this = jsObject - _ = this[Strings.deleteBuffer].function!(this: this, arguments: [buffer.jsValue]) - } - - @inlinable func deleteFramebuffer(framebuffer: WebGLFramebuffer?) { - let this = jsObject - _ = this[Strings.deleteFramebuffer].function!(this: this, arguments: [framebuffer.jsValue]) - } - - @inlinable func deleteProgram(program: WebGLProgram?) { - let this = jsObject - _ = this[Strings.deleteProgram].function!(this: this, arguments: [program.jsValue]) - } - - @inlinable func deleteRenderbuffer(renderbuffer: WebGLRenderbuffer?) { - let this = jsObject - _ = this[Strings.deleteRenderbuffer].function!(this: this, arguments: [renderbuffer.jsValue]) - } - - @inlinable func deleteShader(shader: WebGLShader?) { - let this = jsObject - _ = this[Strings.deleteShader].function!(this: this, arguments: [shader.jsValue]) - } - - @inlinable func deleteTexture(texture: WebGLTexture?) { - let this = jsObject - _ = this[Strings.deleteTexture].function!(this: this, arguments: [texture.jsValue]) - } - - @inlinable func depthFunc(func: GLenum) { - let this = jsObject - _ = this[Strings.depthFunc].function!(this: this, arguments: [`func`.jsValue]) - } - - @inlinable func depthMask(flag: GLboolean) { - let this = jsObject - _ = this[Strings.depthMask].function!(this: this, arguments: [flag.jsValue]) - } - - @inlinable func depthRange(zNear: GLclampf, zFar: GLclampf) { - let this = jsObject - _ = this[Strings.depthRange].function!(this: this, arguments: [zNear.jsValue, zFar.jsValue]) - } - - @inlinable func detachShader(program: WebGLProgram, shader: WebGLShader) { - let this = jsObject - _ = this[Strings.detachShader].function!(this: this, arguments: [program.jsValue, shader.jsValue]) - } - - @inlinable func disable(cap: GLenum) { - let this = jsObject - _ = this[Strings.disable].function!(this: this, arguments: [cap.jsValue]) - } - - @inlinable func disableVertexAttribArray(index: GLuint) { - let this = jsObject - _ = this[Strings.disableVertexAttribArray].function!(this: this, arguments: [index.jsValue]) - } - - @inlinable func drawArrays(mode: GLenum, first: GLint, count: GLsizei) { - let this = jsObject - _ = this[Strings.drawArrays].function!(this: this, arguments: [mode.jsValue, first.jsValue, count.jsValue]) - } - - @inlinable func drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr) { - let this = jsObject - _ = this[Strings.drawElements].function!(this: this, arguments: [mode.jsValue, count.jsValue, type.jsValue, offset.jsValue]) - } - - @inlinable func enable(cap: GLenum) { - let this = jsObject - _ = this[Strings.enable].function!(this: this, arguments: [cap.jsValue]) - } - - @inlinable func enableVertexAttribArray(index: GLuint) { - let this = jsObject - _ = this[Strings.enableVertexAttribArray].function!(this: this, arguments: [index.jsValue]) - } - - @inlinable func finish() { - let this = jsObject - _ = this[Strings.finish].function!(this: this, arguments: []) - } - - @inlinable func flush() { - let this = jsObject - _ = this[Strings.flush].function!(this: this, arguments: []) - } - - @inlinable func framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer?) { - let this = jsObject - _ = this[Strings.framebufferRenderbuffer].function!(this: this, arguments: [target.jsValue, attachment.jsValue, renderbuffertarget.jsValue, renderbuffer.jsValue]) - } - - @inlinable func framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture?, level: GLint) { - let this = jsObject - _ = this[Strings.framebufferTexture2D].function!(this: this, arguments: [target.jsValue, attachment.jsValue, textarget.jsValue, texture.jsValue, level.jsValue]) - } - - @inlinable func frontFace(mode: GLenum) { - let this = jsObject - _ = this[Strings.frontFace].function!(this: this, arguments: [mode.jsValue]) - } - - @inlinable func generateMipmap(target: GLenum) { - let this = jsObject - _ = this[Strings.generateMipmap].function!(this: this, arguments: [target.jsValue]) - } - - @inlinable func getActiveAttrib(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { - let this = jsObject - return this[Strings.getActiveAttrib].function!(this: this, arguments: [program.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable func getActiveUniform(program: WebGLProgram, index: GLuint) -> WebGLActiveInfo? { - let this = jsObject - return this[Strings.getActiveUniform].function!(this: this, arguments: [program.jsValue, index.jsValue]).fromJSValue()! - } - - @inlinable func getAttachedShaders(program: WebGLProgram) -> [WebGLShader]? { - let this = jsObject - return this[Strings.getAttachedShaders].function!(this: this, arguments: [program.jsValue]).fromJSValue()! - } - - @inlinable func getAttribLocation(program: WebGLProgram, name: String) -> GLint { - let this = jsObject - return this[Strings.getAttribLocation].function!(this: this, arguments: [program.jsValue, name.jsValue]).fromJSValue()! - } - - @inlinable func getBufferParameter(target: GLenum, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getBufferParameter].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func getParameter(pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getParameter].function!(this: this, arguments: [pname.jsValue]).fromJSValue()! - } - - @inlinable func getError() -> GLenum { - let this = jsObject - return this[Strings.getError].function!(this: this, arguments: []).fromJSValue()! - } - - @inlinable func getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getFramebufferAttachmentParameter].function!(this: this, arguments: [target.jsValue, attachment.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func getProgramParameter(program: WebGLProgram, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getProgramParameter].function!(this: this, arguments: [program.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func getProgramInfoLog(program: WebGLProgram) -> String? { - let this = jsObject - return this[Strings.getProgramInfoLog].function!(this: this, arguments: [program.jsValue]).fromJSValue()! - } - - @inlinable func getRenderbufferParameter(target: GLenum, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getRenderbufferParameter].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func getShaderParameter(shader: WebGLShader, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getShaderParameter].function!(this: this, arguments: [shader.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum) -> WebGLShaderPrecisionFormat? { - let this = jsObject - return this[Strings.getShaderPrecisionFormat].function!(this: this, arguments: [shadertype.jsValue, precisiontype.jsValue]).fromJSValue()! - } - - @inlinable func getShaderInfoLog(shader: WebGLShader) -> String? { - let this = jsObject - return this[Strings.getShaderInfoLog].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! - } - - @inlinable func getShaderSource(shader: WebGLShader) -> String? { - let this = jsObject - return this[Strings.getShaderSource].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! - } - - @inlinable func getTexParameter(target: GLenum, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getTexParameter].function!(this: this, arguments: [target.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func getUniform(program: WebGLProgram, location: WebGLUniformLocation) -> JSValue { - let this = jsObject - return this[Strings.getUniform].function!(this: this, arguments: [program.jsValue, location.jsValue]).fromJSValue()! - } - - @inlinable func getUniformLocation(program: WebGLProgram, name: String) -> WebGLUniformLocation? { - let this = jsObject - return this[Strings.getUniformLocation].function!(this: this, arguments: [program.jsValue, name.jsValue]).fromJSValue()! - } - - @inlinable func getVertexAttrib(index: GLuint, pname: GLenum) -> JSValue { - let this = jsObject - return this[Strings.getVertexAttrib].function!(this: this, arguments: [index.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func getVertexAttribOffset(index: GLuint, pname: GLenum) -> GLintptr { - let this = jsObject - return this[Strings.getVertexAttribOffset].function!(this: this, arguments: [index.jsValue, pname.jsValue]).fromJSValue()! - } - - @inlinable func hint(target: GLenum, mode: GLenum) { - let this = jsObject - _ = this[Strings.hint].function!(this: this, arguments: [target.jsValue, mode.jsValue]) - } - - @inlinable func isBuffer(buffer: WebGLBuffer?) -> GLboolean { - let this = jsObject - return this[Strings.isBuffer].function!(this: this, arguments: [buffer.jsValue]).fromJSValue()! - } - - @inlinable func isEnabled(cap: GLenum) -> GLboolean { - let this = jsObject - return this[Strings.isEnabled].function!(this: this, arguments: [cap.jsValue]).fromJSValue()! - } - - @inlinable func isFramebuffer(framebuffer: WebGLFramebuffer?) -> GLboolean { - let this = jsObject - return this[Strings.isFramebuffer].function!(this: this, arguments: [framebuffer.jsValue]).fromJSValue()! - } - - @inlinable func isProgram(program: WebGLProgram?) -> GLboolean { - let this = jsObject - return this[Strings.isProgram].function!(this: this, arguments: [program.jsValue]).fromJSValue()! - } - - @inlinable func isRenderbuffer(renderbuffer: WebGLRenderbuffer?) -> GLboolean { - let this = jsObject - return this[Strings.isRenderbuffer].function!(this: this, arguments: [renderbuffer.jsValue]).fromJSValue()! - } - - @inlinable func isShader(shader: WebGLShader?) -> GLboolean { - let this = jsObject - return this[Strings.isShader].function!(this: this, arguments: [shader.jsValue]).fromJSValue()! - } - - @inlinable func isTexture(texture: WebGLTexture?) -> GLboolean { - let this = jsObject - return this[Strings.isTexture].function!(this: this, arguments: [texture.jsValue]).fromJSValue()! - } - - @inlinable func lineWidth(width: GLfloat) { - let this = jsObject - _ = this[Strings.lineWidth].function!(this: this, arguments: [width.jsValue]) - } - - @inlinable func linkProgram(program: WebGLProgram) { - let this = jsObject - _ = this[Strings.linkProgram].function!(this: this, arguments: [program.jsValue]) - } - - @inlinable func pixelStorei(pname: GLenum, param: GLint) { - let this = jsObject - _ = this[Strings.pixelStorei].function!(this: this, arguments: [pname.jsValue, param.jsValue]) - } - - @inlinable func polygonOffset(factor: GLfloat, units: GLfloat) { - let this = jsObject - _ = this[Strings.polygonOffset].function!(this: this, arguments: [factor.jsValue, units.jsValue]) - } - - @inlinable func renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei) { - let this = jsObject - _ = this[Strings.renderbufferStorage].function!(this: this, arguments: [target.jsValue, internalformat.jsValue, width.jsValue, height.jsValue]) - } - - @inlinable func sampleCoverage(value: GLclampf, invert: GLboolean) { - let this = jsObject - _ = this[Strings.sampleCoverage].function!(this: this, arguments: [value.jsValue, invert.jsValue]) - } - - @inlinable func scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { - let this = jsObject - _ = this[Strings.scissor].function!(this: this, arguments: [x.jsValue, y.jsValue, width.jsValue, height.jsValue]) - } - - @inlinable func shaderSource(shader: WebGLShader, source: String) { - let this = jsObject - _ = this[Strings.shaderSource].function!(this: this, arguments: [shader.jsValue, source.jsValue]) - } - - @inlinable func stencilFunc(func: GLenum, ref: GLint, mask: GLuint) { - let this = jsObject - _ = this[Strings.stencilFunc].function!(this: this, arguments: [`func`.jsValue, ref.jsValue, mask.jsValue]) - } - - @inlinable func stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint) { - let this = jsObject - _ = this[Strings.stencilFuncSeparate].function!(this: this, arguments: [face.jsValue, `func`.jsValue, ref.jsValue, mask.jsValue]) - } - - @inlinable func stencilMask(mask: GLuint) { - let this = jsObject - _ = this[Strings.stencilMask].function!(this: this, arguments: [mask.jsValue]) - } - - @inlinable func stencilMaskSeparate(face: GLenum, mask: GLuint) { - let this = jsObject - _ = this[Strings.stencilMaskSeparate].function!(this: this, arguments: [face.jsValue, mask.jsValue]) - } - - @inlinable func stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum) { - let this = jsObject - _ = this[Strings.stencilOp].function!(this: this, arguments: [fail.jsValue, zfail.jsValue, zpass.jsValue]) - } - - @inlinable func stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum) { - let this = jsObject - _ = this[Strings.stencilOpSeparate].function!(this: this, arguments: [face.jsValue, fail.jsValue, zfail.jsValue, zpass.jsValue]) - } - - @inlinable func texParameterf(target: GLenum, pname: GLenum, param: GLfloat) { - let this = jsObject - _ = this[Strings.texParameterf].function!(this: this, arguments: [target.jsValue, pname.jsValue, param.jsValue]) - } - - @inlinable func texParameteri(target: GLenum, pname: GLenum, param: GLint) { - let this = jsObject - _ = this[Strings.texParameteri].function!(this: this, arguments: [target.jsValue, pname.jsValue, param.jsValue]) - } - - @inlinable func uniform1f(location: WebGLUniformLocation?, x: GLfloat) { - let this = jsObject - _ = this[Strings.uniform1f].function!(this: this, arguments: [location.jsValue, x.jsValue]) - } - - @inlinable func uniform2f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat) { - let this = jsObject - _ = this[Strings.uniform2f].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue]) - } - - @inlinable func uniform3f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat) { - let this = jsObject - _ = this[Strings.uniform3f].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue]) - } - - @inlinable func uniform4f(location: WebGLUniformLocation?, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { - let this = jsObject - _ = this[Strings.uniform4f].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) - } - - @inlinable func uniform1i(location: WebGLUniformLocation?, x: GLint) { - let this = jsObject - _ = this[Strings.uniform1i].function!(this: this, arguments: [location.jsValue, x.jsValue]) - } - - @inlinable func uniform2i(location: WebGLUniformLocation?, x: GLint, y: GLint) { - let this = jsObject - _ = this[Strings.uniform2i].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue]) - } - - @inlinable func uniform3i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint) { - let this = jsObject - _ = this[Strings.uniform3i].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue]) - } - - @inlinable func uniform4i(location: WebGLUniformLocation?, x: GLint, y: GLint, z: GLint, w: GLint) { - let this = jsObject - _ = this[Strings.uniform4i].function!(this: this, arguments: [location.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) - } - - @inlinable func useProgram(program: WebGLProgram?) { - let this = jsObject - _ = this[Strings.useProgram].function!(this: this, arguments: [program.jsValue]) - } - - @inlinable func validateProgram(program: WebGLProgram) { - let this = jsObject - _ = this[Strings.validateProgram].function!(this: this, arguments: [program.jsValue]) - } - - @inlinable func vertexAttrib1f(index: GLuint, x: GLfloat) { - let this = jsObject - _ = this[Strings.vertexAttrib1f].function!(this: this, arguments: [index.jsValue, x.jsValue]) - } - - @inlinable func vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat) { - let this = jsObject - _ = this[Strings.vertexAttrib2f].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue]) - } - - @inlinable func vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat) { - let this = jsObject - _ = this[Strings.vertexAttrib3f].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue]) - } - - @inlinable func vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) { - let this = jsObject - _ = this[Strings.vertexAttrib4f].function!(this: this, arguments: [index.jsValue, x.jsValue, y.jsValue, z.jsValue, w.jsValue]) - } - - @inlinable func vertexAttrib1fv(index: GLuint, values: Float32List) { - let this = jsObject - _ = this[Strings.vertexAttrib1fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) - } - - @inlinable func vertexAttrib2fv(index: GLuint, values: Float32List) { - let this = jsObject - _ = this[Strings.vertexAttrib2fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) - } - - @inlinable func vertexAttrib3fv(index: GLuint, values: Float32List) { - let this = jsObject - _ = this[Strings.vertexAttrib3fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) - } - - @inlinable func vertexAttrib4fv(index: GLuint, values: Float32List) { - let this = jsObject - _ = this[Strings.vertexAttrib4fv].function!(this: this, arguments: [index.jsValue, values.jsValue]) - } - - @inlinable func vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr) { - let _arg0 = index.jsValue - let _arg1 = size.jsValue - let _arg2 = type.jsValue - let _arg3 = normalized.jsValue - let _arg4 = stride.jsValue - let _arg5 = offset.jsValue - let this = jsObject - _ = this[Strings.vertexAttribPointer].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } - - @inlinable func viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei) { - let this = jsObject - _ = this[Strings.viewport].function!(this: this, arguments: [x.jsValue, y.jsValue, width.jsValue, height.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift b/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift deleted file mode 100644 index fe1977ac..00000000 --- a/Sources/DOMKit/WebIDL/WebGLRenderingContextOverloads.swift +++ /dev/null @@ -1,165 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public protocol WebGLRenderingContextOverloads: JSBridgedClass {} -public extension WebGLRenderingContextOverloads { - @inlinable func bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) { - let this = jsObject - _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, size.jsValue, usage.jsValue]) - } - - @inlinable func bufferData(target: GLenum, data: BufferSource?, usage: GLenum) { - let this = jsObject - _ = this[Strings.bufferData].function!(this: this, arguments: [target.jsValue, data.jsValue, usage.jsValue]) - } - - @inlinable func bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource) { - let this = jsObject - _ = this[Strings.bufferSubData].function!(this: this, arguments: [target.jsValue, offset.jsValue, data.jsValue]) - } - - @inlinable func compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = width.jsValue - let _arg4 = height.jsValue - let _arg5 = border.jsValue - let _arg6 = data.jsValue - let this = jsObject - _ = this[Strings.compressedTexImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) - } - - @inlinable func compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = xoffset.jsValue - let _arg3 = yoffset.jsValue - let _arg4 = width.jsValue - let _arg5 = height.jsValue - let _arg6 = format.jsValue - let _arg7 = data.jsValue - let this = jsObject - _ = this[Strings.compressedTexSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7]) - } - - @inlinable func readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { - let _arg0 = x.jsValue - let _arg1 = y.jsValue - let _arg2 = width.jsValue - let _arg3 = height.jsValue - let _arg4 = format.jsValue - let _arg5 = type.jsValue - let _arg6 = pixels.jsValue - let this = jsObject - _ = this[Strings.readPixels].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) - } - - @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = width.jsValue - let _arg4 = height.jsValue - let _arg5 = border.jsValue - let _arg6 = format.jsValue - let _arg7 = type.jsValue - let _arg8 = pixels.jsValue - let this = jsObject - _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) - } - - @inlinable func texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = internalformat.jsValue - let _arg3 = format.jsValue - let _arg4 = type.jsValue - let _arg5 = source.jsValue - let this = jsObject - _ = this[Strings.texImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5]) - } - - @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = xoffset.jsValue - let _arg3 = yoffset.jsValue - let _arg4 = width.jsValue - let _arg5 = height.jsValue - let _arg6 = format.jsValue - let _arg7 = type.jsValue - let _arg8 = pixels.jsValue - let this = jsObject - _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8]) - } - - @inlinable func texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource) { - let _arg0 = target.jsValue - let _arg1 = level.jsValue - let _arg2 = xoffset.jsValue - let _arg3 = yoffset.jsValue - let _arg4 = format.jsValue - let _arg5 = type.jsValue - let _arg6 = source.jsValue - let this = jsObject - _ = this[Strings.texSubImage2D].function!(this: this, arguments: [_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6]) - } - - @inlinable func uniform1fv(location: WebGLUniformLocation?, v: Float32List) { - let this = jsObject - _ = this[Strings.uniform1fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) - } - - @inlinable func uniform2fv(location: WebGLUniformLocation?, v: Float32List) { - let this = jsObject - _ = this[Strings.uniform2fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) - } - - @inlinable func uniform3fv(location: WebGLUniformLocation?, v: Float32List) { - let this = jsObject - _ = this[Strings.uniform3fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) - } - - @inlinable func uniform4fv(location: WebGLUniformLocation?, v: Float32List) { - let this = jsObject - _ = this[Strings.uniform4fv].function!(this: this, arguments: [location.jsValue, v.jsValue]) - } - - @inlinable func uniform1iv(location: WebGLUniformLocation?, v: Int32List) { - let this = jsObject - _ = this[Strings.uniform1iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) - } - - @inlinable func uniform2iv(location: WebGLUniformLocation?, v: Int32List) { - let this = jsObject - _ = this[Strings.uniform2iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) - } - - @inlinable func uniform3iv(location: WebGLUniformLocation?, v: Int32List) { - let this = jsObject - _ = this[Strings.uniform3iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) - } - - @inlinable func uniform4iv(location: WebGLUniformLocation?, v: Int32List) { - let this = jsObject - _ = this[Strings.uniform4iv].function!(this: this, arguments: [location.jsValue, v.jsValue]) - } - - @inlinable func uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { - let this = jsObject - _ = this[Strings.uniformMatrix2fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, value.jsValue]) - } - - @inlinable func uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { - let this = jsObject - _ = this[Strings.uniformMatrix3fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, value.jsValue]) - } - - @inlinable func uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32List) { - let this = jsObject - _ = this[Strings.uniformMatrix4fv].function!(this: this, arguments: [location.jsValue, transpose.jsValue, value.jsValue]) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLShader.swift b/Sources/DOMKit/WebIDL/WebGLShader.swift deleted file mode 100644 index 97f2b719..00000000 --- a/Sources/DOMKit/WebIDL/WebGLShader.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLShader: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLShader].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift b/Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift deleted file mode 100644 index 67725e58..00000000 --- a/Sources/DOMKit/WebIDL/WebGLShaderPrecisionFormat.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLShaderPrecisionFormat: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLShaderPrecisionFormat].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - _rangeMin = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeMin) - _rangeMax = ReadonlyAttribute(jsObject: jsObject, name: Strings.rangeMax) - _precision = ReadonlyAttribute(jsObject: jsObject, name: Strings.precision) - self.jsObject = jsObject - } - - @ReadonlyAttribute - public var rangeMin: GLint - - @ReadonlyAttribute - public var rangeMax: GLint - - @ReadonlyAttribute - public var precision: GLint -} diff --git a/Sources/DOMKit/WebIDL/WebGLTexture.swift b/Sources/DOMKit/WebIDL/WebGLTexture.swift deleted file mode 100644 index ee7ad6c9..00000000 --- a/Sources/DOMKit/WebIDL/WebGLTexture.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLTexture: WebGLObject { - @inlinable override public class var constructor: JSFunction { JSObject.global[Strings.WebGLTexture].function! } - - public required init(unsafelyWrapping jsObject: JSObject) { - super.init(unsafelyWrapping: jsObject) - } -} diff --git a/Sources/DOMKit/WebIDL/WebGLUniformLocation.swift b/Sources/DOMKit/WebIDL/WebGLUniformLocation.swift deleted file mode 100644 index cf833a95..00000000 --- a/Sources/DOMKit/WebIDL/WebGLUniformLocation.swift +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by WebIDLToSwift. DO NOT EDIT! - -import JavaScriptEventLoop -import JavaScriptKit - -public class WebGLUniformLocation: JSBridgedClass { - @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WebGLUniformLocation].function! } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } -}