diff --git a/.gitignore b/.gitignore
index 970bd4ca..12e924fc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@
/*.xcodeproj
xcuserdata/
node_modules
+.vscode
+.swiftpm
diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 919434a6..00000000
--- a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d98100..00000000
--- a/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift
new file mode 100644
index 00000000..480f696d
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ByteLengthQueuingStrategy.swift
@@ -0,0 +1,26 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+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
+ }
+
+ @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
+}
diff --git a/Sources/DOMKit/WebIDL/ClosureAttribute.swift b/Sources/DOMKit/WebIDL/ClosureAttribute.swift
index 82e24bb3..5bb26ecc 100644
--- a/Sources/DOMKit/WebIDL/ClosureAttribute.swift
+++ b/Sources/DOMKit/WebIDL/ClosureAttribute.swift
@@ -4,6 +4,70 @@ import JavaScriptEventLoop
import JavaScriptKit
/* variadic generics please */
+@propertyWrapper public final class ClosureAttribute0
+ where ReturnType: JSValueCompatible
+{
+ @usableFromInline let jsObject: JSObject
+ @usableFromInline let name: JSString
+
+ public init(jsObject: JSObject, name: JSString) {
+ self.jsObject = jsObject
+ self.name = name
+ }
+
+ @inlinable public var wrappedValue: () -> ReturnType {
+ get { ClosureAttribute0[name, in: jsObject] }
+ set { ClosureAttribute0[name, in: jsObject] = newValue }
+ }
+
+ @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> () -> ReturnType {
+ get {
+ let function = jsObject[name].function!
+ return { function().fromJSValue()! }
+ }
+ set {
+ jsObject[name] = JSClosure { _ in
+ newValue().jsValue
+ }.jsValue
+ }
+ }
+}
+
+@propertyWrapper public final class ClosureAttribute0Optional
+ where ReturnType: JSValueCompatible
+{
+ @usableFromInline let jsObject: JSObject
+ @usableFromInline let name: JSString
+
+ public init(jsObject: JSObject, name: JSString) {
+ self.jsObject = jsObject
+ self.name = name
+ }
+
+ @inlinable public var wrappedValue: (() -> ReturnType)? {
+ get { ClosureAttribute0Optional[name, in: jsObject] }
+ set { ClosureAttribute0Optional[name, in: jsObject] = newValue }
+ }
+
+ @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (() -> ReturnType)? {
+ get {
+ guard let function = jsObject[name].function else {
+ return nil
+ }
+ return { function().fromJSValue()! }
+ }
+ set {
+ if let newValue = newValue {
+ jsObject[name] = JSClosure { _ in
+ newValue().jsValue
+ }.jsValue
+ } else {
+ jsObject[name] = .null
+ }
+ }
+ }
+}
+
@propertyWrapper public final class ClosureAttribute0OptionalVoid {
@usableFromInline let jsObject: JSObject
@usableFromInline let name: JSString
@@ -196,6 +260,70 @@ import JavaScriptKit
}
}
+@propertyWrapper public final class ClosureAttribute2
+ where A0: JSValueCompatible, A1: JSValueCompatible, ReturnType: JSValueCompatible
+{
+ @usableFromInline let jsObject: JSObject
+ @usableFromInline let name: JSString
+
+ public init(jsObject: JSObject, name: JSString) {
+ self.jsObject = jsObject
+ self.name = name
+ }
+
+ @inlinable public var wrappedValue: (A0, A1) -> ReturnType {
+ get { ClosureAttribute2[name, in: jsObject] }
+ set { ClosureAttribute2[name, in: jsObject] = newValue }
+ }
+
+ @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> (A0, A1) -> ReturnType {
+ get {
+ let function = jsObject[name].function!
+ return { function($0.jsValue, $1.jsValue).fromJSValue()! }
+ }
+ set {
+ jsObject[name] = JSClosure {
+ newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!).jsValue
+ }.jsValue
+ }
+ }
+}
+
+@propertyWrapper public final class ClosureAttribute2Optional
+ where A0: JSValueCompatible, A1: JSValueCompatible, ReturnType: JSValueCompatible
+{
+ @usableFromInline let jsObject: JSObject
+ @usableFromInline let name: JSString
+
+ public init(jsObject: JSObject, name: JSString) {
+ self.jsObject = jsObject
+ self.name = name
+ }
+
+ @inlinable public var wrappedValue: ((A0, A1) -> ReturnType)? {
+ get { ClosureAttribute2Optional[name, in: jsObject] }
+ set { ClosureAttribute2Optional[name, in: jsObject] = newValue }
+ }
+
+ @inlinable public static subscript(name: JSString, in jsObject: JSObject) -> ((A0, A1) -> ReturnType)? {
+ get {
+ guard let function = jsObject[name].function else {
+ return nil
+ }
+ return { function($0.jsValue, $1.jsValue).fromJSValue()! }
+ }
+ set {
+ if let newValue = newValue {
+ jsObject[name] = JSClosure {
+ newValue($0[0].fromJSValue()!, $0[1].fromJSValue()!).jsValue
+ }.jsValue
+ } else {
+ jsObject[name] = .null
+ }
+ }
+ }
+}
+
@propertyWrapper public final class ClosureAttribute2OptionalVoid
where A0: JSValueCompatible, A1: JSValueCompatible
{
diff --git a/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift
new file mode 100644
index 00000000..5362a092
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/CountQueuingStrategy.swift
@@ -0,0 +1,26 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+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
+}
diff --git a/Sources/DOMKit/WebIDL/GenericTransformStream.swift b/Sources/DOMKit/WebIDL/GenericTransformStream.swift
new file mode 100644
index 00000000..a5773286
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/GenericTransformStream.swift
@@ -0,0 +1,11 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public protocol GenericTransformStream: JSBridgedClass {}
+public extension GenericTransformStream {
+ @inlinable var readable: ReadableStream { ReadonlyAttribute[Strings.readable, in: jsObject] }
+
+ @inlinable var writable: WritableStream { ReadonlyAttribute[Strings.writable, in: jsObject] }
+}
diff --git a/Sources/DOMKit/WebIDL/QueuingStrategy.swift b/Sources/DOMKit/WebIDL/QueuingStrategy.swift
new file mode 100644
index 00000000..03b8b2e9
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/QueuingStrategy.swift
@@ -0,0 +1,25 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class QueuingStrategy: BridgedDictionary {
+ public convenience init(highWaterMark: Double, size: @escaping QueuingStrategySize) {
+ let object = JSObject.global[Strings.Object].function!.new()
+ object[Strings.highWaterMark] = highWaterMark.jsValue
+ ClosureAttribute1[Strings.size, in: object] = size
+ self.init(unsafelyWrapping: object)
+ }
+
+ public required init(unsafelyWrapping object: JSObject) {
+ _highWaterMark = ReadWriteAttribute(jsObject: object, name: Strings.highWaterMark)
+ _size = ClosureAttribute1(jsObject: object, name: Strings.size)
+ super.init(unsafelyWrapping: object)
+ }
+
+ @ReadWriteAttribute
+ public var highWaterMark: Double
+
+ @ClosureAttribute1
+ public var size: QueuingStrategySize
+}
diff --git a/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift
new file mode 100644
index 00000000..2a51a702
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/QueuingStrategyInit.swift
@@ -0,0 +1,20 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class QueuingStrategyInit: BridgedDictionary {
+ public convenience init(highWaterMark: Double) {
+ let object = JSObject.global[Strings.Object].function!.new()
+ object[Strings.highWaterMark] = highWaterMark.jsValue
+ self.init(unsafelyWrapping: object)
+ }
+
+ public required init(unsafelyWrapping object: JSObject) {
+ _highWaterMark = ReadWriteAttribute(jsObject: object, name: Strings.highWaterMark)
+ super.init(unsafelyWrapping: object)
+ }
+
+ @ReadWriteAttribute
+ public var highWaterMark: Double
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift
new file mode 100644
index 00000000..81277212
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableByteStreamController.swift
@@ -0,0 +1,37 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableByteStreamController: JSBridgedClass {
+ @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableByteStreamController].function! }
+
+ public let jsObject: JSObject
+
+ public required init(unsafelyWrapping jsObject: JSObject) {
+ _byobRequest = ReadonlyAttribute(jsObject: jsObject, name: Strings.byobRequest)
+ _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.desiredSize)
+ self.jsObject = jsObject
+ }
+
+ @ReadonlyAttribute
+ public var byobRequest: ReadableStreamBYOBRequest?
+
+ @ReadonlyAttribute
+ public var desiredSize: Double?
+
+ @inlinable public func close() {
+ let this = jsObject
+ _ = this[Strings.close].function!(this: this, arguments: [])
+ }
+
+ @inlinable public func enqueue(chunk: ArrayBufferView) {
+ let this = jsObject
+ _ = this[Strings.enqueue].function!(this: this, arguments: [chunk.jsValue])
+ }
+
+ @inlinable public func error(e: JSValue? = nil) {
+ let this = jsObject
+ _ = this[Strings.error].function!(this: this, arguments: [e?.jsValue ?? .undefined])
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStream.swift b/Sources/DOMKit/WebIDL/ReadableStream.swift
new file mode 100644
index 00000000..c14936b2
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStream.swift
@@ -0,0 +1,67 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableStream: JSBridgedClass, AsyncSequence {
+ @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableStream].function! }
+
+ public let jsObject: JSObject
+
+ public required init(unsafelyWrapping jsObject: JSObject) {
+ _locked = ReadonlyAttribute(jsObject: jsObject, name: Strings.locked)
+ self.jsObject = jsObject
+ }
+
+ @inlinable public convenience init(underlyingSource: JSObject? = nil, strategy: QueuingStrategy? = nil) {
+ self.init(unsafelyWrapping: Self.constructor.new(arguments: [underlyingSource?.jsValue ?? .undefined, strategy?.jsValue ?? .undefined]))
+ }
+
+ @ReadonlyAttribute
+ public var locked: Bool
+
+ @inlinable public func cancel(reason: JSValue? = nil) -> JSPromise {
+ let this = jsObject
+ return this[Strings.cancel].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()!
+ }
+
+ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
+ @inlinable public func cancel(reason: JSValue? = nil) async throws {
+ let this = jsObject
+ let _promise: JSPromise = this[Strings.cancel].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()!
+ _ = try await _promise.value
+ }
+
+ @inlinable public func getReader(options: ReadableStreamGetReaderOptions? = nil) -> ReadableStreamReader {
+ let this = jsObject
+ return this[Strings.getReader].function!(this: this, arguments: [options?.jsValue ?? .undefined]).fromJSValue()!
+ }
+
+ @inlinable public func pipeThrough(transform: ReadableWritablePair, options: StreamPipeOptions? = nil) -> Self {
+ let this = jsObject
+ return this[Strings.pipeThrough].function!(this: this, arguments: [transform.jsValue, options?.jsValue ?? .undefined]).fromJSValue()!
+ }
+
+ @inlinable public func pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) -> JSPromise {
+ let this = jsObject
+ return this[Strings.pipeTo].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 pipeTo(destination: WritableStream, options: StreamPipeOptions? = nil) async throws {
+ let this = jsObject
+ let _promise: JSPromise = this[Strings.pipeTo].function!(this: this, arguments: [destination.jsValue, options?.jsValue ?? .undefined]).fromJSValue()!
+ _ = try await _promise.value
+ }
+
+ @inlinable public func tee() -> [ReadableStream] {
+ let this = jsObject
+ return this[Strings.tee].function!(this: this, arguments: []).fromJSValue()!
+ }
+
+ public typealias Element = JSValue
+ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
+ public func makeAsyncIterator() -> ValueIterableAsyncIterator {
+ ValueIterableAsyncIterator(sequence: self)
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift
new file mode 100644
index 00000000..63ef6097
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReadResult.swift
@@ -0,0 +1,25 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableStreamBYOBReadResult: BridgedDictionary {
+ public convenience init(value: ArrayBufferView?, done: Bool) {
+ let object = JSObject.global[Strings.Object].function!.new()
+ object[Strings.value] = value.jsValue
+ object[Strings.done] = done.jsValue
+ self.init(unsafelyWrapping: object)
+ }
+
+ public required init(unsafelyWrapping object: JSObject) {
+ _value = ReadWriteAttribute(jsObject: object, name: Strings.value)
+ _done = ReadWriteAttribute(jsObject: object, name: Strings.done)
+ super.init(unsafelyWrapping: object)
+ }
+
+ @ReadWriteAttribute
+ public var value: ArrayBufferView?
+
+ @ReadWriteAttribute
+ public var done: Bool
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift
new file mode 100644
index 00000000..588d7eb2
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBReader.swift
@@ -0,0 +1,35 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableStreamBYOBReader: JSBridgedClass, ReadableStreamGenericReader {
+ @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamBYOBReader].function! }
+
+ public let jsObject: JSObject
+
+ public required init(unsafelyWrapping jsObject: JSObject) {
+ self.jsObject = jsObject
+ }
+
+ @inlinable public convenience init(stream: ReadableStream) {
+ self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue]))
+ }
+
+ @inlinable public func read(view: ArrayBufferView) -> JSPromise {
+ let this = jsObject
+ return this[Strings.read].function!(this: this, arguments: [view.jsValue]).fromJSValue()!
+ }
+
+ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
+ @inlinable public func read(view: ArrayBufferView) async throws -> ReadableStreamBYOBReadResult {
+ let this = jsObject
+ let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: [view.jsValue]).fromJSValue()!
+ return try await _promise.value.fromJSValue()!
+ }
+
+ @inlinable public func releaseLock() {
+ let this = jsObject
+ _ = this[Strings.releaseLock].function!(this: this, arguments: [])
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift
new file mode 100644
index 00000000..9a1d23f6
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamBYOBRequest.swift
@@ -0,0 +1,28 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableStreamBYOBRequest: JSBridgedClass {
+ @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamBYOBRequest].function! }
+
+ public let jsObject: JSObject
+
+ public required init(unsafelyWrapping jsObject: JSObject) {
+ _view = ReadonlyAttribute(jsObject: jsObject, name: Strings.view)
+ self.jsObject = jsObject
+ }
+
+ @ReadonlyAttribute
+ public var view: ArrayBufferView?
+
+ @inlinable public func respond(bytesWritten: UInt64) {
+ let this = jsObject
+ _ = this[Strings.respond].function!(this: this, arguments: [bytesWritten.jsValue])
+ }
+
+ @inlinable public func respondWithNewView(view: ArrayBufferView) {
+ let this = jsObject
+ _ = this[Strings.respondWithNewView].function!(this: this, arguments: [view.jsValue])
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamController.swift b/Sources/DOMKit/WebIDL/ReadableStreamController.swift
new file mode 100644
index 00000000..35f64ee7
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamController.swift
@@ -0,0 +1,46 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public protocol Any_ReadableStreamController: ConvertibleToJSValue {}
+extension ReadableByteStreamController: Any_ReadableStreamController {}
+extension ReadableStreamDefaultController: Any_ReadableStreamController {}
+
+public enum ReadableStreamController: JSValueCompatible, Any_ReadableStreamController {
+ case readableByteStreamController(ReadableByteStreamController)
+ case readableStreamDefaultController(ReadableStreamDefaultController)
+
+ var readableByteStreamController: ReadableByteStreamController? {
+ switch self {
+ case let .readableByteStreamController(readableByteStreamController): return readableByteStreamController
+ default: return nil
+ }
+ }
+
+ var readableStreamDefaultController: ReadableStreamDefaultController? {
+ switch self {
+ case let .readableStreamDefaultController(readableStreamDefaultController): return readableStreamDefaultController
+ default: return nil
+ }
+ }
+
+ public static func construct(from value: JSValue) -> Self? {
+ if let readableByteStreamController: ReadableByteStreamController = value.fromJSValue() {
+ return .readableByteStreamController(readableByteStreamController)
+ }
+ if let readableStreamDefaultController: ReadableStreamDefaultController = value.fromJSValue() {
+ return .readableStreamDefaultController(readableStreamDefaultController)
+ }
+ return nil
+ }
+
+ public var jsValue: JSValue {
+ switch self {
+ case let .readableByteStreamController(readableByteStreamController):
+ return readableByteStreamController.jsValue
+ case let .readableStreamDefaultController(readableStreamDefaultController):
+ return readableStreamDefaultController.jsValue
+ }
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift
new file mode 100644
index 00000000..0b2c0f9d
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultController.swift
@@ -0,0 +1,33 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableStreamDefaultController: JSBridgedClass {
+ @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamDefaultController].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 close() {
+ let this = jsObject
+ _ = this[Strings.close].function!(this: this, arguments: [])
+ }
+
+ @inlinable public func enqueue(chunk: JSValue? = nil) {
+ let this = jsObject
+ _ = this[Strings.enqueue].function!(this: this, arguments: [chunk?.jsValue ?? .undefined])
+ }
+
+ @inlinable public func error(e: JSValue? = nil) {
+ let this = jsObject
+ _ = this[Strings.error].function!(this: this, arguments: [e?.jsValue ?? .undefined])
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift
new file mode 100644
index 00000000..ea49a802
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReadResult.swift
@@ -0,0 +1,25 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableStreamDefaultReadResult: BridgedDictionary {
+ public convenience init(value: JSValue, done: Bool) {
+ let object = JSObject.global[Strings.Object].function!.new()
+ object[Strings.value] = value.jsValue
+ object[Strings.done] = done.jsValue
+ self.init(unsafelyWrapping: object)
+ }
+
+ public required init(unsafelyWrapping object: JSObject) {
+ _value = ReadWriteAttribute(jsObject: object, name: Strings.value)
+ _done = ReadWriteAttribute(jsObject: object, name: Strings.done)
+ super.init(unsafelyWrapping: object)
+ }
+
+ @ReadWriteAttribute
+ public var value: JSValue
+
+ @ReadWriteAttribute
+ public var done: Bool
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift
new file mode 100644
index 00000000..b4116c98
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamDefaultReader.swift
@@ -0,0 +1,35 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableStreamDefaultReader: JSBridgedClass, ReadableStreamGenericReader {
+ @inlinable public class var constructor: JSFunction { JSObject.global[Strings.ReadableStreamDefaultReader].function! }
+
+ public let jsObject: JSObject
+
+ public required init(unsafelyWrapping jsObject: JSObject) {
+ self.jsObject = jsObject
+ }
+
+ @inlinable public convenience init(stream: ReadableStream) {
+ self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue]))
+ }
+
+ @inlinable public func read() -> JSPromise {
+ let this = jsObject
+ return this[Strings.read].function!(this: this, arguments: []).fromJSValue()!
+ }
+
+ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
+ @inlinable public func read() async throws -> ReadableStreamDefaultReadResult {
+ let this = jsObject
+ let _promise: JSPromise = this[Strings.read].function!(this: this, arguments: []).fromJSValue()!
+ return try await _promise.value.fromJSValue()!
+ }
+
+ @inlinable public func releaseLock() {
+ let this = jsObject
+ _ = this[Strings.releaseLock].function!(this: this, arguments: [])
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift
new file mode 100644
index 00000000..d3206c23
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamGenericReader.swift
@@ -0,0 +1,21 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public protocol ReadableStreamGenericReader: JSBridgedClass {}
+public extension ReadableStreamGenericReader {
+ @inlinable var closed: JSPromise { ReadonlyAttribute[Strings.closed, in: jsObject] }
+
+ @inlinable func cancel(reason: JSValue? = nil) -> JSPromise {
+ let this = jsObject
+ return this[Strings.cancel].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()!
+ }
+
+ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
+ @inlinable func cancel(reason: JSValue? = nil) async throws {
+ let this = jsObject
+ let _promise: JSPromise = this[Strings.cancel].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()!
+ _ = try await _promise.value
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift
new file mode 100644
index 00000000..82edb7bc
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamGetReaderOptions.swift
@@ -0,0 +1,20 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableStreamGetReaderOptions: BridgedDictionary {
+ public convenience init(mode: ReadableStreamReaderMode) {
+ let object = JSObject.global[Strings.Object].function!.new()
+ object[Strings.mode] = mode.jsValue
+ self.init(unsafelyWrapping: object)
+ }
+
+ public required init(unsafelyWrapping object: JSObject) {
+ _mode = ReadWriteAttribute(jsObject: object, name: Strings.mode)
+ super.init(unsafelyWrapping: object)
+ }
+
+ @ReadWriteAttribute
+ public var mode: ReadableStreamReaderMode
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift
new file mode 100644
index 00000000..4ba41ccb
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamIteratorOptions.swift
@@ -0,0 +1,20 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableStreamIteratorOptions: BridgedDictionary {
+ public convenience init(preventCancel: Bool) {
+ let object = JSObject.global[Strings.Object].function!.new()
+ object[Strings.preventCancel] = preventCancel.jsValue
+ self.init(unsafelyWrapping: object)
+ }
+
+ public required init(unsafelyWrapping object: JSObject) {
+ _preventCancel = ReadWriteAttribute(jsObject: object, name: Strings.preventCancel)
+ super.init(unsafelyWrapping: object)
+ }
+
+ @ReadWriteAttribute
+ public var preventCancel: Bool
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamReader.swift b/Sources/DOMKit/WebIDL/ReadableStreamReader.swift
new file mode 100644
index 00000000..03543e03
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamReader.swift
@@ -0,0 +1,46 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public protocol Any_ReadableStreamReader: ConvertibleToJSValue {}
+extension ReadableStreamBYOBReader: Any_ReadableStreamReader {}
+extension ReadableStreamDefaultReader: Any_ReadableStreamReader {}
+
+public enum ReadableStreamReader: JSValueCompatible, Any_ReadableStreamReader {
+ case readableStreamBYOBReader(ReadableStreamBYOBReader)
+ case readableStreamDefaultReader(ReadableStreamDefaultReader)
+
+ var readableStreamBYOBReader: ReadableStreamBYOBReader? {
+ switch self {
+ case let .readableStreamBYOBReader(readableStreamBYOBReader): return readableStreamBYOBReader
+ default: return nil
+ }
+ }
+
+ var readableStreamDefaultReader: ReadableStreamDefaultReader? {
+ switch self {
+ case let .readableStreamDefaultReader(readableStreamDefaultReader): return readableStreamDefaultReader
+ default: return nil
+ }
+ }
+
+ public static func construct(from value: JSValue) -> Self? {
+ if let readableStreamBYOBReader: ReadableStreamBYOBReader = value.fromJSValue() {
+ return .readableStreamBYOBReader(readableStreamBYOBReader)
+ }
+ if let readableStreamDefaultReader: ReadableStreamDefaultReader = value.fromJSValue() {
+ return .readableStreamDefaultReader(readableStreamDefaultReader)
+ }
+ return nil
+ }
+
+ public var jsValue: JSValue {
+ switch self {
+ case let .readableStreamBYOBReader(readableStreamBYOBReader):
+ return readableStreamBYOBReader.jsValue
+ case let .readableStreamDefaultReader(readableStreamDefaultReader):
+ return readableStreamDefaultReader.jsValue
+ }
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift
new file mode 100644
index 00000000..2e2b80e3
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamReaderMode.swift
@@ -0,0 +1,21 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public enum ReadableStreamReaderMode: JSString, JSValueCompatible {
+ case byob = "byob"
+
+ @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/ReadableStreamType.swift b/Sources/DOMKit/WebIDL/ReadableStreamType.swift
new file mode 100644
index 00000000..a2c88e92
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableStreamType.swift
@@ -0,0 +1,21 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public enum ReadableStreamType: JSString, JSValueCompatible {
+ case bytes = "bytes"
+
+ @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/ReadableWritablePair.swift b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift
new file mode 100644
index 00000000..fb2fb13b
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/ReadableWritablePair.swift
@@ -0,0 +1,25 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class ReadableWritablePair: BridgedDictionary {
+ public convenience init(readable: ReadableStream, writable: WritableStream) {
+ let object = JSObject.global[Strings.Object].function!.new()
+ object[Strings.readable] = readable.jsValue
+ object[Strings.writable] = writable.jsValue
+ self.init(unsafelyWrapping: object)
+ }
+
+ public required init(unsafelyWrapping object: JSObject) {
+ _readable = ReadWriteAttribute(jsObject: object, name: Strings.readable)
+ _writable = ReadWriteAttribute(jsObject: object, name: Strings.writable)
+ super.init(unsafelyWrapping: object)
+ }
+
+ @ReadWriteAttribute
+ public var readable: ReadableStream
+
+ @ReadWriteAttribute
+ public var writable: WritableStream
+}
diff --git a/Sources/DOMKit/WebIDL/StreamPipeOptions.swift b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift
new file mode 100644
index 00000000..5ef69c77
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/StreamPipeOptions.swift
@@ -0,0 +1,35 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class StreamPipeOptions: BridgedDictionary {
+ public convenience init(preventClose: Bool, preventAbort: Bool, preventCancel: Bool, signal: AbortSignal) {
+ let object = JSObject.global[Strings.Object].function!.new()
+ object[Strings.preventClose] = preventClose.jsValue
+ object[Strings.preventAbort] = preventAbort.jsValue
+ object[Strings.preventCancel] = preventCancel.jsValue
+ object[Strings.signal] = signal.jsValue
+ self.init(unsafelyWrapping: object)
+ }
+
+ public required init(unsafelyWrapping object: JSObject) {
+ _preventClose = ReadWriteAttribute(jsObject: object, name: Strings.preventClose)
+ _preventAbort = ReadWriteAttribute(jsObject: object, name: Strings.preventAbort)
+ _preventCancel = ReadWriteAttribute(jsObject: object, name: Strings.preventCancel)
+ _signal = ReadWriteAttribute(jsObject: object, name: Strings.signal)
+ super.init(unsafelyWrapping: object)
+ }
+
+ @ReadWriteAttribute
+ public var preventClose: Bool
+
+ @ReadWriteAttribute
+ public var preventAbort: Bool
+
+ @ReadWriteAttribute
+ public var preventCancel: Bool
+
+ @ReadWriteAttribute
+ public var signal: AbortSignal
+}
diff --git a/Sources/DOMKit/WebIDL/Strings.swift b/Sources/DOMKit/WebIDL/Strings.swift
index 0318a71e..ae59925e 100644
--- a/Sources/DOMKit/WebIDL/Strings.swift
+++ b/Sources/DOMKit/WebIDL/Strings.swift
@@ -19,6 +19,7 @@ import JavaScriptKit
@usableFromInline static let BeforeUnloadEvent: JSString = "BeforeUnloadEvent"
@usableFromInline static let Blob: JSString = "Blob"
@usableFromInline static let BroadcastChannel: JSString = "BroadcastChannel"
+ @usableFromInline static let ByteLengthQueuingStrategy: JSString = "ByteLengthQueuingStrategy"
@usableFromInline static let CDATASection: JSString = "CDATASection"
@usableFromInline static let Cache: JSString = "Cache"
@usableFromInline static let CacheStorage: JSString = "CacheStorage"
@@ -29,6 +30,7 @@ import JavaScriptKit
@usableFromInline static let CharacterData: JSString = "CharacterData"
@usableFromInline static let Comment: JSString = "Comment"
@usableFromInline static let CompositionEvent: JSString = "CompositionEvent"
+ @usableFromInline static let CountQueuingStrategy: JSString = "CountQueuingStrategy"
@usableFromInline static let CustomElementRegistry: JSString = "CustomElementRegistry"
@usableFromInline static let CustomEvent: JSString = "CustomEvent"
@usableFromInline static let DOMException: JSString = "DOMException"
@@ -182,6 +184,12 @@ import JavaScriptKit
@usableFromInline static let PromiseRejectionEvent: JSString = "PromiseRejectionEvent"
@usableFromInline static let RadioNodeList: JSString = "RadioNodeList"
@usableFromInline static let Range: JSString = "Range"
+ @usableFromInline static let ReadableByteStreamController: JSString = "ReadableByteStreamController"
+ @usableFromInline static let ReadableStream: JSString = "ReadableStream"
+ @usableFromInline static let ReadableStreamBYOBReader: JSString = "ReadableStreamBYOBReader"
+ @usableFromInline static let ReadableStreamBYOBRequest: JSString = "ReadableStreamBYOBRequest"
+ @usableFromInline static let ReadableStreamDefaultController: JSString = "ReadableStreamDefaultController"
+ @usableFromInline static let ReadableStreamDefaultReader: JSString = "ReadableStreamDefaultReader"
@usableFromInline static let Request: JSString = "Request"
@usableFromInline static let Response: JSString = "Response"
@usableFromInline static let ServiceWorker: JSString = "ServiceWorker"
@@ -201,6 +209,8 @@ import JavaScriptKit
@usableFromInline static let TextTrackList: JSString = "TextTrackList"
@usableFromInline static let TimeRanges: JSString = "TimeRanges"
@usableFromInline static let TrackEvent: JSString = "TrackEvent"
+ @usableFromInline static let TransformStream: JSString = "TransformStream"
+ @usableFromInline static let TransformStreamDefaultController: JSString = "TransformStreamDefaultController"
@usableFromInline static let TreeWalker: JSString = "TreeWalker"
@usableFromInline static let UIEvent: JSString = "UIEvent"
@usableFromInline static let URL: JSString = "URL"
@@ -212,6 +222,9 @@ import JavaScriptKit
@usableFromInline static let Window: JSString = "Window"
@usableFromInline static let Worker: JSString = "Worker"
@usableFromInline static let Worklet: JSString = "Worklet"
+ @usableFromInline static let WritableStream: JSString = "WritableStream"
+ @usableFromInline static let WritableStreamDefaultController: JSString = "WritableStreamDefaultController"
+ @usableFromInline static let WritableStreamDefaultWriter: JSString = "WritableStreamDefaultWriter"
@usableFromInline static let XMLDocument: JSString = "XMLDocument"
@usableFromInline static let XMLHttpRequest: JSString = "XMLHttpRequest"
@usableFromInline static let XMLHttpRequestEventTarget: JSString = "XMLHttpRequestEventTarget"
@@ -329,6 +342,7 @@ import JavaScriptKit
@usableFromInline static let attributeOldValue: JSString = "attributeOldValue"
@usableFromInline static let attributes: JSString = "attributes"
@usableFromInline static let audioTracks: JSString = "audioTracks"
+ @usableFromInline static let autoAllocateChunkSize: JSString = "autoAllocateChunkSize"
@usableFromInline static let autocapitalize: JSString = "autocapitalize"
@usableFromInline static let autocomplete: JSString = "autocomplete"
@usableFromInline static let autofocus: JSString = "autofocus"
@@ -357,6 +371,7 @@ import JavaScriptKit
@usableFromInline static let buffered: JSString = "buffered"
@usableFromInline static let button: JSString = "button"
@usableFromInline static let buttons: JSString = "buttons"
+ @usableFromInline static let byobRequest: JSString = "byobRequest"
@usableFromInline static let c: JSString = "c"
@usableFromInline static let cache: JSString = "cache"
@usableFromInline static let cacheName: JSString = "cacheName"
@@ -520,6 +535,7 @@ import JavaScriptKit
@usableFromInline static let deltaZ: JSString = "deltaZ"
@usableFromInline static let description: JSString = "description"
@usableFromInline static let designMode: JSString = "designMode"
+ @usableFromInline static let desiredSize: JSString = "desiredSize"
@usableFromInline static let destination: JSString = "destination"
@usableFromInline static let desynchronized: JSString = "desynchronized"
@usableFromInline static let detach: JSString = "detach"
@@ -536,6 +552,7 @@ import JavaScriptKit
@usableFromInline static let documentElement: JSString = "documentElement"
@usableFromInline static let documentURI: JSString = "documentURI"
@usableFromInline static let domain: JSString = "domain"
+ @usableFromInline static let done: JSString = "done"
@usableFromInline static let download: JSString = "download"
@usableFromInline static let draggable: JSString = "draggable"
@usableFromInline static let drawFocusIfNeeded: JSString = "drawFocusIfNeeded"
@@ -563,6 +580,7 @@ import JavaScriptKit
@usableFromInline static let endTime: JSString = "endTime"
@usableFromInline static let ended: JSString = "ended"
@usableFromInline static let endings: JSString = "endings"
+ @usableFromInline static let enqueue: JSString = "enqueue"
@usableFromInline static let enterKeyHint: JSString = "enterKeyHint"
@usableFromInline static let error: JSString = "error"
@usableFromInline static let evaluate: JSString = "evaluate"
@@ -591,6 +609,7 @@ import JavaScriptKit
@usableFromInline static let flatten: JSString = "flatten"
@usableFromInline static let flipX: JSString = "flipX"
@usableFromInline static let flipY: JSString = "flipY"
+ @usableFromInline static let flush: JSString = "flush"
@usableFromInline static let focus: JSString = "focus"
@usableFromInline static let font: JSString = "font"
@usableFromInline static let fontBoundingBoxAscent: JSString = "fontBoundingBoxAscent"
@@ -644,6 +663,7 @@ import JavaScriptKit
@usableFromInline static let getModifierState: JSString = "getModifierState"
@usableFromInline static let getNamedItemNS: JSString = "getNamedItemNS"
@usableFromInline static let getParameter: JSString = "getParameter"
+ @usableFromInline static let getReader: JSString = "getReader"
@usableFromInline static let getRegistration: JSString = "getRegistration"
@usableFromInline static let getRegistrations: JSString = "getRegistrations"
@usableFromInline static let getResponseHeader: JSString = "getResponseHeader"
@@ -654,6 +674,7 @@ import JavaScriptKit
@usableFromInline static let getTiming: JSString = "getTiming"
@usableFromInline static let getTrackById: JSString = "getTrackById"
@usableFromInline static let getTransform: JSString = "getTransform"
+ @usableFromInline static let getWriter: JSString = "getWriter"
@usableFromInline static let globalAlpha: JSString = "globalAlpha"
@usableFromInline static let globalCompositeOperation: JSString = "globalCompositeOperation"
@usableFromInline static let go: JSString = "go"
@@ -674,6 +695,7 @@ import JavaScriptKit
@usableFromInline static let height: JSString = "height"
@usableFromInline static let hidden: JSString = "hidden"
@usableFromInline static let high: JSString = "high"
+ @usableFromInline static let highWaterMark: JSString = "highWaterMark"
@usableFromInline static let history: JSString = "history"
@usableFromInline static let host: JSString = "host"
@usableFromInline static let hostname: JSString = "hostname"
@@ -787,6 +809,7 @@ import JavaScriptKit
@usableFromInline static let localStorage: JSString = "localStorage"
@usableFromInline static let location: JSString = "location"
@usableFromInline static let locationbar: JSString = "locationbar"
+ @usableFromInline static let locked: JSString = "locked"
@usableFromInline static let longDesc: JSString = "longDesc"
@usableFromInline static let lookupNamespaceURI: JSString = "lookupNamespaceURI"
@usableFromInline static let lookupPrefix: JSString = "lookupPrefix"
@@ -1013,6 +1036,8 @@ import JavaScriptKit
@usableFromInline static let personalbar: JSString = "personalbar"
@usableFromInline static let phase: JSString = "phase"
@usableFromInline static let ping: JSString = "ping"
+ @usableFromInline static let pipeThrough: JSString = "pipeThrough"
+ @usableFromInline static let pipeTo: JSString = "pipeTo"
@usableFromInline static let placeholder: JSString = "placeholder"
@usableFromInline static let platform: JSString = "platform"
@usableFromInline static let play: JSString = "play"
@@ -1037,6 +1062,9 @@ import JavaScriptKit
@usableFromInline static let prepend: JSString = "prepend"
@usableFromInline static let preservesPitch: JSString = "preservesPitch"
@usableFromInline static let prevValue: JSString = "prevValue"
+ @usableFromInline static let preventAbort: JSString = "preventAbort"
+ @usableFromInline static let preventCancel: JSString = "preventCancel"
+ @usableFromInline static let preventClose: JSString = "preventClose"
@usableFromInline static let preventDefault: JSString = "preventDefault"
@usableFromInline static let preventScroll: JSString = "preventScroll"
@usableFromInline static let previousElementSibling: JSString = "previousElementSibling"
@@ -1051,6 +1079,7 @@ import JavaScriptKit
@usableFromInline static let `protocol`: JSString = "protocol"
@usableFromInline static let pseudoElement: JSString = "pseudoElement"
@usableFromInline static let publicId: JSString = "publicId"
+ @usableFromInline static let pull: JSString = "pull"
@usableFromInline static let pushState: JSString = "pushState"
@usableFromInline static let put: JSString = "put"
@usableFromInline static let putImageData: JSString = "putImageData"
@@ -1065,11 +1094,14 @@ import JavaScriptKit
@usableFromInline static let querySelectorAll: JSString = "querySelectorAll"
@usableFromInline static let rangeOverflow: JSString = "rangeOverflow"
@usableFromInline static let rangeUnderflow: JSString = "rangeUnderflow"
+ @usableFromInline static let read: JSString = "read"
@usableFromInline static let readAsArrayBuffer: JSString = "readAsArrayBuffer"
@usableFromInline static let readAsBinaryString: JSString = "readAsBinaryString"
@usableFromInline static let readAsDataURL: JSString = "readAsDataURL"
@usableFromInline static let readAsText: JSString = "readAsText"
@usableFromInline static let readOnly: JSString = "readOnly"
+ @usableFromInline static let readable: JSString = "readable"
+ @usableFromInline static let readableType: JSString = "readableType"
@usableFromInline static let ready: JSString = "ready"
@usableFromInline static let readyState: JSString = "readyState"
@usableFromInline static let reason: JSString = "reason"
@@ -1087,6 +1119,7 @@ import JavaScriptKit
@usableFromInline static let relatedNode: JSString = "relatedNode"
@usableFromInline static let relatedTarget: JSString = "relatedTarget"
@usableFromInline static let releaseEvents: JSString = "releaseEvents"
+ @usableFromInline static let releaseLock: JSString = "releaseLock"
@usableFromInline static let reload: JSString = "reload"
@usableFromInline static let remove: JSString = "remove"
@usableFromInline static let removeAttribute: JSString = "removeAttribute"
@@ -1116,6 +1149,8 @@ import JavaScriptKit
@usableFromInline static let resizeHeight: JSString = "resizeHeight"
@usableFromInline static let resizeQuality: JSString = "resizeQuality"
@usableFromInline static let resizeWidth: JSString = "resizeWidth"
+ @usableFromInline static let respond: JSString = "respond"
+ @usableFromInline static let respondWithNewView: JSString = "respondWithNewView"
@usableFromInline static let response: JSString = "response"
@usableFromInline static let responseText: JSString = "responseText"
@usableFromInline static let responseType: JSString = "responseType"
@@ -1285,6 +1320,7 @@ import JavaScriptKit
@usableFromInline static let takeRecords: JSString = "takeRecords"
@usableFromInline static let target: JSString = "target"
@usableFromInline static let targetOrigin: JSString = "targetOrigin"
+ @usableFromInline static let tee: JSString = "tee"
@usableFromInline static let terminate: JSString = "terminate"
@usableFromInline static let text: JSString = "text"
@usableFromInline static let textAlign: JSString = "textAlign"
@@ -1374,6 +1410,8 @@ import JavaScriptKit
@usableFromInline static let withCredentials: JSString = "withCredentials"
@usableFromInline static let wordSpacing: JSString = "wordSpacing"
@usableFromInline static let wrap: JSString = "wrap"
+ @usableFromInline static let writable: JSString = "writable"
+ @usableFromInline static let writableType: JSString = "writableType"
@usableFromInline static let write: JSString = "write"
@usableFromInline static let writeln: JSString = "writeln"
@usableFromInline static let x: JSString = "x"
diff --git a/Sources/DOMKit/WebIDL/TransformStream.swift b/Sources/DOMKit/WebIDL/TransformStream.swift
new file mode 100644
index 00000000..8c846726
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/TransformStream.swift
@@ -0,0 +1,26 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+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
+}
diff --git a/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift
new file mode 100644
index 00000000..eb2e5927
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/TransformStreamDefaultController.swift
@@ -0,0 +1,33 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+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: [])
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/Transformer.swift b/Sources/DOMKit/WebIDL/Transformer.swift
new file mode 100644
index 00000000..d1a8bce6
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/Transformer.swift
@@ -0,0 +1,40 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+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
+
+ @ReadWriteAttribute
+ public var writableType: JSValue
+}
diff --git a/Sources/DOMKit/WebIDL/Typedefs.swift b/Sources/DOMKit/WebIDL/Typedefs.swift
index a44e06f7..ae245c46 100644
--- a/Sources/DOMKit/WebIDL/Typedefs.swift
+++ b/Sources/DOMKit/WebIDL/Typedefs.swift
@@ -22,3 +22,14 @@ public typealias OnErrorEventHandlerNonNull = (Event_or_String, String, UInt32,
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
diff --git a/Sources/DOMKit/WebIDL/UnderlyingSink.swift b/Sources/DOMKit/WebIDL/UnderlyingSink.swift
new file mode 100644
index 00000000..e4f52ec2
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/UnderlyingSink.swift
@@ -0,0 +1,40 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+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.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)
+ _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: UnderlyingSinkStartCallback
+
+ @ClosureAttribute2
+ public var write: UnderlyingSinkWriteCallback
+
+ @ClosureAttribute0
+ public var close: UnderlyingSinkCloseCallback
+
+ @ClosureAttribute1
+ public var abort: UnderlyingSinkAbortCallback
+
+ @ReadWriteAttribute
+ public var type: JSValue
+}
diff --git a/Sources/DOMKit/WebIDL/UnderlyingSource.swift b/Sources/DOMKit/WebIDL/UnderlyingSource.swift
new file mode 100644
index 00000000..65db6d2f
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/UnderlyingSource.swift
@@ -0,0 +1,40 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+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 type: ReadableStreamType
+
+ @ReadWriteAttribute
+ public var autoAllocateChunkSize: UInt64
+}
diff --git a/Sources/DOMKit/WebIDL/WritableStream.swift b/Sources/DOMKit/WebIDL/WritableStream.swift
new file mode 100644
index 00000000..779b06d5
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/WritableStream.swift
@@ -0,0 +1,51 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class WritableStream: JSBridgedClass {
+ @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WritableStream].function! }
+
+ public let jsObject: JSObject
+
+ public required init(unsafelyWrapping jsObject: JSObject) {
+ _locked = ReadonlyAttribute(jsObject: jsObject, name: Strings.locked)
+ self.jsObject = jsObject
+ }
+
+ @inlinable public convenience init(underlyingSink: JSObject? = nil, strategy: QueuingStrategy? = nil) {
+ self.init(unsafelyWrapping: Self.constructor.new(arguments: [underlyingSink?.jsValue ?? .undefined, strategy?.jsValue ?? .undefined]))
+ }
+
+ @ReadonlyAttribute
+ public var locked: Bool
+
+ @inlinable public func abort(reason: JSValue? = nil) -> JSPromise {
+ let this = jsObject
+ return this[Strings.abort].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()!
+ }
+
+ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
+ @inlinable public func abort(reason: JSValue? = nil) async throws {
+ let this = jsObject
+ let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()!
+ _ = try await _promise.value
+ }
+
+ @inlinable public func close() -> JSPromise {
+ let this = jsObject
+ return this[Strings.close].function!(this: this, arguments: []).fromJSValue()!
+ }
+
+ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
+ @inlinable public func close() async throws {
+ let this = jsObject
+ let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()!
+ _ = try await _promise.value
+ }
+
+ @inlinable public func getWriter() -> WritableStreamDefaultWriter {
+ let this = jsObject
+ return this[Strings.getWriter].function!(this: this, arguments: []).fromJSValue()!
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift
new file mode 100644
index 00000000..b6ab0100
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultController.swift
@@ -0,0 +1,23 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class WritableStreamDefaultController: JSBridgedClass {
+ @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WritableStreamDefaultController].function! }
+
+ public let jsObject: JSObject
+
+ public required init(unsafelyWrapping jsObject: JSObject) {
+ _signal = ReadonlyAttribute(jsObject: jsObject, name: Strings.signal)
+ self.jsObject = jsObject
+ }
+
+ @ReadonlyAttribute
+ public var signal: AbortSignal
+
+ @inlinable public func error(e: JSValue? = nil) {
+ let this = jsObject
+ _ = this[Strings.error].function!(this: this, arguments: [e?.jsValue ?? .undefined])
+ }
+}
diff --git a/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift
new file mode 100644
index 00000000..bd266356
--- /dev/null
+++ b/Sources/DOMKit/WebIDL/WritableStreamDefaultWriter.swift
@@ -0,0 +1,71 @@
+// This file was auto-generated by WebIDLToSwift. DO NOT EDIT!
+
+import JavaScriptEventLoop
+import JavaScriptKit
+
+public class WritableStreamDefaultWriter: JSBridgedClass {
+ @inlinable public class var constructor: JSFunction { JSObject.global[Strings.WritableStreamDefaultWriter].function! }
+
+ public let jsObject: JSObject
+
+ public required init(unsafelyWrapping jsObject: JSObject) {
+ _closed = ReadonlyAttribute(jsObject: jsObject, name: Strings.closed)
+ _desiredSize = ReadonlyAttribute(jsObject: jsObject, name: Strings.desiredSize)
+ _ready = ReadonlyAttribute(jsObject: jsObject, name: Strings.ready)
+ self.jsObject = jsObject
+ }
+
+ @inlinable public convenience init(stream: WritableStream) {
+ self.init(unsafelyWrapping: Self.constructor.new(arguments: [stream.jsValue]))
+ }
+
+ @ReadonlyAttribute
+ public var closed: JSPromise
+
+ @ReadonlyAttribute
+ public var desiredSize: Double?
+
+ @ReadonlyAttribute
+ public var ready: JSPromise
+
+ @inlinable public func abort(reason: JSValue? = nil) -> JSPromise {
+ let this = jsObject
+ return this[Strings.abort].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()!
+ }
+
+ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
+ @inlinable public func abort(reason: JSValue? = nil) async throws {
+ let this = jsObject
+ let _promise: JSPromise = this[Strings.abort].function!(this: this, arguments: [reason?.jsValue ?? .undefined]).fromJSValue()!
+ _ = try await _promise.value
+ }
+
+ @inlinable public func close() -> JSPromise {
+ let this = jsObject
+ return this[Strings.close].function!(this: this, arguments: []).fromJSValue()!
+ }
+
+ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
+ @inlinable public func close() async throws {
+ let this = jsObject
+ let _promise: JSPromise = this[Strings.close].function!(this: this, arguments: []).fromJSValue()!
+ _ = try await _promise.value
+ }
+
+ @inlinable public func releaseLock() {
+ let this = jsObject
+ _ = this[Strings.releaseLock].function!(this: this, arguments: [])
+ }
+
+ @inlinable public func write(chunk: JSValue? = nil) -> JSPromise {
+ let this = jsObject
+ return this[Strings.write].function!(this: this, arguments: [chunk?.jsValue ?? .undefined]).fromJSValue()!
+ }
+
+ @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
+ @inlinable public func write(chunk: JSValue? = nil) async throws {
+ let this = jsObject
+ let _promise: JSPromise = this[Strings.write].function!(this: this, arguments: [chunk?.jsValue ?? .undefined]).fromJSValue()!
+ _ = try await _promise.value
+ }
+}
diff --git a/parse-idl/parse-all.js b/parse-idl/parse-all.js
index de36842c..c35564cf 100644
--- a/parse-idl/parse-all.js
+++ b/parse-idl/parse-all.js
@@ -21,6 +21,7 @@ console.log(
"xhr",
"service-workers",
"url",
+ "streams",
].map((key) => parsedFiles[key]),
null,
2